<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 28, 2016 at 1:03 PM, Frediano Ziglio <span dir="ltr"><<a href="mailto:fziglio@redhat.com" target="_blank">fziglio@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Doing some fast check on Windows 8.1 you could note that<br>
moving windows you got a weird effect were windows were a<br>
bit misaligned.<br>
As documented in DXGKARG_PRESENT_DISPLAYONLY page<br>
NumMoves/pMoves fields point to an array of screen-to-screen<br>
moves while our code implemented them as an image drawing<br>
(the same implementation of dirty rects) causing the weird<br>
effect mentioned.<br>
This patch implement the moves using QXL_COPY_BITS operation<br>
instead of a QXL_DRAW_COPY fixing the issue and avoiding sending<br>
image to the server making the move/scroll operations on the<br>
guest faster (and taking less bandwidth).<br>
It seems that Windows 10 doesn't send the move commands but<br>
instead send only dirty rects so you can't note this problem<br>
using Windows 10.<br>
<br>
Signed-off-by: Frediano Ziglio <<a href="mailto:fziglio@redhat.com" target="_blank">fziglio@redhat.com</a>><br>
---<br>
 qxldod/QxlDod.cpp | 26 +++++++++++++++++++++-----<br>
 qxldod/QxlDod.h   |  1 +<br>
 2 files changed, 22 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp<br>
index 68e3383..7adbec4 100755<br>
--- a/qxldod/QxlDod.cpp<br>
+++ b/qxldod/QxlDod.cpp<br>
@@ -3738,11 +3738,7 @@ QxlDevice::ExecutePresentDispl<wbr>ayOnly(<br>
         DbgPrint(TRACE_LEVEL_INFORMAT<wbr>ION, ("--- %d SourcePoint.x = %ld, SourcePoint.y = %ld, DestRect.bottom = %ld, DestRect.left = %ld, DestRect.right = %ld, DestRect.top = %ld\n",<br>
             i , pSourcePoint->x, pSourcePoint->y, pDestRect->bottom, pDestRect->left, pDestRect->right, pDestRect->top));<br>
<br>
-        BltBits(&DstBltInfo,<br>
-        &SrcBltInfo,<br>
-        1,<br>
-        pDestRect,<br>
-        pSourcePoint);<br>
+        CopyBits(*pDestRect, *pSourcePoint);<br>
     }<br>
<br>
     // Copy all the dirty rects from source image to video frame buffer.<br>
@@ -4184,6 +4180,26 @@ VOID QxlDevice::SetImageId(Internal<wbr>Image *internal,<br>
     }<br>
 }<br>
<br>
+void QxlDevice::CopyBits(const RECT& rect, const POINT& sourcePoint)<br>
+{<br>
+    PAGED_CODE();<br>
+    QXLDrawable *drawable;<br>
+<br>
+    DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s device %d\n", __FUNCTION__,m_Id));<br>
+<br>
+    if (!(drawable = Drawable(QXL_COPY_BITS, &rect, NULL, 0))) {<br>
+        DbgPrint(TRACE_LEVEL_ERROR, ("Cannot get Drawable.\n"));<br>
+        return;<br>
+    }<br>
+<br>
+    drawable->u.copy_bits.src_pos.<wbr>x = sourcePoint.x;<br>
+    drawable->u.copy_bits.src_pos.<wbr>y = sourcePoint.y;<br>
+<br>
+    PushDrawable(drawable);<br>
+<br>
+    DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
+}<br>
+<br>
 VOID QxlDevice::BltBits (<br>
     BLT_INFO* pDst,<br>
     CONST BLT_INFO* pSrc,<br>
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h<br>
index b151484..324c3d6 100755<br>
--- a/qxldod/QxlDod.h<br>
+++ b/qxldod/QxlDod.h<br>
@@ -487,6 +487,7 @@ protected:<br>
                     UINT  NumRects,<br>
                     _In_reads_(NumRects) CONST RECT *pRects,<br>
                     POINT*   pSourcePoint);<br>
+    void QxlDevice::CopyBits(const RECT& rect, const POINT& sourcePoint);<br></blockquote><div><br></div><div>I would exclude class name in the declaration</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
     QXLDrawable *Drawable(UINT8 type,<br>
                     CONST RECT *area,<br>
                     CONST RECT *clip,<br>
<span class="m_7937081453711649586HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br></font></span></blockquote><div><br></div><div>Acked-by: Yuri Benditovich <<a href="mailto:yuri.benditovich@daynix.com">yuri.benditovich@daynix.com</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="m_7937081453711649586HOEnZb"><font color="#888888">
______________________________<wbr>_________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.<wbr>org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/spice-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br></div></div>