gdi: add top-down dib support to AlphaBlend
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Tue Aug 3 05:47:44 CDT 2004
Huw Davies <huw at codeweavers.com>
Add top-down dib support to AlphaBlend
--
Huw Davies
huw at codeweavers.com
Index: dlls/x11drv/xrender.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/xrender.c,v
retrieving revision 1.43
diff -u -r1.43 xrender.c
--- dlls/x11drv/xrender.c 2 Aug 2004 18:54:54 -0000 1.43
+++ dlls/x11drv/xrender.c 3 Aug 2004 10:46:04 -0000
@@ -1532,6 +1532,7 @@
char *dstbits, *data;
int y;
POINT pts[2];
+ BOOL top_down = FALSE;
if(!X11DRV_XRender_Installed) {
FIXME("Unable to AlphaBlend without Xrender\n");
@@ -1577,10 +1578,15 @@
return FALSE;
}
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--) {
memcpy(dstbits, (char *)bmp->dib->dsBm.bmBits + y * bmp->dib->dsBm.bmWidthBytes + xSrc * 4,
widthSrc * 4);
- dstbits += widthSrc * 4;
+ dstbits += (top_down ? -1 : 1) * widthSrc * 4;
}
wine_tsx11_lock();
More information about the wine-patches
mailing list