mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[WIN32K]
- Get rid of rosdc::hVisRgn, as in yarotows (r46372) svn path=/trunk/; revision=48007
This commit is contained in:
parent
13ef18576c
commit
74cae57136
6 changed files with 79 additions and 88 deletions
|
@ -7,6 +7,7 @@ typedef struct _DC *PDC;
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
#include "pdevobj.h"
|
#include "pdevobj.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
|
#include "region.h"
|
||||||
|
|
||||||
/* Constants ******************************************************************/
|
/* Constants ******************************************************************/
|
||||||
|
|
||||||
|
@ -26,7 +27,6 @@ typedef struct _DC *PDC;
|
||||||
typedef struct _ROS_DC_INFO
|
typedef struct _ROS_DC_INFO
|
||||||
{
|
{
|
||||||
HRGN hClipRgn; /* Clip region (may be 0) */
|
HRGN hClipRgn; /* Clip region (may be 0) */
|
||||||
HRGN hVisRgn; /* Visible region (must never be 0) */
|
|
||||||
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
|
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
|
||||||
|
|
||||||
CLIPOBJ *CombinedClip; /* Use XCLIPOBJ in DC. */
|
CLIPOBJ *CombinedClip; /* Use XCLIPOBJ in DC. */
|
||||||
|
@ -101,9 +101,9 @@ typedef struct _DC
|
||||||
RECTL erclWindow;
|
RECTL erclWindow;
|
||||||
RECTL erclBounds;
|
RECTL erclBounds;
|
||||||
RECTL erclBoundsApp;
|
RECTL erclBoundsApp;
|
||||||
PVOID prgnAPI; /* PROSRGNDATA */
|
PROSRGNDATA prgnAPI; /* PROSRGNDATA */
|
||||||
PVOID prgnVis;
|
PROSRGNDATA prgnVis; /* Visible region (must never be 0) */
|
||||||
PVOID prgnRao;
|
PROSRGNDATA prgnRao;
|
||||||
POINTL ptlFillOrigin;
|
POINTL ptlFillOrigin;
|
||||||
EBRUSHOBJ eboFill;
|
EBRUSHOBJ eboFill;
|
||||||
EBRUSHOBJ eboLine;
|
EBRUSHOBJ eboLine;
|
||||||
|
|
|
@ -184,8 +184,8 @@ IntAttachMonitor(IN PDEVOBJ *pGdiDevice,
|
||||||
|
|
||||||
Monitor->GdiDevice = pGdiDevice;
|
Monitor->GdiDevice = pGdiDevice;
|
||||||
Monitor->rcMonitor.left = 0;
|
Monitor->rcMonitor.left = 0;
|
||||||
Monitor->rcMonitor.top = 0;
|
Monitor->rcMonitor.top = 0;
|
||||||
Monitor->rcMonitor.right = Monitor->rcMonitor.left + pGdiDevice->gdiinfo.ulHorzRes;
|
Monitor->rcMonitor.right = Monitor->rcMonitor.left + pGdiDevice->gdiinfo.ulHorzRes;
|
||||||
Monitor->rcMonitor.bottom = Monitor->rcMonitor.top + pGdiDevice->gdiinfo.ulVertRes;
|
Monitor->rcMonitor.bottom = Monitor->rcMonitor.top + pGdiDevice->gdiinfo.ulVertRes;
|
||||||
Monitor->rcWork = Monitor->rcMonitor;
|
Monitor->rcWork = Monitor->rcMonitor;
|
||||||
Monitor->cWndStack = 0;
|
Monitor->cWndStack = 0;
|
||||||
|
@ -492,7 +492,6 @@ NtUserEnumDisplayMonitors(
|
||||||
if (hDC != NULL)
|
if (hDC != NULL)
|
||||||
{
|
{
|
||||||
PDC dc;
|
PDC dc;
|
||||||
HRGN dcVisRgn;
|
|
||||||
INT regionType;
|
INT regionType;
|
||||||
|
|
||||||
/* get visible region bounding rect */
|
/* get visible region bounding rect */
|
||||||
|
@ -503,10 +502,9 @@ NtUserEnumDisplayMonitors(
|
||||||
/* FIXME: setlasterror? */
|
/* FIXME: setlasterror? */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
dcVisRgn = dc->rosdc.hVisRgn;
|
regionType = REGION_GetRgnBox(dc->prgnVis, &dcRect);
|
||||||
DC_UnlockDc(dc);
|
DC_UnlockDc(dc);
|
||||||
|
|
||||||
regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect);
|
|
||||||
if (regionType == 0)
|
if (regionType == 0)
|
||||||
{
|
{
|
||||||
DPRINT("NtGdiGetRgnBox() failed!\n");
|
DPRINT("NtGdiGetRgnBox() failed!\n");
|
||||||
|
|
|
@ -1206,8 +1206,7 @@ UserScrollDC(
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
hrgnVisible = pDC->rosdc.hVisRgn; // pDC->prgnRao?
|
hrgnVisible = ((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr; // pDC->prgnRao?
|
||||||
DC_UnlockDc(pDC);
|
|
||||||
|
|
||||||
/* Begin with the shifted and then clipped scroll rect */
|
/* Begin with the shifted and then clipped scroll rect */
|
||||||
rcDst = rcScroll;
|
rcDst = rcScroll;
|
||||||
|
@ -1235,6 +1234,9 @@ UserScrollDC(
|
||||||
NtGdiOffsetRgn(hrgnTmp, dx, dy);
|
NtGdiOffsetRgn(hrgnTmp, dx, dy);
|
||||||
Result = NtGdiCombineRgn(hrgnOwn, hrgnOwn, hrgnTmp, RGN_DIFF);
|
Result = NtGdiCombineRgn(hrgnOwn, hrgnOwn, hrgnTmp, RGN_DIFF);
|
||||||
|
|
||||||
|
/* DO NOT Unlock DC while messing with prgnVis! */
|
||||||
|
DC_UnlockDc(pDC);
|
||||||
|
|
||||||
REGION_FreeRgnByHandle(hrgnTmp);
|
REGION_FreeRgnByHandle(hrgnTmp);
|
||||||
|
|
||||||
if (prcUpdate)
|
if (prcUpdate)
|
||||||
|
|
|
@ -26,6 +26,7 @@ int FASTCALL
|
||||||
CLIPPING_UpdateGCRegion(DC* Dc)
|
CLIPPING_UpdateGCRegion(DC* Dc)
|
||||||
{
|
{
|
||||||
PROSRGNDATA CombinedRegion;
|
PROSRGNDATA CombinedRegion;
|
||||||
|
HRGN hRgnVis = NULL;
|
||||||
|
|
||||||
/* Experiment with API region based on wine.. */
|
/* Experiment with API region based on wine.. */
|
||||||
if (Dc->rosdc.hClipRgn && Dc->dclevel.prgnMeta)
|
if (Dc->rosdc.hClipRgn && Dc->dclevel.prgnMeta)
|
||||||
|
@ -50,13 +51,14 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
||||||
Dc->prgnAPI = NULL;
|
Dc->prgnAPI = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Dc->rosdc.hGCClipRgn == NULL)
|
if (Dc->rosdc.hGCClipRgn == NULL)
|
||||||
Dc->rosdc.hGCClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
|
Dc->rosdc.hGCClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
|
||||||
|
|
||||||
if (Dc->rosdc.hClipRgn == NULL)
|
if (Dc->rosdc.hClipRgn == NULL)
|
||||||
NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hVisRgn, 0, RGN_COPY);
|
NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, ((PROSRGNDATA)Dc->prgnVis)->BaseObject.hHmgr, 0, RGN_COPY);
|
||||||
else
|
else
|
||||||
NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hClipRgn, Dc->rosdc.hVisRgn, RGN_AND);
|
NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hClipRgn, hRgnVis, RGN_AND);
|
||||||
|
|
||||||
NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y);
|
NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y);
|
||||||
|
|
||||||
|
@ -104,17 +106,17 @@ GdiSelectVisRgn(HDC hdc, HRGN hrgn)
|
||||||
}
|
}
|
||||||
|
|
||||||
dc->fs &= ~DC_FLAG_DIRTY_RAO;
|
dc->fs &= ~DC_FLAG_DIRTY_RAO;
|
||||||
|
|
||||||
if (dc->rosdc.hVisRgn == NULL)
|
if (dc->prgnVis == NULL)
|
||||||
{
|
{
|
||||||
dc->rosdc.hVisRgn = IntSysCreateRectRgn(0, 0, 0, 0);
|
dc->prgnVis = IntSysCreateRectpRgn(0, 0, 0, 0);
|
||||||
GDIOBJ_CopyOwnership(hdc, dc->rosdc.hVisRgn);
|
GDIOBJ_CopyOwnership(hdc, ((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = NtGdiCombineRgn(dc->rosdc.hVisRgn, hrgn, 0, RGN_COPY);
|
retval = NtGdiCombineRgn(((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr, hrgn, 0, RGN_COPY);
|
||||||
if ( retval != ERROR )
|
if ( retval != ERROR )
|
||||||
{
|
{
|
||||||
NtGdiOffsetRgn(dc->rosdc.hVisRgn, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y);
|
NtGdiOffsetRgn(((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y);
|
||||||
CLIPPING_UpdateGCRegion(dc);
|
CLIPPING_UpdateGCRegion(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,12 +152,10 @@ int FASTCALL GdiExtSelectClipRgn(PDC dc,
|
||||||
{
|
{
|
||||||
if (!dc->rosdc.hClipRgn)
|
if (!dc->rosdc.hClipRgn)
|
||||||
{
|
{
|
||||||
PROSRGNDATA Rgn;
|
|
||||||
RECTL rect;
|
RECTL rect;
|
||||||
if((Rgn = RGNOBJAPI_Lock(dc->rosdc.hVisRgn, NULL)))
|
if(dc->prgnVis)
|
||||||
{
|
{
|
||||||
REGION_GetRgnBox(Rgn, &rect);
|
REGION_GetRgnBox(dc->prgnVis, &rect);
|
||||||
RGNOBJAPI_Unlock(Rgn);
|
|
||||||
dc->rosdc.hClipRgn = IntSysCreateRectRgnIndirect(&rect);
|
dc->rosdc.hClipRgn = IntSysCreateRectRgnIndirect(&rect);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -196,10 +196,10 @@ int APIENTRY NtGdiExtSelectClipRgn(HDC hDC,
|
||||||
INT FASTCALL
|
INT FASTCALL
|
||||||
GdiGetClipBox(HDC hDC, PRECTL rc)
|
GdiGetClipBox(HDC hDC, PRECTL rc)
|
||||||
{
|
{
|
||||||
PROSRGNDATA Rgn;
|
|
||||||
INT retval;
|
INT retval;
|
||||||
PDC dc;
|
PDC dc;
|
||||||
HRGN hRgnNew, hRgn = NULL;
|
PROSRGNDATA pRgnNew, pRgn = NULL;
|
||||||
|
BOOL Unlock = FALSE; //Small hack
|
||||||
|
|
||||||
if (!(dc = DC_LockDc(hDC)))
|
if (!(dc = DC_LockDc(hDC)))
|
||||||
{
|
{
|
||||||
|
@ -209,44 +209,40 @@ GdiGetClipBox(HDC hDC, PRECTL rc)
|
||||||
/* FIXME! Rao and Vis only! */
|
/* FIXME! Rao and Vis only! */
|
||||||
if (dc->prgnAPI) // APIRGN
|
if (dc->prgnAPI) // APIRGN
|
||||||
{
|
{
|
||||||
hRgn = ((PROSRGNDATA)dc->prgnAPI)->BaseObject.hHmgr;
|
pRgn = dc->prgnAPI;
|
||||||
}
|
}
|
||||||
else if (dc->dclevel.prgnMeta) // METARGN
|
else if (dc->dclevel.prgnMeta) // METARGN
|
||||||
{
|
{
|
||||||
hRgn = ((PROSRGNDATA)dc->dclevel.prgnMeta)->BaseObject.hHmgr;
|
pRgn = dc->dclevel.prgnMeta;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hRgn = dc->rosdc.hClipRgn; // CLIPRGN
|
Unlock = TRUE ;
|
||||||
|
pRgn = REGION_LockRgn(dc->rosdc.hClipRgn); // CLIPRGN
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hRgn)
|
if (pRgn)
|
||||||
{
|
{
|
||||||
hRgnNew = IntSysCreateRectRgn( 0, 0, 0, 0 );
|
pRgnNew = IntSysCreateRectpRgn( 0, 0, 0, 0 );
|
||||||
|
|
||||||
NtGdiCombineRgn(hRgnNew, dc->rosdc.hVisRgn, hRgn, RGN_AND);
|
if (!pRgnNew)
|
||||||
|
|
||||||
if (!(Rgn = RGNOBJAPI_Lock(hRgnNew, NULL)))
|
|
||||||
{
|
{
|
||||||
DC_UnlockDc(dc);
|
DC_UnlockDc(dc);
|
||||||
|
if(Unlock) REGION_UnlockRgn(pRgn);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = REGION_GetRgnBox(Rgn, rc);
|
IntGdiCombineRgn(pRgnNew, dc->prgnVis, pRgn, RGN_AND);
|
||||||
|
|
||||||
REGION_FreeRgnByHandle(hRgnNew);
|
retval = REGION_GetRgnBox(pRgnNew, rc);
|
||||||
RGNOBJAPI_Unlock(Rgn);
|
|
||||||
|
REGION_FreeRgnByHandle(pRgnNew->BaseObject.hHmgr);
|
||||||
DC_UnlockDc(dc);
|
DC_UnlockDc(dc);
|
||||||
|
if(Unlock) REGION_UnlockRgn(pRgn);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(Rgn = RGNOBJAPI_Lock(dc->rosdc.hVisRgn, NULL)))
|
retval = REGION_GetRgnBox(dc->prgnVis, rc);
|
||||||
{
|
|
||||||
DC_UnlockDc(dc);
|
|
||||||
return ERROR;
|
|
||||||
}
|
|
||||||
retval = REGION_GetRgnBox(Rgn, rc);
|
|
||||||
RGNOBJAPI_Unlock(Rgn);
|
|
||||||
IntDPtoLP(dc, (LPPOINT)rc, 2);
|
IntDPtoLP(dc, (LPPOINT)rc, 2);
|
||||||
DC_UnlockDc(dc);
|
DC_UnlockDc(dc);
|
||||||
|
|
||||||
|
@ -318,7 +314,7 @@ int APIENTRY NtGdiExcludeClipRect(HDC hDC,
|
||||||
if (!dc->rosdc.hClipRgn)
|
if (!dc->rosdc.hClipRgn)
|
||||||
{
|
{
|
||||||
dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
|
dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
|
||||||
NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hVisRgn, NewRgn, RGN_DIFF);
|
NtGdiCombineRgn(dc->rosdc.hClipRgn, ((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr, NewRgn, RGN_DIFF);
|
||||||
Result = SIMPLEREGION;
|
Result = SIMPLEREGION;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -483,7 +479,7 @@ BOOL APIENTRY NtGdiRectVisible(HDC hDC,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
FASTCALL
|
FASTCALL
|
||||||
IntGdiSetMetaRgn(PDC pDC)
|
IntGdiSetMetaRgn(PDC pDC)
|
||||||
{
|
{
|
||||||
INT Ret = ERROR;
|
INT Ret = ERROR;
|
||||||
|
@ -495,7 +491,7 @@ IntGdiSetMetaRgn(PDC pDC)
|
||||||
{
|
{
|
||||||
TempRgn = IntSysCreateRectpRgn(0,0,0,0);
|
TempRgn = IntSysCreateRectpRgn(0,0,0,0);
|
||||||
if (TempRgn)
|
if (TempRgn)
|
||||||
{
|
{
|
||||||
Ret = IntGdiCombineRgn( TempRgn,
|
Ret = IntGdiCombineRgn( TempRgn,
|
||||||
pDC->dclevel.prgnMeta,
|
pDC->dclevel.prgnMeta,
|
||||||
pDC->dclevel.prgnClip,
|
pDC->dclevel.prgnClip,
|
||||||
|
@ -531,7 +527,7 @@ IntGdiSetMetaRgn(PDC pDC)
|
||||||
pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
|
pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
|
||||||
pDC->dclevel.prgnClip = NULL;
|
pDC->dclevel.prgnClip = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Ret = SIMPLEREGION;
|
Ret = SIMPLEREGION;
|
||||||
}
|
}
|
||||||
return Ret;
|
return Ret;
|
||||||
|
@ -572,7 +568,7 @@ NEW_CLIPPING_UpdateGCRegion(PDC pDC)
|
||||||
REGION_Delete(pDC->prgnRao);
|
REGION_Delete(pDC->prgnRao);
|
||||||
pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0);
|
pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip)
|
if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip)
|
||||||
{
|
{
|
||||||
IntGdiCombineRgn( pDC->prgnAPI,
|
IntGdiCombineRgn( pDC->prgnAPI,
|
||||||
|
|
|
@ -191,14 +191,14 @@ DC_SetOwnership(HDC hDC, PEPROCESS Owner)
|
||||||
//
|
//
|
||||||
if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) return FALSE;
|
if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) return FALSE;
|
||||||
}
|
}
|
||||||
if (pDC->rosdc.hVisRgn)
|
if (pDC->prgnVis)
|
||||||
{ // FIXME! HAX!!!
|
{ // FIXME! HAX!!!
|
||||||
Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hVisRgn);
|
Index = GDI_HANDLE_GET_INDEX(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr);
|
||||||
Entry = &GdiHandleTable->Entries[Index];
|
Entry = &GdiHandleTable->Entries[Index];
|
||||||
if (Entry->UserData) FreeObjectAttr(Entry->UserData);
|
if (Entry->UserData) FreeObjectAttr(Entry->UserData);
|
||||||
Entry->UserData = NULL;
|
Entry->UserData = NULL;
|
||||||
//
|
//
|
||||||
if (!GDIOBJ_SetOwnership(pDC->rosdc.hVisRgn, Owner)) return FALSE;
|
if (!GDIOBJ_SetOwnership(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr, Owner)) return FALSE;
|
||||||
}
|
}
|
||||||
if (pDC->rosdc.hGCClipRgn)
|
if (pDC->rosdc.hGCClipRgn)
|
||||||
{ // FIXME! HAX!!!
|
{ // FIXME! HAX!!!
|
||||||
|
@ -525,9 +525,9 @@ IntGdiDeleteDC(HDC hDC, BOOL Force)
|
||||||
{
|
{
|
||||||
GreDeleteObject(DCToDelete->rosdc.hClipRgn);
|
GreDeleteObject(DCToDelete->rosdc.hClipRgn);
|
||||||
}
|
}
|
||||||
if (DCToDelete->rosdc.hVisRgn)
|
if (DCToDelete->prgnVis)
|
||||||
{
|
{
|
||||||
GreDeleteObject(DCToDelete->rosdc.hVisRgn);
|
GreDeleteObject(DCToDelete->prgnVis->BaseObject.hHmgr);
|
||||||
}
|
}
|
||||||
if (NULL != DCToDelete->rosdc.CombinedClip)
|
if (NULL != DCToDelete->rosdc.CombinedClip)
|
||||||
{
|
{
|
||||||
|
|
|
@ -607,42 +607,38 @@ REGION_CropAndOffsetRegion(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xrect = ExAllocatePoolWithTag(PagedPool, rgnSrc->rdh.nCount * sizeof(RECT), TAG_REGION);
|
xrect = ExAllocatePoolWithTag(PagedPool, rgnSrc->rdh.nCount * sizeof(RECT), TAG_REGION);
|
||||||
|
if(!xrect)
|
||||||
|
return FALSE;
|
||||||
if (rgnDst->Buffer && rgnDst->Buffer != &rgnDst->rdh.rcBound)
|
if (rgnDst->Buffer && rgnDst->Buffer != &rgnDst->rdh.rcBound)
|
||||||
ExFreePoolWithTag(rgnDst->Buffer, TAG_REGION); //free the old buffer. will be assigned to xrect below.
|
ExFreePoolWithTag(rgnDst->Buffer, TAG_REGION); //free the old buffer. will be assigned to xrect below.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xrect)
|
if (rgnDst != rgnSrc)
|
||||||
{
|
{
|
||||||
ULONG i;
|
*rgnDst = *rgnSrc;
|
||||||
|
}
|
||||||
|
|
||||||
if (rgnDst != rgnSrc)
|
if (off->x || off->y)
|
||||||
|
{
|
||||||
|
ULONG i;
|
||||||
|
for (i = 0; i < rgnDst->rdh.nCount; i++)
|
||||||
{
|
{
|
||||||
*rgnDst = *rgnSrc;
|
xrect[i].left = (rgnSrc->Buffer + i)->left + off->x;
|
||||||
|
xrect[i].right = (rgnSrc->Buffer + i)->right + off->x;
|
||||||
|
xrect[i].top = (rgnSrc->Buffer + i)->top + off->y;
|
||||||
|
xrect[i].bottom = (rgnSrc->Buffer + i)->bottom + off->y;
|
||||||
}
|
}
|
||||||
|
rgnDst->rdh.rcBound.left += off->x;
|
||||||
if (off->x || off->y)
|
rgnDst->rdh.rcBound.right += off->x;
|
||||||
{
|
rgnDst->rdh.rcBound.top += off->y;
|
||||||
for (i = 0; i < rgnDst->rdh.nCount; i++)
|
rgnDst->rdh.rcBound.bottom += off->y;
|
||||||
{
|
|
||||||
xrect[i].left = (rgnSrc->Buffer + i)->left + off->x;
|
|
||||||
xrect[i].right = (rgnSrc->Buffer + i)->right + off->x;
|
|
||||||
xrect[i].top = (rgnSrc->Buffer + i)->top + off->y;
|
|
||||||
xrect[i].bottom = (rgnSrc->Buffer + i)->bottom + off->y;
|
|
||||||
}
|
|
||||||
rgnDst->rdh.rcBound.left += off->x;
|
|
||||||
rgnDst->rdh.rcBound.right += off->x;
|
|
||||||
rgnDst->rdh.rcBound.top += off->y;
|
|
||||||
rgnDst->rdh.rcBound.bottom += off->y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
COPY_RECTS(xrect, rgnSrc->Buffer, rgnDst->rdh.nCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
rgnDst->Buffer = xrect;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
{
|
||||||
|
COPY_RECTS(xrect, rgnSrc->Buffer, rgnDst->rdh.nCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
rgnDst->Buffer = xrect;
|
||||||
}
|
}
|
||||||
else if ((rect->left >= rect->right) ||
|
else if ((rect->left >= rect->right) ||
|
||||||
(rect->top >= rect->bottom) ||
|
(rect->top >= rect->bottom) ||
|
||||||
|
@ -2035,13 +2031,13 @@ REGION_AllocRgnWithHandle(INT nReg)
|
||||||
{
|
{
|
||||||
HRGN hReg;
|
HRGN hReg;
|
||||||
PROSRGNDATA pReg;
|
PROSRGNDATA pReg;
|
||||||
|
|
||||||
pReg = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION);
|
pReg = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION);
|
||||||
if(!pReg)
|
if(!pReg)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
hReg = pReg->BaseObject.hHmgr;
|
hReg = pReg->BaseObject.hHmgr;
|
||||||
|
|
||||||
if (nReg == 0 || nReg == 1)
|
if (nReg == 0 || nReg == 1)
|
||||||
|
@ -2228,7 +2224,7 @@ REGION_Cleanup(PVOID ObjectBody)
|
||||||
{
|
{
|
||||||
PROSRGNDATA pRgn = (PROSRGNDATA)ObjectBody;
|
PROSRGNDATA pRgn = (PROSRGNDATA)ObjectBody;
|
||||||
if (pRgn->Buffer && pRgn->Buffer != &pRgn->rdh.rcBound)
|
if (pRgn->Buffer && pRgn->Buffer != &pRgn->rdh.rcBound)
|
||||||
ExFreePool(pRgn->Buffer);
|
ExFreePoolWithTag(pRgn->Buffer, TAG_REGION);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2419,7 +2415,7 @@ IntGdiPaintRgn(
|
||||||
if (!(tmpVisRgn = IntSysCreateRectRgn(0, 0, 0, 0))) return FALSE;
|
if (!(tmpVisRgn = IntSysCreateRectRgn(0, 0, 0, 0))) return FALSE;
|
||||||
|
|
||||||
// Transform region into device co-ords
|
// Transform region into device co-ords
|
||||||
if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) ||
|
if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) ||
|
||||||
NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
|
NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
|
||||||
{
|
{
|
||||||
REGION_FreeRgnByHandle(tmpVisRgn);
|
REGION_FreeRgnByHandle(tmpVisRgn);
|
||||||
|
@ -2552,13 +2548,13 @@ REGION_SetRectRgn(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INT
|
INT
|
||||||
FASTCALL
|
FASTCALL
|
||||||
IntGdiOffsetRgn(
|
IntGdiOffsetRgn(
|
||||||
PROSRGNDATA rgn,
|
PROSRGNDATA rgn,
|
||||||
INT XOffset,
|
INT XOffset,
|
||||||
INT YOffset )
|
INT YOffset )
|
||||||
{
|
{
|
||||||
if (XOffset || YOffset)
|
if (XOffset || YOffset)
|
||||||
{
|
{
|
||||||
int nbox = rgn->rdh.nCount;
|
int nbox = rgn->rdh.nCount;
|
||||||
|
@ -3444,7 +3440,7 @@ NtGdiEqualRgn(
|
||||||
if ( rgn1->rdh.nCount == 0 )
|
if ( rgn1->rdh.nCount == 0 )
|
||||||
{
|
{
|
||||||
bRet = TRUE;
|
bRet = TRUE;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( rgn1->rdh.rcBound.left != rgn2->rdh.rcBound.left ||
|
if ( rgn1->rdh.rcBound.left != rgn2->rdh.rcBound.left ||
|
||||||
|
@ -3691,8 +3687,7 @@ NtGdiGetRandomRgn(
|
||||||
else if (pDC->dclevel.prgnMeta) hSrc = ((PROSRGNDATA)pDC->dclevel.prgnMeta)->BaseObject.hHmgr;
|
else if (pDC->dclevel.prgnMeta) hSrc = ((PROSRGNDATA)pDC->dclevel.prgnMeta)->BaseObject.hHmgr;
|
||||||
break;
|
break;
|
||||||
case SYSRGN:
|
case SYSRGN:
|
||||||
hSrc = pDC->rosdc.hVisRgn;
|
if (pDC->prgnVis) hSrc = ((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr;
|
||||||
// if (pDC->prgnVis) hSrc = ((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
hSrc = 0;
|
hSrc = 0;
|
||||||
|
|
Loading…
Reference in a new issue