mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 09:50:02 +00:00
Update changes to Clip regions andregions. New support for Rao and Vis.
svn path=/trunk/; revision=33998
This commit is contained in:
parent
9dbc5faab4
commit
b5b4c9ab4b
6 changed files with 89 additions and 19 deletions
|
@ -5,7 +5,6 @@
|
||||||
#include <include/region.h>
|
#include <include/region.h>
|
||||||
|
|
||||||
INT FASTCALL IntGdiGetClipBox(PDC, LPRECT rc);
|
INT FASTCALL IntGdiGetClipBox(PDC, LPRECT rc);
|
||||||
INT FASTCALL IntGdiSelectVisRgn(PDC, PROSRGNDATA);
|
|
||||||
INT FASTCALL IntGdiExtSelectClipRgn (PDC, PROSRGNDATA, int);
|
INT FASTCALL IntGdiExtSelectClipRgn (PDC, PROSRGNDATA, int);
|
||||||
|
|
||||||
INT FASTCALL GdiGetClipBox(HDC hDC, LPRECT rc);
|
INT FASTCALL GdiGetClipBox(HDC hDC, LPRECT rc);
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
/* Brush functions */
|
/* Brush functions */
|
||||||
|
|
||||||
extern HDC hSystemBM;
|
extern HDC hSystemBM;
|
||||||
|
extern HSEMAPHORE hsemDriverMgmt;
|
||||||
|
|
||||||
XLATEOBJ* FASTCALL
|
XLATEOBJ* FASTCALL
|
||||||
IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed);
|
IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed);
|
||||||
|
|
|
@ -34,6 +34,13 @@ BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc,
|
||||||
VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
|
VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
|
||||||
BOOL INTERNAL_CALL REGION_Cleanup(PVOID ObjectBody);
|
BOOL INTERNAL_CALL REGION_Cleanup(PVOID ObjectBody);
|
||||||
|
|
||||||
|
extern PROSRGNDATA prgnDefault;
|
||||||
|
extern HRGN hrgnDefault;
|
||||||
|
|
||||||
|
VOID FASTCALL REGION_Delete(PROSRGNDATA);
|
||||||
|
VOID FASTCALL IntGdiReleaseRaoRgn(PDC);
|
||||||
|
VOID FASTCALL IntGdiReleaseVisRgn(PDC);
|
||||||
|
|
||||||
INT STDCALL IntGdiGetRgnBox(HRGN, LPRECT);
|
INT STDCALL IntGdiGetRgnBox(HRGN, LPRECT);
|
||||||
BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN );
|
BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN );
|
||||||
HRGN FASTCALL GdiCreatePolyPolygonRgn(CONST PPOINT, CONST PINT, INT, INT );
|
HRGN FASTCALL GdiCreatePolyPolygonRgn(CONST PPOINT, CONST PINT, INT, INT );
|
||||||
|
|
|
@ -442,29 +442,22 @@ IntGdiSetMetaRgn(PDC pDC)
|
||||||
RGN_AND);
|
RGN_AND);
|
||||||
if ( Ret )
|
if ( Ret )
|
||||||
{
|
{
|
||||||
TempRgn = GDIOBJ_ShareLockObj(TempRgn->BaseObject.hHmgr,
|
|
||||||
GDI_OBJECT_TYPE_REGION);
|
|
||||||
|
|
||||||
GDIOBJ_ShareUnlockObjByPtr(pDC->DcLevel.prgnMeta);
|
GDIOBJ_ShareUnlockObjByPtr(pDC->DcLevel.prgnMeta);
|
||||||
if (!((PROSRGNDATA)pDC->DcLevel.prgnMeta)->BaseObject.ulShareCount)
|
if (!((PROSRGNDATA)pDC->DcLevel.prgnMeta)->BaseObject.ulShareCount)
|
||||||
REGION_FreeRgn(pDC->DcLevel.prgnMeta);
|
REGION_Delete(pDC->DcLevel.prgnMeta);
|
||||||
|
|
||||||
pDC->DcLevel.prgnMeta = TempRgn;
|
pDC->DcLevel.prgnMeta = TempRgn;
|
||||||
|
|
||||||
GDIOBJ_ShareUnlockObjByPtr(pDC->DcLevel.prgnClip);
|
GDIOBJ_ShareUnlockObjByPtr(pDC->DcLevel.prgnClip);
|
||||||
if (!((PROSRGNDATA)pDC->DcLevel.prgnClip)->BaseObject.ulShareCount)
|
if (!((PROSRGNDATA)pDC->DcLevel.prgnClip)->BaseObject.ulShareCount)
|
||||||
REGION_FreeRgn(pDC->DcLevel.prgnClip);
|
REGION_Delete(pDC->DcLevel.prgnClip);
|
||||||
|
|
||||||
pDC->DcLevel.prgnClip = NULL;
|
pDC->DcLevel.prgnClip = NULL;
|
||||||
|
|
||||||
pDC->DC_Flags |= DC_FLAG_DIRTY_RAO;
|
IntGdiReleaseRaoRgn(pDC);
|
||||||
pDC->erclClip.left = 0;
|
|
||||||
pDC->erclClip.top = 0;
|
|
||||||
pDC->erclClip.right = 0;
|
|
||||||
pDC->erclClip.bottom = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
REGION_FreeRgn(TempRgn);
|
REGION_Delete(TempRgn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -510,16 +503,14 @@ NEW_CLIPPING_UpdateGCRegion(PDC pDC)
|
||||||
|
|
||||||
if (pDC->prgnAPI)
|
if (pDC->prgnAPI)
|
||||||
{
|
{
|
||||||
REGION_FreeRgn(pDC->prgnAPI);
|
REGION_Delete(pDC->prgnAPI);
|
||||||
pDC->prgnAPI = REGION_AllocRgnWithHandle(1);
|
pDC->prgnAPI = IntGdiCreateRectRgn(0,0,0,0);
|
||||||
REGION_SetRectRgn(pDC->prgnAPI, 0, 0, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDC->prgnRao)
|
if (pDC->prgnRao)
|
||||||
{
|
{
|
||||||
REGION_FreeRgn(pDC->prgnRao);
|
REGION_Delete(pDC->prgnRao);
|
||||||
pDC->prgnRao = REGION_AllocRgnWithHandle(1);
|
pDC->prgnRao = IntGdiCreateRectRgn(0,0,0,0);
|
||||||
REGION_SetRectRgn(pDC->prgnRao, 0, 0, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDC->DcLevel.prgnMeta && pDC->DcLevel.prgnClip)
|
if (pDC->DcLevel.prgnMeta && pDC->DcLevel.prgnClip)
|
||||||
|
|
|
@ -2785,7 +2785,6 @@ IntEnumHDev(VOID)
|
||||||
return &PrimarySurface;
|
return &PrimarySurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
HSEMAPHORE hsemDriverMgmt = NULL; // Hax, should be in dllmain.c and global.
|
|
||||||
|
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
IntGdiReferencePdev(PGDIDEVICE pPDev)
|
IntGdiReferencePdev(PGDIDEVICE pPDev)
|
||||||
|
|
|
@ -118,6 +118,9 @@ SOFTWARE.
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
PROSRGNDATA prgnDefault = NULL;
|
||||||
|
HRGN hrgnDefault = NULL;
|
||||||
|
|
||||||
// Internal Functions
|
// Internal Functions
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -488,6 +491,7 @@ INT
|
||||||
FASTCALL
|
FASTCALL
|
||||||
REGION_Complexity( PROSRGNDATA obj )
|
REGION_Complexity( PROSRGNDATA obj )
|
||||||
{
|
{
|
||||||
|
if (!obj) return NULLREGION;
|
||||||
switch(obj->rdh.nCount)
|
switch(obj->rdh.nCount)
|
||||||
{
|
{
|
||||||
DPRINT("Region Complexity -> %d",obj->rdh.nCount);
|
DPRINT("Region Complexity -> %d",obj->rdh.nCount);
|
||||||
|
@ -2076,6 +2080,73 @@ REGION_Cleanup(PVOID ObjectBody)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
REGION_Delete(PROSRGNDATA pRgn)
|
||||||
|
{
|
||||||
|
if ( pRgn == prgnDefault) return;
|
||||||
|
return REGION_FreeRgn(pRgn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
IntGdiReleaseRaoRgn(PDC pDC)
|
||||||
|
{
|
||||||
|
INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
|
||||||
|
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
|
||||||
|
pDC->DC_Flags |= DC_FLAG_DIRTY_RAO;
|
||||||
|
Entry->Flags |= GDI_ENTRY_FLAG_NEED_UPDATE;
|
||||||
|
IntGdiSetEmptyRect((PRECT)&pDC->erclClip);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
IntGdiReleaseVisRgn(PDC pDC)
|
||||||
|
{
|
||||||
|
INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
|
||||||
|
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
|
||||||
|
pDC->DC_Flags |= DC_FLAG_DIRTY_RAO;
|
||||||
|
Entry->Flags |= GDI_ENTRY_FLAG_NEED_UPDATE;
|
||||||
|
IntGdiSetEmptyRect((PRECT)&pDC->erclClip);
|
||||||
|
REGION_Delete(pDC->prgnVis);
|
||||||
|
pDC->prgnVis = prgnDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
IntUpdateVisRectRgn(PDC pDC, PROSRGNDATA pRgn)
|
||||||
|
{
|
||||||
|
INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
|
||||||
|
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
|
||||||
|
PDC_ATTR pDc_Attr;
|
||||||
|
RECTL rcl;
|
||||||
|
|
||||||
|
if (Entry->Flags & GDI_ENTRY_FLAG_NEED_UPDATE)
|
||||||
|
{
|
||||||
|
pDc_Attr = pDC->pDc_Attr;
|
||||||
|
if ( !pDc_Attr ) pDc_Attr = &pDC->Dc_Attr;
|
||||||
|
|
||||||
|
pDc_Attr->VisRectRegion.Flags = REGION_Complexity(pRgn);
|
||||||
|
|
||||||
|
if (pRgn && pDc_Attr->VisRectRegion.Flags != 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
|
||||||
|
IntGdiSetEmptyRect((PRECT)&rcl);
|
||||||
|
|
||||||
|
pDc_Attr->VisRectRegion.Rect = rcl;
|
||||||
|
|
||||||
|
Entry->Flags &= ~GDI_ENTRY_FLAG_NEED_UPDATE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
INT
|
INT
|
||||||
FASTCALL
|
FASTCALL
|
||||||
IntGdiCombineRgn(PROSRGNDATA destRgn,
|
IntGdiCombineRgn(PROSRGNDATA destRgn,
|
||||||
|
@ -2221,6 +2292,8 @@ IntGdiCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
|
||||||
|
|
||||||
REGION_SetRectRgn(pRgn, LeftRect, TopRect, RightRect, BottomRect);
|
REGION_SetRectRgn(pRgn, LeftRect, TopRect, RightRect, BottomRect);
|
||||||
REGION_UnlockRgn(pRgn);
|
REGION_UnlockRgn(pRgn);
|
||||||
|
// Return pointer with Share locks.
|
||||||
|
pRgn = GDIOBJ_ShareLockObj(pRgn->BaseObject.hHmgr, GDI_OBJECT_TYPE_REGION);
|
||||||
|
|
||||||
return pRgn;
|
return pRgn;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue