CLIPPING_UpdateGCRegion(DC* Dc)
{
PROSRGNDATA CombinedRegion;
+ HRGN hRgnVis = NULL;
// would prefer this, but the rest of the code sucks
// ASSERT(Dc->rosdc.hGCClipRgn);
// 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)
Dc->rosdc.hGCClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
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!"
- 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);
if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL)))
}
dc->fs &= ~DC_FLAG_DIRTY_RAO;
-
- if (dc->rosdc.hVisRgn == NULL)
+
+ if (dc->prgnVis == NULL)
{
- dc->rosdc.hVisRgn = IntSysCreateRectRgn(0, 0, 0, 0);
- GDIOBJ_CopyOwnership(hdc, dc->rosdc.hVisRgn);
+ dc->prgnVis = IntSysCreateRectpRgn(0, 0, 0, 0);
+ 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 )
{
- 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);
}
DC_UnlockDc(dc);
{
PROSRGNDATA Rgn;
RECTL rect;
- if((Rgn = RGNOBJAPI_Lock(dc->rosdc.hVisRgn, NULL)))
+ if((Rgn = RGNOBJAPI_Lock(((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr, NULL)))
{
REGION_GetRgnBox(Rgn, &rect);
RGNOBJAPI_Unlock(Rgn);
if (!dc->rosdc.hClipRgn)
{
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;
}
else
}
int
-FASTCALL
+FASTCALL
IntGdiSetMetaRgn(PDC pDC)
{
INT Ret = ERROR;
{
TempRgn = IntSysCreateRectRgn(0,0,0,0);
if (TempRgn)
- {
+ {
Ret = IntGdiCombineRgn( TempRgn,
pDC->dclevel.prgnMeta,
pDC->dclevel.prgnClip,
pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
pDC->dclevel.prgnClip = NULL;
}
- else
+ else
Ret = SIMPLEREGION;
}
return Ret;
REGION_Delete(pDC->prgnRao);
pDC->prgnRao = IntSysCreateRectRgn(0,0,0,0);
}
-
+
if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip)
{
IntGdiCombineRgn( pDC->prgnAPI,
pDC->fs &= ~DC_FLAG_DIRTY_RAO;
// if (Dc->CombinedClip != NULL) IntEngDeleteClipRegion(Dc->CombinedClip);
-
+
co = IntEngCreateClipRegion( ((PROSRGNDATA)pDC->prgnRao)->rdh.nCount,
((PROSRGNDATA)pDC->prgnRao)->Buffer,
&pDC->erclClip);
ASSERT(hVisRgn);
GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn);
GreDeleteObject(hVisRgn);
- ASSERT(pdc->rosdc.hVisRgn);
+ ASSERT(pdc->prgnVis);
pdc->rosdc.bitsPerPixel = pdc->ppdev->gdiinfo.cBitsPixel *
pdc->ppdev->gdiinfo.cPlanes;
}
/* Free regions */
if (pdc->rosdc.hClipRgn)
GreDeleteObject(pdc->rosdc.hClipRgn);
- if (pdc->rosdc.hVisRgn)
- GreDeleteObject(pdc->rosdc.hVisRgn);
+ if (pdc->prgnVis)
+ REGION_FreeRgnByHandle(((PROSRGNDATA)pdc->prgnVis)->BaseObject.hHmgr);
ASSERT(pdc->rosdc.hGCClipRgn);
if (pdc->rosdc.hGCClipRgn)
GreDeleteObject(pdc->rosdc.hGCClipRgn);
//
if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) return FALSE;
}
- if (pDC->rosdc.hVisRgn)
+ if (pDC->prgnVis)
{ // FIXME! HAX!!!
- Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hVisRgn);
+ Index = GDI_HANDLE_GET_INDEX(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr);
Entry = &GdiHandleTable->Entries[Index];
if (Entry->UserData) FreeObjectAttr(Entry->UserData);
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)
{ // FIXME! HAX!!!
{
HRGN hReg;
PROSRGNDATA pReg;
-
+
pReg = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION);
if(!pReg)
{
return NULL;
}
-
+
hReg = pReg->BaseObject.hHmgr;
if (nReg == 0 || nReg == 1)
if (!(tmpVisRgn = IntSysCreateRectRgn(0, 0, 0, 0))) return FALSE;
// 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)
{
REGION_FreeRgnByHandle(tmpVisRgn);
}
}
-INT
+INT
FASTCALL
IntGdiOffsetRgn(
PROSRGNDATA rgn,
INT XOffset,
INT YOffset )
-{
+{
if (XOffset || YOffset)
{
int nbox = rgn->rdh.nCount;
if ( rgn1->rdh.nCount == 0 )
{
bRet = TRUE;
- goto exit;
+ goto exit;
}
if ( rgn1->rdh.rcBound.left != rgn2->rdh.rcBound.left ||
else if (pDC->dclevel.prgnMeta) hSrc = ((PROSRGNDATA)pDC->dclevel.prgnMeta)->BaseObject.hHmgr;
break;
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;
default:
hSrc = 0;