Get rid of hVisRgn in ROS_DC_INFO, use prgnVis in DC instead

svn path=/branches/reactos-yarotows/; revision=46372
This commit is contained in:
Jérôme Gardou 2010-03-23 23:02:00 +00:00
parent f5cb03fb7c
commit 33f63724b1
6 changed files with 41 additions and 37 deletions

View file

@ -51,7 +51,6 @@ typedef enum
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) */
BYTE bitsPerPixel; BYTE bitsPerPixel;
@ -129,7 +128,7 @@ typedef struct _DC
RECTL erclBounds; RECTL erclBounds;
RECTL erclBoundsApp; RECTL erclBoundsApp;
PVOID prgnAPI; /* PROSRGNDATA */ PVOID prgnAPI; /* PROSRGNDATA */
PVOID prgnVis; PVOID prgnVis; /* Visible region (must never be 0) */
PVOID prgnRao; PVOID prgnRao;
POINTL ptlFillOrigin; POINTL ptlFillOrigin;
EBRUSHOBJ eboFill; EBRUSHOBJ eboFill;

View file

@ -506,7 +506,7 @@ NtUserEnumDisplayMonitors(
/* FIXME: setlasterror? */ /* FIXME: setlasterror? */
return -1; return -1;
} }
dcVisRgn = dc->rosdc.hVisRgn; dcVisRgn = ((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr;
DC_UnlockDc(dc); DC_UnlockDc(dc);
regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect); regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect);

View file

@ -1206,7 +1206,7 @@ UserScrollDC(
{ {
return FALSE; return FALSE;
} }
hrgnVisible = pDC->rosdc.hVisRgn; // pDC->prgnRao? hrgnVisible = ((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr; // pDC->prgnRao?
DC_UnlockDc(pDC); DC_UnlockDc(pDC);
/* Begin with the shifted and then clipped scroll rect */ /* Begin with the shifted and then clipped scroll rect */

View file

@ -26,22 +26,28 @@ int FASTCALL
CLIPPING_UpdateGCRegion(DC* Dc) CLIPPING_UpdateGCRegion(DC* Dc)
{ {
PROSRGNDATA CombinedRegion; PROSRGNDATA CombinedRegion;
HRGN hRgnVis = NULL;
// would prefer this, but the rest of the code sucks // would prefer this, but the rest of the code sucks
// ASSERT(Dc->rosdc.hGCClipRgn); // ASSERT(Dc->rosdc.hGCClipRgn);
// ASSERT(Dc->rosdc.hClipRgn); // ASSERT(Dc->rosdc.hClipRgn);
if (!Dc->rosdc.hVisRgn) if (!Dc->prgnVis)
{ {
DPRINT1("Warning, hVisRgn is NULL!\n"); DPRINT1("Warning, prgnVis is NULL!\n");
} }
else
{
hRgnVis = ((PROSRGNDATA)Dc->prgnVis)->BaseObject.hHmgr ;
}
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 // FYI: Vis == NULL! source of "IntGdiCombineRgn requires hSrc2 != NULL for combine mode 1!" else // FYI: Vis == NULL! source of "IntGdiCombineRgn requires hSrc2 != NULL for combine mode 1!"
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);
if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL))) if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL)))
@ -85,16 +91,16 @@ 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);
} }
DC_UnlockDc(dc); DC_UnlockDc(dc);
@ -131,7 +137,7 @@ int FASTCALL GdiExtSelectClipRgn(PDC dc,
{ {
PROSRGNDATA Rgn; PROSRGNDATA Rgn;
RECTL rect; RECTL rect;
if((Rgn = RGNOBJAPI_Lock(dc->rosdc.hVisRgn, NULL))) if((Rgn = RGNOBJAPI_Lock(((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr, NULL)))
{ {
REGION_GetRgnBox(Rgn, &rect); REGION_GetRgnBox(Rgn, &rect);
RGNOBJAPI_Unlock(Rgn); RGNOBJAPI_Unlock(Rgn);
@ -263,7 +269,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

View file

@ -105,7 +105,7 @@ DC_InitHack(PDC pdc)
ASSERT(hVisRgn); ASSERT(hVisRgn);
GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn); GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn);
GreDeleteObject(hVisRgn); GreDeleteObject(hVisRgn);
ASSERT(pdc->rosdc.hVisRgn); ASSERT(pdc->prgnVis);
pdc->rosdc.bitsPerPixel = pdc->ppdev->gdiinfo.cBitsPixel * pdc->rosdc.bitsPerPixel = pdc->ppdev->gdiinfo.cBitsPixel *
pdc->ppdev->gdiinfo.cPlanes; pdc->ppdev->gdiinfo.cPlanes;
} }
@ -362,8 +362,8 @@ DC_Cleanup(PVOID ObjectBody)
/* Free regions */ /* Free regions */
if (pdc->rosdc.hClipRgn) if (pdc->rosdc.hClipRgn)
GreDeleteObject(pdc->rosdc.hClipRgn); GreDeleteObject(pdc->rosdc.hClipRgn);
if (pdc->rosdc.hVisRgn) if (pdc->prgnVis)
GreDeleteObject(pdc->rosdc.hVisRgn); REGION_FreeRgnByHandle(((PROSRGNDATA)pdc->prgnVis)->BaseObject.hHmgr);
ASSERT(pdc->rosdc.hGCClipRgn); ASSERT(pdc->rosdc.hGCClipRgn);
if (pdc->rosdc.hGCClipRgn) if (pdc->rosdc.hGCClipRgn)
GreDeleteObject(pdc->rosdc.hGCClipRgn); GreDeleteObject(pdc->rosdc.hGCClipRgn);
@ -412,14 +412,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!!!

View file

@ -3691,8 +3691,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;