From 095f2182e82c015c040f47e42e7d0ee80cf07daf Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 18 Dec 2014 08:12:01 +0000 Subject: [PATCH] [WIN32K] - Move IntGdiReleaseRaoRgn and IntGdiReleaseVisRgn to cliprgn.c - Remove unused IntUpdateVisRectRgn svn path=/trunk/; revision=65727 --- reactos/win32ss/gdi/ntgdi/cliprgn.c | 26 ++++++++++++ reactos/win32ss/gdi/ntgdi/cliprgn.h | 2 + reactos/win32ss/gdi/ntgdi/region.c | 66 +---------------------------- reactos/win32ss/gdi/ntgdi/region.h | 19 ++++----- 4 files changed, 39 insertions(+), 74 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/cliprgn.c b/reactos/win32ss/gdi/ntgdi/cliprgn.c index 06936fd3996..02322a228ad 100644 --- a/reactos/win32ss/gdi/ntgdi/cliprgn.c +++ b/reactos/win32ss/gdi/ntgdi/cliprgn.c @@ -11,6 +11,32 @@ #define NDEBUG #include +VOID +FASTCALL +IntGdiReleaseRaoRgn(PDC pDC) +{ + INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); + PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; + pDC->fs |= DC_FLAG_DIRTY_RAO; + Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; + RECTL_vSetEmptyRect(&pDC->erclClip); + REGION_Delete(pDC->prgnRao); + pDC->prgnRao = NULL; +} + +VOID +FASTCALL +IntGdiReleaseVisRgn(PDC pDC) +{ + INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); + PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; + pDC->fs |= DC_FLAG_DIRTY_RAO; + Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; + RECTL_vSetEmptyRect(&pDC->erclClip); + REGION_Delete(pDC->prgnVis); + pDC->prgnVis = prgnDefault; +} + VOID FASTCALL GdiSelectVisRgn( diff --git a/reactos/win32ss/gdi/ntgdi/cliprgn.h b/reactos/win32ss/gdi/ntgdi/cliprgn.h index 1fca9c19b74..64e343994e0 100644 --- a/reactos/win32ss/gdi/ntgdi/cliprgn.h +++ b/reactos/win32ss/gdi/ntgdi/cliprgn.h @@ -9,3 +9,5 @@ GdiGetClipBox( VOID FASTCALL GdiSelectVisRgn(HDC hdc, PREGION prgn); INT FASTCALL IntGdiExtSelectClipRgn (PDC dc, PREGION prgn, int fnMode); VOID FASTCALL CLIPPING_UpdateGCRegion(DC* Dc); +VOID FASTCALL IntGdiReleaseRaoRgn(PDC); +VOID FASTCALL IntGdiReleaseVisRgn(PDC); diff --git a/reactos/win32ss/gdi/ntgdi/region.c b/reactos/win32ss/gdi/ntgdi/region.c index 7602219480a..ce7c5712484 100644 --- a/reactos/win32ss/gdi/ntgdi/region.c +++ b/reactos/win32ss/gdi/ntgdi/region.c @@ -2264,70 +2264,6 @@ REGION_Delete(PREGION pRgn) GDIOBJ_vDeleteObject(&pRgn->BaseObject); } -VOID -FASTCALL -IntGdiReleaseRaoRgn(PDC pDC) -{ - INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); - PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - pDC->fs |= DC_FLAG_DIRTY_RAO; - Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; - RECTL_vSetEmptyRect(&pDC->erclClip); - REGION_Delete(pDC->prgnRao); - pDC->prgnRao = NULL; -} - -VOID -FASTCALL -IntGdiReleaseVisRgn(PDC pDC) -{ - INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); - PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - pDC->fs |= DC_FLAG_DIRTY_RAO; - Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; - RECTL_vSetEmptyRect(&pDC->erclClip); - REGION_Delete(pDC->prgnVis); - pDC->prgnVis = prgnDefault; -} - -VOID -FASTCALL -IntUpdateVisRectRgn(PDC pDC, PREGION pRgn) -{ - INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); - PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - PDC_ATTR pdcattr; - RECTL rcl; - - if (Entry->Flags & GDI_ENTRY_VALIDATE_VIS) - { - pdcattr = pDC->pdcattr; - - pdcattr->VisRectRegion.iComplexity = REGION_Complexity(pRgn); - - if (pRgn && pdcattr->VisRectRegion.iComplexity != NULLREGION) - { - rcl.left = pRgn->rdh.rcBound.left; - rcl.top = pRgn->rdh.rcBound.top; - rcl.right = pRgn->rdh.rcBound.right; - rcl.bottom = pRgn->rdh.rcBound.bottom; - - rcl.left -= pDC->erclWindow.left; - rcl.top -= pDC->erclWindow.top; - rcl.right -= pDC->erclWindow.left; - rcl.bottom -= pDC->erclWindow.top; - } - else - { - RECTL_vSetEmptyRect(&rcl); - } - - pdcattr->VisRectRegion.Rect = rcl; - - Entry->Flags &= ~GDI_ENTRY_VALIDATE_VIS; - } -} - BOOL FASTCALL IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask) @@ -3617,6 +3553,8 @@ NtGdiEqualRgn( ULONG i; BOOL bRet = FALSE; + /// FIXME: need to use GDIOBJ_LockMultipleObjects + rgn1 = RGNOBJAPI_Lock(hSrcRgn1, NULL); if (rgn1 == NULL) return ERROR; diff --git a/reactos/win32ss/gdi/ntgdi/region.h b/reactos/win32ss/gdi/ntgdi/region.h index f3c381e6573..29ee1e67661 100644 --- a/reactos/win32ss/gdi/ntgdi/region.h +++ b/reactos/win32ss/gdi/ntgdi/region.h @@ -8,14 +8,18 @@ typedef struct _REGION { /* Header for all gdi objects in the handle table. Do not (re)move this. */ - BASEOBJECT BaseObject; + BASEOBJECT BaseObject; PRGN_ATTR prgnattr; RGN_ATTR rgnattr; RGNDATAHEADER rdh; - RECTL *Buffer; + RECTL *Buffer; } REGION, *PREGION; +/* Globals ********************************************************************/ + +extern PREGION prgnDefault; +extern HRGN hrgnDefault; /* Functions ******************************************************************/ @@ -32,16 +36,8 @@ BOOL FASTCALL REGION_PtInRegion(PREGION, INT, INT); INT FASTCALL REGION_CropRegion(PREGION rgnDst, PREGION rgnSrc, const RECTL *rect); VOID FASTCALL REGION_SetRectRgn(PREGION pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect); VOID NTAPI REGION_vCleanup(PVOID ObjectBody); - -extern PREGION prgnDefault; -extern HRGN hrgnDefault; - VOID FASTCALL REGION_Delete(PREGION); -VOID FASTCALL IntGdiReleaseRaoRgn(PDC); -VOID FASTCALL IntGdiReleaseVisRgn(PDC); - INT APIENTRY IntGdiGetRgnBox(HRGN, RECTL*); -BOOL FASTCALL IntGdiPaintRgn(PDC, PREGION ); BOOL FASTCALL @@ -97,3 +93,6 @@ REGION_UnlockRgn(PREGION prgn) { GDIOBJ_vUnlockObject(&prgn->BaseObject); } + +// FIXME: move this +BOOL FASTCALL IntGdiPaintRgn(PDC, PREGION );