[Spice-devel] [PATCH v3 24/28] Fixing Move rectangles implementation

Sameeh Jubran sameeh at daynix.com
Wed Sep 7 13:10:42 UTC 2016


As documented in MSDN, "DxgkDdiPresentDisplayOnly" should copy
each "move rectangle" from a given source point in the source buffer
to the destination. The current implementation dosen't take into account
the shift of the given source point at all. This patch fixies the issue.

Signed-off-by: Sameeh Jubran <sameeh at daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry at daynix.com>
---
 qxldod/QxlDod.cpp | 19 +++++++++++++------
 qxldod/QxlDod.h   |  3 ++-
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index b606435..2634496 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3782,20 +3782,26 @@ QxlDevice::ExecutePresentDisplayOnly(
         BltBits(&DstBltInfo,
         &SrcBltInfo,
         1,
-        pDestRect);
+        pDestRect,
+        pSourcePoint);
     }
 
     // Copy all the dirty rects from source image to video frame buffer.
     for (UINT i = 0; i < ctx->NumDirtyRects; i++)
     {
         RECT*    pDirtyRect = &ctx->DirtyRect[i];
-        DbgPrint(TRACE_LEVEL_INFORMATION, ("--- %d pDirtyRect->bottom = %ld, pDirtyRect->left = %ld, pDirtyRect->right = %ld, pDirtyRect->top = %ld\n", 
+        POINT   sourcePoint;
+        sourcePoint.x = pDirtyRect->left;
+        sourcePoint.y = pDirtyRect->top;
+
+        DbgPrint(TRACE_LEVEL_INFORMATION, ("--- %d pDirtyRect->bottom = %ld, pDirtyRect->left = %ld, pDirtyRect->right = %ld, pDirtyRect->top = %ld\n",
             i, pDirtyRect->bottom, pDirtyRect->left, pDirtyRect->right, pDirtyRect->top));
 
         BltBits(&DstBltInfo,
         &SrcBltInfo,
         1,
-        pDirtyRect);
+        pDirtyRect,
+        &sourcePoint);
     }
 
     // Unmap unmap and unlock the pages.
@@ -4223,7 +4229,8 @@ VOID QxlDevice::BltBits (
     BLT_INFO* pDst,
     CONST BLT_INFO* pSrc,
     UINT  NumRects,
-    _In_reads_(NumRects) CONST RECT *pRects)
+    _In_reads_(NumRects) CONST RECT *pRects,
+    POINT*   pSourcePoint)
 {
     PAGED_CODE();
     QXLDrawable *drawable;
@@ -4288,8 +4295,8 @@ VOID QxlDevice::BltBits (
     internal->image.bitmap.stride = line_size;
 
     UINT8* src = (UINT8*)pSrc->pBits+
-                                (pRect->top) * pSrc->Pitch +
-                                (pRect->left * 4);
+                                (pSourcePoint->y) * pSrc->Pitch +
+                                (pSourcePoint->x * 4);
     UINT8* src_end = src - pSrc->Pitch;
     src += pSrc->Pitch * (height - 1);
     UINT8* dest = chunk->data;
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 3c30b6f..09f39af 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -480,7 +480,8 @@ protected:
     VOID BltBits (BLT_INFO* pDst,
                     CONST BLT_INFO* pSrc,
                     UINT  NumRects,
-                    _In_reads_(NumRects) CONST RECT *pRects);
+                    _In_reads_(NumRects) CONST RECT *pRects,
+                    POINT*   pSourcePoint);
     QXLDrawable *Drawable(UINT8 type,
                     CONST RECT *area,
                     CONST RECT *clip,
-- 
2.7.0.windows.1



More information about the Spice-devel mailing list