Module: wine Branch: master Commit: b5a33f02d3ca63717b2e5f6751c556139467b276 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b5a33f02d3ca63717b2e5f6751...
Author: Jan Schmidt jan@centricular.com Date: Wed Jul 20 14:37:10 2016 +1000
quartz: Images in Direct3D surfaces must be top-down.
Invert images when copying to a Direct3D surface if they are provided bottom-up.
Signed-off-by: Jan Schmidt jan@centricular.com Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/quartz/vmr9.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index f2c3d93..d590a71 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -255,7 +255,17 @@ static DWORD VMR9_SendSampleData(struct quartz_vmr *This, VMR9PresentationInfo * return hr; }
- if (lock.Pitch != width * bmiHeader->biBitCount / 8) + if (height > 0) { + /* Bottom up image needs inverting */ + lock.pBits = (char *)lock.pBits + (height * lock.Pitch); + while (height--) + { + memcpy(lock.pBits, data, width * bmiHeader->biBitCount / 8); + data = data + width * bmiHeader->biBitCount / 8; + lock.pBits = (char *)lock.pBits - lock.Pitch; + } + } + else if (lock.Pitch != width * bmiHeader->biBitCount / 8) { WARN("Slow path! %u/%u\n", lock.Pitch, width * bmiHeader->biBitCount/8);