Fix a bug: InitClipRgn on lrgn and ergn in InitSubDC; rename InitSubDC to dc_InitSubDC

This commit is contained in:
Vincent Wei
2021-12-17 14:39:56 +08:00
parent d95e827e93
commit ea83e92a16
+7 -3
View File
@@ -2462,7 +2462,7 @@ void GUIAPI ReleaseDC (HDC hDC)
}
}
static BOOL InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y,
static BOOL dc_InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y,
int width, int height)
{
int parent_width,parent_height;
@@ -2506,6 +2506,10 @@ static BOOL InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y,
/* should set after InitMemDC.*/
pdc->hwnd = pdc_parent->hwnd;
InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
MAKE_REGION_INFINITE(&pdc->lcrgn);
InitClipRgn (&pdc->ecrgn, &__mg_FreeClipRectList);
CopyRegion (&pdc->lcrgn, &pdc_parent->lcrgn);
CopyRegion (&pdc->ecrgn, &pdc_parent->ecrgn);
IntersectClipRect (&pdc->ecrgn, &pdc->DevRC);
@@ -2564,7 +2568,7 @@ HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height)
if (pdc == NULL)
return HDC_INVALID;
if (!InitSubDC((HDC)pdc, hdc, off_x, off_y, width, height)) {
if (!dc_InitSubDC((HDC)pdc, hdc, off_x, off_y, width, height)) {
pdc->bInUse = FALSE;
return HDC_INVALID;
}
@@ -2663,7 +2667,7 @@ HDC GUIAPI CreatePrivateSubDC (HDC hdc, int off_x, int off_y,
/* XXX: use the parent's type */
pdc->DCType = pdc_parent->DCType;
if (!InitSubDC ((HDC)pdc, hdc, off_x, off_y, width, height)) {
if (!dc_InitSubDC ((HDC)pdc, hdc, off_x, off_y, width, height)) {
free (pdc);
return HDC_INVALID;
}