Author: jgardou
Date: Wed Mar 24 00:02:00 2010
New Revision: 46372
URL:
http://svn.reactos.org/svn/reactos?rev=46372&view=rev
Log:
[WIN32K]
Get rid of hVisRgn in ROS_DC_INFO, use prgnVis in DC instead
Modified:
branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h
branches/reactos-yarotows/subsystems/win32/win32k/ntuser/monitor.c
branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/cliprgn.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/region.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1] Wed Mar 24
00:02:00 2010
@@ -51,7 +51,6 @@
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;
@@ -129,7 +128,7 @@
RECTL erclBounds;
RECTL erclBoundsApp;
PVOID prgnAPI; /* PROSRGNDATA */
- PVOID prgnVis;
+ PVOID prgnVis; /* Visible region (must never be 0) */
PVOID prgnRao;
POINTL ptlFillOrigin;
EBRUSHOBJ eboFill;
Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/monitor.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Wed
Mar 24 00:02:00 2010
@@ -184,8 +184,8 @@
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;
@@ -506,7 +506,7 @@
/* FIXME: setlasterror? */
return -1;
}
- dcVisRgn = dc->rosdc.hVisRgn;
+ dcVisRgn = ((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr;
DC_UnlockDc(dc);
regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect);
Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] Wed
Mar 24 00:02:00 2010
@@ -1206,7 +1206,7 @@
{
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 */
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/cliprgn.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/cliprgn.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/cliprgn.c [iso-8859-1] Wed
Mar 24 00:02:00 2010
@@ -26,22 +26,28 @@
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)
- {
- DPRINT1("Warning, hVisRgn is NULL!\n");
- }
+ if (!Dc->prgnVis)
+ {
+ 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)))
@@ -84,17 +90,17 @@
}
dc->fs &= ~DC_FLAG_DIRTY_RAO;
-
- if (dc->rosdc.hVisRgn == NULL)
- {
- dc->rosdc.hVisRgn = IntSysCreateRectRgn(0, 0, 0, 0);
- GDIOBJ_CopyOwnership(hdc, dc->rosdc.hVisRgn);
- }
-
- retval = NtGdiCombineRgn(dc->rosdc.hVisRgn, hrgn, 0, RGN_COPY);
+
+ if (dc->prgnVis == NULL)
+ {
+ dc->prgnVis = IntSysCreateRectpRgn(0, 0, 0, 0);
+ GDIOBJ_CopyOwnership(hdc, ((PROSRGNDATA)dc->prgnVis)->BaseObject.hHmgr);
+ }
+
+ 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);
@@ -131,7 +137,7 @@
{
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);
@@ -263,7 +269,7 @@
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
@@ -428,7 +434,7 @@
}
int
-FASTCALL
+FASTCALL
IntGdiSetMetaRgn(PDC pDC)
{
INT Ret = ERROR;
@@ -440,7 +446,7 @@
{
TempRgn = IntSysCreateRectRgn(0,0,0,0);
if (TempRgn)
- {
+ {
Ret = IntGdiCombineRgn( TempRgn,
pDC->dclevel.prgnMeta,
pDC->dclevel.prgnClip,
@@ -476,7 +482,7 @@
pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
pDC->dclevel.prgnClip = NULL;
}
- else
+ else
Ret = SIMPLEREGION;
}
return Ret;
@@ -517,7 +523,7 @@
REGION_Delete(pDC->prgnRao);
pDC->prgnRao = IntSysCreateRectRgn(0,0,0,0);
}
-
+
if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip)
{
IntGdiCombineRgn( pDC->prgnAPI,
@@ -548,7 +554,7 @@
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);
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Wed
Mar 24 00:02:00 2010
@@ -105,7 +105,7 @@
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;
}
@@ -362,8 +362,8 @@
/* 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);
@@ -412,14 +412,14 @@
//
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!!!
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/region.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/region.c [iso-8859-1] Wed
Mar 24 00:02:00 2010
@@ -2035,13 +2035,13 @@
{
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)
@@ -2419,7 +2419,7 @@
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);
@@ -2552,13 +2552,13 @@
}
}
-INT
+INT
FASTCALL
IntGdiOffsetRgn(
PROSRGNDATA rgn,
INT XOffset,
INT YOffset )
-{
+{
if (XOffset || YOffset)
{
int nbox = rgn->rdh.nCount;
@@ -3444,7 +3444,7 @@
if ( rgn1->rdh.nCount == 0 )
{
bRet = TRUE;
- goto exit;
+ goto exit;
}
if ( rgn1->rdh.rcBound.left != rgn2->rdh.rcBound.left ||
@@ -3691,8 +3691,7 @@
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;