Added top-down dib support to AlphaBlend.

This commit is contained in:
Huw Davies 2004-08-04 18:15:42 +00:00 committed by Alexandre Julliard
parent 0abeb87e7a
commit 4e54df5a95
1 changed files with 7 additions and 1 deletions

View File

@ -1532,6 +1532,7 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
char *dstbits, *data; char *dstbits, *data;
int y; int y;
POINT pts[2]; POINT pts[2];
BOOL top_down = FALSE;
if(!X11DRV_XRender_Installed) { if(!X11DRV_XRender_Installed) {
FIXME("Unable to AlphaBlend without Xrender\n"); FIXME("Unable to AlphaBlend without Xrender\n");
@ -1577,10 +1578,15 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
return FALSE; return FALSE;
} }
dstbits = data = HeapAlloc(GetProcessHeap(), 0, heightSrc * widthSrc * 4); dstbits = data = HeapAlloc(GetProcessHeap(), 0, heightSrc * widthSrc * 4);
if(bmp->dib->dsBmih.biHeight < 0) { /* top-down dib */
top_down = TRUE;
dstbits += widthSrc * (heightSrc - 1) * 4;
}
for(y = ySrc + heightSrc - 1; y >= ySrc; y--) { for(y = ySrc + heightSrc - 1; y >= ySrc; y--) {
memcpy(dstbits, (char *)bmp->dib->dsBm.bmBits + y * bmp->dib->dsBm.bmWidthBytes + xSrc * 4, memcpy(dstbits, (char *)bmp->dib->dsBm.bmBits + y * bmp->dib->dsBm.bmWidthBytes + xSrc * 4,
widthSrc * 4); widthSrc * 4);
dstbits += widthSrc * 4; dstbits += (top_down ? -1 : 1) * widthSrc * 4;
} }
wine_tsx11_lock(); wine_tsx11_lock();