Author: tkreuzer
Date: Tue May 25 13:41:29 2010
New Revision: 47349
URL:
http://svn.reactos.org/svn/reactos?rev=47349&view=rev
Log:
[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.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c [iso-8859-1] Tue May 25
13:41:29 2010
@@ -60,24 +60,28 @@
NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y);
- if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL)))
- {
- if (Dc->rosdc.CombinedClip != NULL)
- IntEngDeleteClipRegion(Dc->rosdc.CombinedClip);
-
- Dc->rosdc.CombinedClip = IntEngCreateClipRegion(
- CombinedRegion->rdh.nCount,
- CombinedRegion->Buffer,
- &CombinedRegion->rdh.rcBound);
-
- RGNOBJAPI_Unlock(CombinedRegion);
- }
-
- if ( NULL == Dc->rosdc.CombinedClip )
- {
- DPRINT1("IntEngCreateClipRegion() failed\n");
- return ERROR;
- }
+ if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL)))
+ {
+ CLIPOBJ *CombinedClip;
+
+ CombinedClip = IntEngCreateClipRegion(CombinedRegion->rdh.nCount,
+ CombinedRegion->Buffer,
+ &CombinedRegion->rdh.rcBound);
+
+ RGNOBJAPI_Unlock(CombinedRegion);
+
+ if (!CombinedClip)
+ {
+ DPRINT1("IntEngCreateClipRegion() failed\n");
+ 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);
}
@@ -607,9 +611,6 @@
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
// the rects from region objects rects in pClipRgn->Buffer.
// With pDC->co.pClipRgn->Buffer,
@@ -619,7 +620,13 @@
((PROSRGNDATA)pDC->prgnRao)->Buffer,
&pDC->erclClip);
- pDC->rosdc.CombinedClip = co;
+ if (co)
+ {
+ if (pDC->rosdc.CombinedClip != NULL)
+ IntEngDeleteClipRegion(pDC->rosdc.CombinedClip);
+
+ pDC->rosdc.CombinedClip = co;
+ }
return IntGdiOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
}