Damjan Jovanovic : winex11.drv: Correctly handle overlapping source and destination regions on the same DIB when copying DIBs client-side .

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 13 06:31:49 CDT 2007


Module: wine
Branch: master
Commit: 28ddfe802e5d45db32df047174e9f3a03f8aee18
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=28ddfe802e5d45db32df047174e9f3a03f8aee18

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Sat Aug 11 10:46:08 2007 +0200

winex11.drv: Correctly handle overlapping source and destination regions on the same DIB when copying DIBs client-side.

---

 dlls/winex11.drv/bitblt.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c
index 06c6ba1..996319e 100644
--- a/dlls/winex11.drv/bitblt.c
+++ b/dlls/winex11.drv/bitblt.c
@@ -1623,9 +1623,18 @@ static BOOL X11DRV_ClientSideDIBCopy( X11DRV_PDEVICE *physDevSrc, INT xSrc, INT
       dstRowOffset = -dstDib.dsBm.bmWidthBytes;
     }
 
+    /* Handle overlapping regions on the same DIB */
+    if (physDevSrc == physDevDst && ySrc < yDst)
+    {
+      srcPtr += srcRowOffset * (height - 1);
+      srcRowOffset = -srcRowOffset;
+      dstPtr += dstRowOffset * (height - 1);
+      dstRowOffset = -dstRowOffset;
+    }
+
     for (y = yDst; y < yDst + height; ++y)
     {
-      memcpy(dstPtr, srcPtr, bytesToCopy);
+      memmove(dstPtr, srcPtr, bytesToCopy);
       srcPtr += srcRowOffset;
       dstPtr += dstRowOffset;
     }




More information about the wine-cvs mailing list