Speed up bitblts
tony_lambregts at telusplanet.net
tony_lambregts at telusplanet.net
Thu Dec 2 22:07:54 CST 2004
One of my kids games (An American Tail) paints the screen between scenes with
repeated calls to bitbit useing 3x3 squares. before this patch it takes over
a minute to paint the screen (on my machine) after the patch it takes less
than 10 seconds.
Change log: Speed up bitblts when the area is small.
files changed: dlls/x11drv/bitblt.c
Index: bitblt.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/bitblt.c,v
retrieving revision 1.8
diff -u -r1.8 bitblt.c
--- bitblt.c 16 Sep 2004 20:29:25 -0000 1.8
+++ bitblt.c 3 Dec 2004 04:34:37 -0000
@@ -1571,7 +1571,21 @@
BOOL result = FALSE;
INT sSrc, sDst;
RECT visRectDst, visRectSrc;
+
+ /* if the area is small we don't save time by coping it ourself and
+ * the extra overhead of X11DRV_LockDIBSection() is only required if
+ * we do it ourself.
+ */
+ if (( width * height ) <= 16 )
+ {
+ X11DRV_CoerceDIBSection( physDevDst, DIB_Status_GdiMod, FALSE );
+ if (physDevDst != physDevSrc)
+ X11DRV_CoerceDIBSection( physDevSrc, DIB_Status_GdiMod, FALSE );
+ return BITBLT_InternalStretchBlt( physDevDst, xDst, yDst, width, height,
+ physDevSrc, xSrc, ySrc, width, height, rop );
+
+ }
if (((rop >> 16) & 0x55) == ((rop >> 17) & 0x55)) {
/* FIXME: seems the ROP doesn't include destination;
* now if the destination area include the entire dcDst,
More information about the wine-patches
mailing list