Commit 28ddfe80 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

winex11.drv: Correctly handle overlapping source and destination regions on the…

winex11.drv: Correctly handle overlapping source and destination regions on the same DIB when copying DIBs client-side.
parent 28ca9a86
......@@ -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;
}
......
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