mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 21:55:08 +00:00
[WIN32K]
Delete old clipregion only and set a new one, if it could be created already, to avoid setting a NULL region. See issue #4431 for more details. svn path=/trunk/; revision=47349
This commit is contained in:
parent
bb079cacb0
commit
71d693cef0
|
@ -62,23 +62,27 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
||||||
|
|
||||||
if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL)))
|
if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL)))
|
||||||
{
|
{
|
||||||
if (Dc->rosdc.CombinedClip != NULL)
|
CLIPOBJ *CombinedClip;
|
||||||
IntEngDeleteClipRegion(Dc->rosdc.CombinedClip);
|
|
||||||
|
|
||||||
Dc->rosdc.CombinedClip = IntEngCreateClipRegion(
|
CombinedClip = IntEngCreateClipRegion(CombinedRegion->rdh.nCount,
|
||||||
CombinedRegion->rdh.nCount,
|
|
||||||
CombinedRegion->Buffer,
|
CombinedRegion->Buffer,
|
||||||
&CombinedRegion->rdh.rcBound);
|
&CombinedRegion->rdh.rcBound);
|
||||||
|
|
||||||
RGNOBJAPI_Unlock(CombinedRegion);
|
RGNOBJAPI_Unlock(CombinedRegion);
|
||||||
}
|
|
||||||
|
|
||||||
if ( NULL == Dc->rosdc.CombinedClip )
|
if (!CombinedClip)
|
||||||
{
|
{
|
||||||
DPRINT1("IntEngCreateClipRegion() failed\n");
|
DPRINT1("IntEngCreateClipRegion() failed\n");
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Dc->rosdc.CombinedClip != NULL)
|
||||||
|
IntEngDeleteClipRegion(Dc->rosdc.CombinedClip);
|
||||||
|
|
||||||
|
Dc->rosdc.CombinedClip = CombinedClip;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, -Dc->ptlDCOrig.x, -Dc->ptlDCOrig.y);
|
return NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, -Dc->ptlDCOrig.x, -Dc->ptlDCOrig.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,9 +611,6 @@ NEW_CLIPPING_UpdateGCRegion(PDC pDC)
|
||||||
|
|
||||||
IntGdiOffsetRgn(pDC->prgnRao, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
|
IntGdiOffsetRgn(pDC->prgnRao, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
|
||||||
|
|
||||||
if (pDC->rosdc.CombinedClip != NULL)
|
|
||||||
IntEngDeleteClipRegion(pDC->rosdc.CombinedClip);
|
|
||||||
|
|
||||||
// pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build
|
// pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build
|
||||||
// the rects from region objects rects in pClipRgn->Buffer.
|
// the rects from region objects rects in pClipRgn->Buffer.
|
||||||
// With pDC->co.pClipRgn->Buffer,
|
// With pDC->co.pClipRgn->Buffer,
|
||||||
|
@ -619,7 +620,13 @@ NEW_CLIPPING_UpdateGCRegion(PDC pDC)
|
||||||
((PROSRGNDATA)pDC->prgnRao)->Buffer,
|
((PROSRGNDATA)pDC->prgnRao)->Buffer,
|
||||||
&pDC->erclClip);
|
&pDC->erclClip);
|
||||||
|
|
||||||
|
if (co)
|
||||||
|
{
|
||||||
|
if (pDC->rosdc.CombinedClip != NULL)
|
||||||
|
IntEngDeleteClipRegion(pDC->rosdc.CombinedClip);
|
||||||
|
|
||||||
pDC->rosdc.CombinedClip = co;
|
pDC->rosdc.CombinedClip = co;
|
||||||
|
}
|
||||||
|
|
||||||
return IntGdiOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
|
return IntGdiOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue