Commit b5a33f02 authored by Jan Schmidt's avatar Jan Schmidt Committed by Alexandre Julliard

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: 's avatarJan Schmidt <jan@centricular.com> Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c2d7bda8
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment