Fixing Move rectangles implementation

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 doesn't take into account
the shift of the given source point at all. This patch fixies the issue.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Sameeh Jubran 2016-06-16 17:04:50 +03:00 committed by Frediano Ziglio
parent 2a4def7434
commit 27713ea765
2 changed files with 15 additions and 7 deletions

View File

@ -3752,20 +3752,26 @@ QxlDevice::ExecutePresentDisplayOnly(
BltBits(&DstBltInfo, BltBits(&DstBltInfo,
&SrcBltInfo, &SrcBltInfo,
1, 1,
pDestRect); pDestRect,
pSourcePoint);
} }
// Copy all the dirty rects from source image to video frame buffer. // Copy all the dirty rects from source image to video frame buffer.
for (UINT i = 0; i < ctx->NumDirtyRects; i++) for (UINT i = 0; i < ctx->NumDirtyRects; i++)
{ {
RECT* pDirtyRect = &ctx->DirtyRect[i]; RECT* pDirtyRect = &ctx->DirtyRect[i];
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", 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)); i, pDirtyRect->bottom, pDirtyRect->left, pDirtyRect->right, pDirtyRect->top));
BltBits(&DstBltInfo, BltBits(&DstBltInfo,
&SrcBltInfo, &SrcBltInfo,
1, 1,
pDirtyRect); pDirtyRect,
&sourcePoint);
} }
// Unmap unmap and unlock the pages. // Unmap unmap and unlock the pages.
@ -4170,7 +4176,8 @@ VOID QxlDevice::BltBits (
BLT_INFO* pDst, BLT_INFO* pDst,
CONST BLT_INFO* pSrc, CONST BLT_INFO* pSrc,
UINT NumRects, UINT NumRects,
_In_reads_(NumRects) CONST RECT *pRects) _In_reads_(NumRects) CONST RECT *pRects,
POINT* pSourcePoint)
{ {
QXLDrawable *drawable; QXLDrawable *drawable;
Resource *image_res; Resource *image_res;
@ -4233,8 +4240,8 @@ VOID QxlDevice::BltBits (
internal->image.bitmap.stride = line_size; internal->image.bitmap.stride = line_size;
UINT8* src = (UINT8*)pSrc->pBits+ UINT8* src = (UINT8*)pSrc->pBits+
(pRect->top) * pSrc->Pitch + (pSourcePoint->y) * pSrc->Pitch +
(pRect->left * 4); (pSourcePoint->x * 4);
UINT8* src_end = src - pSrc->Pitch; UINT8* src_end = src - pSrc->Pitch;
src += pSrc->Pitch * (height - 1); src += pSrc->Pitch * (height - 1);
UINT8* dest = chunk->data; UINT8* dest = chunk->data;

View File

@ -470,7 +470,8 @@ protected:
VOID BltBits (BLT_INFO* pDst, VOID BltBits (BLT_INFO* pDst,
CONST BLT_INFO* pSrc, CONST BLT_INFO* pSrc,
UINT NumRects, UINT NumRects,
_In_reads_(NumRects) CONST RECT *pRects); _In_reads_(NumRects) CONST RECT *pRects,
POINT* pSourcePoint);
QXLDrawable *Drawable(UINT8 type, QXLDrawable *Drawable(UINT8 type,
CONST RECT *area, CONST RECT *area,
CONST RECT *clip, CONST RECT *clip,