[WIN32K] Implement RECTL_bClipRectBySize() and use it in IntEngBitBlt() to clip the target rect against the bounds of the target surface. Also clip the source rect against the source surface. Fixes remaining part of CORE-14463

This commit is contained in:
Timo Kreuzer 2018-03-11 23:03:38 +01:00
parent 79ad68ddc3
commit 2170901e6a
3 changed files with 45 additions and 10 deletions

View file

@ -67,6 +67,20 @@ RECTL_bIsWellOrdered(
(prcl->top <= prcl->bottom));
}
FORCEINLINE
BOOL
RECTL_bClipRectBySize(
_Out_ RECTL *prclDst,
_In_ const RECTL *prclSrc,
_In_ const SIZEL *pszl)
{
prclDst->left = max(prclSrc->left, 0);
prclDst->top = max(prclSrc->top, 0);
prclDst->right = min(prclSrc->right, pszl->cx);
prclDst->bottom = min(prclSrc->bottom, pszl->cy);
return !RECTL_bIsEmptyRect(prclDst);
}
BOOL
FASTCALL
RECTL_bUnionRect(