Get rid of hVisRgn in ROS_DC_INFO, use prgnVis in DC instead
svn path=/branches/reactos-yarotows/; revision=46372
typedef struct _ROS_DC_INFO
{
HRGN hClipRgn; /* Clip region (may be 0) */
typedef struct _ROS_DC_INFO
{
HRGN hClipRgn; /* Clip region (may be 0) */
- HRGN hVisRgn; /* Visible region (must never be 0) */
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
BYTE bitsPerPixel;
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
BYTE bitsPerPixel;
RECTL erclBounds;
RECTL erclBoundsApp;
PVOID prgnAPI; /* PROSRGNDATA */
RECTL erclBounds;
RECTL erclBoundsApp;
PVOID prgnAPI; /* PROSRGNDATA */
+ PVOID prgnVis; /* Visible region (must never be 0) */
PVOID prgnRao;
POINTL ptlFillOrigin;
EBRUSHOBJ eboFill;
PVOID prgnRao;
POINTL ptlFillOrigin;
EBRUSHOBJ eboFill;
Monitor->GdiDevice = pGdiDevice;
Monitor->rcMonitor.left = 0;
Monitor->GdiDevice = pGdiDevice;
Monitor->rcMonitor.left = 0;
- Monitor->rcMonitor.top = 0;
- Monitor->rcMonitor.right = Monitor->rcMonitor.left + pGdiDevice->gdiinfo.ulHorzRes;
+ Monitor->rcMonitor.top = 0;
+ Monitor->rcMonitor.right = Monitor->rcMonitor.left + pGdiDevice->gdiinfo.ulHorzRes;
Monitor->rcMonitor.bottom = Monitor->rcMonitor.top + pGdiDevice->gdiinfo.ulVertRes;
Monitor->rcWork = Monitor->rcMonitor;
Monitor->cWndStack = 0;
Monitor->rcMonitor.bottom = Monitor->rcMonitor.top + pGdiDevice->gdiinfo.ulVertRes;
Monitor->rcWork = Monitor->rcMonitor;
Monitor->cWndStack = 0;
/* FIXME: setlasterror? */
return -1;
}
/* FIXME: setlasterror? */
return -1;
}
- dcVisRgn = dc->rosdc.hVisRgn;
+ dcVisRgn = ((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr;
DC_UnlockDc(dc);
regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect);
DC_UnlockDc(dc);
regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect);
- 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 */
DC_UnlockDc(pDC);
/* Begin with the shifted and then clipped scroll rect */
CLIPPING_UpdateGCRegion(DC* Dc)
{
PROSRGNDATA CombinedRegion;
CLIPPING_UpdateGCRegion(DC* Dc)
{
PROSRGNDATA CombinedRegion;
// would prefer this, but the rest of the code sucks
// ASSERT(Dc->rosdc.hGCClipRgn);
// ASSERT(Dc->rosdc.hClipRgn);
// would prefer this, but the rest of the code sucks
// ASSERT(Dc->rosdc.hGCClipRgn);
// ASSERT(Dc->rosdc.hClipRgn);
- if (!Dc->rosdc.hVisRgn)
- 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)
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!"
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)))
NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y);
if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL)))
}
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);
- 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);
- 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);
CLIPPING_UpdateGCRegion(dc);
}
DC_UnlockDc(dc);
{
PROSRGNDATA Rgn;
RECTL rect;
{
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);
{
REGION_GetRgnBox(Rgn, &rect);
RGNOBJAPI_Unlock(Rgn);
if (!dc->rosdc.hClipRgn)
{
dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
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
Result = SIMPLEREGION;
}
else
IntGdiSetMetaRgn(PDC pDC)
{
INT Ret = ERROR;
IntGdiSetMetaRgn(PDC pDC)
{
INT Ret = ERROR;
{
TempRgn = IntSysCreateRectRgn(0,0,0,0);
if (TempRgn)
{
TempRgn = IntSysCreateRectRgn(0,0,0,0);
if (TempRgn)
Ret = IntGdiCombineRgn( TempRgn,
pDC->dclevel.prgnMeta,
pDC->dclevel.prgnClip,
Ret = IntGdiCombineRgn( TempRgn,
pDC->dclevel.prgnMeta,
pDC->dclevel.prgnClip,
pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
pDC->dclevel.prgnClip = NULL;
}
pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
pDC->dclevel.prgnClip = NULL;
}
Ret = SIMPLEREGION;
}
return Ret;
Ret = SIMPLEREGION;
}
return Ret;
REGION_Delete(pDC->prgnRao);
pDC->prgnRao = IntSysCreateRectRgn(0,0,0,0);
}
REGION_Delete(pDC->prgnRao);
pDC->prgnRao = IntSysCreateRectRgn(0,0,0,0);
}
if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip)
{
IntGdiCombineRgn( pDC->prgnAPI,
if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip)
{
IntGdiCombineRgn( pDC->prgnAPI,
pDC->fs &= ~DC_FLAG_DIRTY_RAO;
// if (Dc->CombinedClip != NULL) IntEngDeleteClipRegion(Dc->CombinedClip);
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);
co = IntEngCreateClipRegion( ((PROSRGNDATA)pDC->prgnRao)->rdh.nCount,
((PROSRGNDATA)pDC->prgnRao)->Buffer,
&pDC->erclClip);
ASSERT(hVisRgn);
GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn);
GreDeleteObject(hVisRgn);
ASSERT(hVisRgn);
GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn);
GreDeleteObject(hVisRgn);
- ASSERT(pdc->rosdc.hVisRgn);
pdc->rosdc.bitsPerPixel = pdc->ppdev->gdiinfo.cBitsPixel *
pdc->ppdev->gdiinfo.cPlanes;
}
pdc->rosdc.bitsPerPixel = pdc->ppdev->gdiinfo.cBitsPixel *
pdc->ppdev->gdiinfo.cPlanes;
}
/* Free regions */
if (pdc->rosdc.hClipRgn)
GreDeleteObject(pdc->rosdc.hClipRgn);
/* 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);
ASSERT(pdc->rosdc.hGCClipRgn);
if (pdc->rosdc.hGCClipRgn)
GreDeleteObject(pdc->rosdc.hGCClipRgn);
//
if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) return FALSE;
}
//
if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) return FALSE;
}
- if (pDC->rosdc.hVisRgn)
- 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;
//
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!!!
}
if (pDC->rosdc.hGCClipRgn)
{ // FIXME! HAX!!!
{
HRGN hReg;
PROSRGNDATA pReg;
{
HRGN hReg;
PROSRGNDATA pReg;
pReg = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION);
if(!pReg)
{
return NULL;
}
pReg = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION);
if(!pReg)
{
return NULL;
}
hReg = pReg->BaseObject.hHmgr;
if (nReg == 0 || nReg == 1)
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 (!(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);
NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
{
REGION_FreeRgnByHandle(tmpVisRgn);
FASTCALL
IntGdiOffsetRgn(
PROSRGNDATA rgn,
INT XOffset,
INT YOffset )
FASTCALL
IntGdiOffsetRgn(
PROSRGNDATA rgn,
INT XOffset,
INT YOffset )
if (XOffset || YOffset)
{
int nbox = rgn->rdh.nCount;
if (XOffset || YOffset)
{
int nbox = rgn->rdh.nCount;
if ( rgn1->rdh.nCount == 0 )
{
bRet = TRUE;
if ( rgn1->rdh.nCount == 0 )
{
bRet = TRUE;
}
if ( rgn1->rdh.rcBound.left != rgn2->rdh.rcBound.left ||
}
if ( rgn1->rdh.rcBound.left != rgn2->rdh.rcBound.left ||
else if (pDC->dclevel.prgnMeta) hSrc = ((PROSRGNDATA)pDC->dclevel.prgnMeta)->BaseObject.hHmgr;
break;
case SYSRGN:
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;
break;
default:
hSrc = 0;