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>
This commit is contained in:
Jan Schmidt 2016-07-20 14:37:10 +10:00 committed by Alexandre Julliard
parent c2d7bda87f
commit b5a33f02d3
1 changed files with 11 additions and 1 deletions

View File

@ -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);