Author: fireball Date: Tue Jan 18 12:11:43 2011 New Revision: 50420
URL: http://svn.reactos.org/svn/reactos?rev=50420&view=rev Log: - Properly initialize an empty CLIPOBJ. - Uncomment children window clipping of desktop's window, allows fullscreen drawing operations. - Update surface clipping region when a new bitmap is selected. - Don't leak allocated clipping regions at DC cleanup time, spotted by smiley_.
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32... ============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] Tue Jan 18 12:11:43 2011 @@ -52,6 +52,10 @@ /* Cleanup the dc brushes */ EBRUSHOBJ_vCleanup(&pDC->eboFill); EBRUSHOBJ_vCleanup(&pDC->eboLine); + + /* Delete clipping regions */ + if (pDC->CombinedClip) EngDeleteClip(pDC->CombinedClip); + if (pDC->Clipping) free_region(pDC->Clipping);
return TRUE; } @@ -167,7 +171,7 @@ }
/* Create an empty combined clipping region */ - pNewDC->CombinedClip = EngCreateClip(); + pNewDC->CombinedClip = NULL; pNewDC->Clipping = NULL; pNewDC->ClipChildren = FALSE;
@@ -238,6 +242,9 @@ pDC->rcVport.top = 0; pDC->rcVport.right = pSurface->SurfObj.sizlBitmap.cx; pDC->rcVport.bottom = pSurface->SurfObj.sizlBitmap.cy; + + /* Update clipping to reflect changes in the surface */ + RosGdiUpdateClipping(pDC, FALSE);
/* Release the DC object */ DC_UnlockDc(pDC); @@ -462,6 +469,7 @@ { struct region *window, *surface; rectangle_t surfrect = {0,0,0,0}; + RECTL EmptyRect = {0,0,0,0};
surface = create_empty_region(); surfrect.right = pDC->dclevel.pSurface->SurfObj.sizlBitmap.cx; @@ -484,14 +492,14 @@ { /* Drawing is forbidden */ if (pDC->CombinedClip) EngDeleteClip(pDC->CombinedClip); - pDC->CombinedClip = EngCreateClip(); + pDC->CombinedClip = IntEngCreateClipRegion(1, &EmptyRect, &EmptyRect); return; }
/* Root window's visibility may be ignored */ if ((pDC->pWindow == &SwmRoot) && !pDC->ClipChildren) { - //IgnoreVisibility = TRUE; + IgnoreVisibility = TRUE; }
/* window visibility X user clipping (if any) X underlying surface */ @@ -525,7 +533,7 @@
/* Drawing is forbidden */ if (pDC->CombinedClip) EngDeleteClip(pDC->CombinedClip); - pDC->CombinedClip = EngCreateClip(); + pDC->CombinedClip = IntEngCreateClipRegion(1, &EmptyRect, &EmptyRect); } }