Author: jimtabor
Date: Mon Jun 2 14:51:04 2008
New Revision: 33830
URL:
http://svn.reactos.org/svn/reactos?rev=33830&view=rev
Log:
Move xform data from W structure into DcLevel within unions. Why: Sticking with systems
floating point and reducing the size of DC.
Modified:
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/include/gdifloat.h
trunk/reactos/subsystems/win32/win32k/objects/coord.c
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/dcutil.c
trunk/reactos/subsystems/win32/win32k/objects/path.c
trunk/reactos/subsystems/win32/win32k/objects/text.c
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Mon Jun 2 14:51:04
2008
@@ -65,11 +65,6 @@
/* #endif */
BYTE bitsPerPixel;
-
- XFORM xformWorld2Wnd; /* World-to-window transformation */
- XFORM xformWorld2Vport; /* World-to-viewport transformation */
- XFORM xformVport2World; /* Inverse of the above transformation */
- BOOL vport2WorldValid; /* Is xformVport2World valid? */
} WIN_DC_INFO;
// EXtended CLip and Window Region Object
@@ -107,9 +102,18 @@
DWORD unk4_00000000[11];
FLONG fl;
FLONG flBrush;
+ union{
MATRIX_S mxWorldToDevice;
+ XFORM xformWorld2Vport; /* World-to-viewport transformation */
+ };
+ union{
MATRIX_S mxDeviceToWorld;
+ XFORM xformVport2World; /* Inverse of the above transformation */
+ };
+ union{
MATRIX_S mxWorldToPage;
+ XFORM xformWorld2Wnd; /* World-to-window transformation */
+ };
EFLOAT_S efM11PtoD;
EFLOAT_S efM22PtoD;
EFLOAT_S efDxPtoD;
Modified: trunk/reactos/subsystems/win32/win32k/include/gdifloat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/gdifloat.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/gdifloat.h [iso-8859-1] Mon Jun 2
14:51:04 2008
@@ -33,12 +33,12 @@
/* Perform the transformation */
x = point->x;
y = point->y;
- point->x = x * dc->w.xformWorld2Vport.eM11 +
- y * dc->w.xformWorld2Vport.eM21 +
- dc->w.xformWorld2Vport.eDx;
- point->y = x * dc->w.xformWorld2Vport.eM12 +
- y * dc->w.xformWorld2Vport.eM22 +
- dc->w.xformWorld2Vport.eDy;
+ point->x = x * dc->DcLevel.xformWorld2Vport.eM11 +
+ y * dc->DcLevel.xformWorld2Vport.eM21 +
+ dc->DcLevel.xformWorld2Vport.eDx;
+ point->y = x * dc->DcLevel.xformWorld2Vport.eM12 +
+ y * dc->DcLevel.xformWorld2Vport.eM22 +
+ dc->DcLevel.xformWorld2Vport.eDy;
}
/* Performs a viewport-to-world transformation on the specified point (which
Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] Mon Jun 2 14:51:04
2008
@@ -150,10 +150,10 @@
FLOAT x, y;
x = (FLOAT)Point->x;
y = (FLOAT)Point->y;
- Point->x = x * Dc->w.xformVport2World.eM11 +
- y * Dc->w.xformVport2World.eM21 + Dc->w.xformVport2World.eDx;
- Point->y = x * Dc->w.xformVport2World.eM12 +
- y * Dc->w.xformVport2World.eM22 + Dc->w.xformVport2World.eDy;
+ Point->x = x * Dc->DcLevel.xformVport2World.eM11 +
+ y * Dc->DcLevel.xformVport2World.eM21 + Dc->DcLevel.xformVport2World.eDx;
+ Point->y = x * Dc->DcLevel.xformVport2World.eM12 +
+ y * Dc->DcLevel.xformVport2World.eM22 + Dc->DcLevel.xformVport2World.eDy;
}
VOID
@@ -190,24 +190,24 @@
switch(Mode)
{
case MWT_IDENTITY:
- pDc->w.xformWorld2Wnd.eM11 = 1.0f;
- pDc->w.xformWorld2Wnd.eM12 = 0.0f;
- pDc->w.xformWorld2Wnd.eM21 = 0.0f;
- pDc->w.xformWorld2Wnd.eM22 = 1.0f;
- pDc->w.xformWorld2Wnd.eDx = 0.0f;
- pDc->w.xformWorld2Wnd.eDy = 0.0f;
+ pDc->DcLevel.xformWorld2Wnd.eM11 = 1.0f;
+ pDc->DcLevel.xformWorld2Wnd.eM12 = 0.0f;
+ pDc->DcLevel.xformWorld2Wnd.eM21 = 0.0f;
+ pDc->DcLevel.xformWorld2Wnd.eM22 = 1.0f;
+ pDc->DcLevel.xformWorld2Wnd.eDx = 0.0f;
+ pDc->DcLevel.xformWorld2Wnd.eDy = 0.0f;
break;
case MWT_LEFTMULTIPLY:
- IntGdiCombineTransform(&pDc->w.xformWorld2Wnd, lpXForm,
&pDc->w.xformWorld2Wnd );
+ IntGdiCombineTransform(&pDc->DcLevel.xformWorld2Wnd, lpXForm,
&pDc->DcLevel.xformWorld2Wnd );
break;
case MWT_RIGHTMULTIPLY:
- IntGdiCombineTransform(&pDc->w.xformWorld2Wnd,
&pDc->w.xformWorld2Wnd, lpXForm);
+ IntGdiCombineTransform(&pDc->DcLevel.xformWorld2Wnd,
&pDc->DcLevel.xformWorld2Wnd, lpXForm);
break;
case MWT_MAX+1: // Must be MWT_SET????
- pDc->w.xformWorld2Wnd = *lpXForm; // Do it like Wine.
+ pDc->DcLevel.xformWorld2Wnd = *lpXForm; // Do it like Wine.
break;
default:
@@ -248,7 +248,7 @@
switch(iXform)
{
case GdiWorldSpaceToPageSpace:
- *XForm = dc->w.xformWorld2Wnd;
+ *XForm = dc->DcLevel.xformWorld2Wnd;
break;
default:
break;
@@ -275,10 +275,10 @@
x = (FLOAT)Point->x;
y = (FLOAT)Point->y;
- Point->x = x * Dc->w.xformWorld2Vport.eM11 +
- y * Dc->w.xformWorld2Vport.eM21 + Dc->w.xformWorld2Vport.eDx;
- Point->y = x * Dc->w.xformWorld2Vport.eM12 +
- y * Dc->w.xformWorld2Vport.eM22 + Dc->w.xformWorld2Vport.eDy;
+ Point->x = x * Dc->DcLevel.xformWorld2Vport.eM11 +
+ y * Dc->DcLevel.xformWorld2Vport.eM21 + Dc->DcLevel.xformWorld2Vport.eDx;
+ Point->y = x * Dc->DcLevel.xformWorld2Vport.eM12 +
+ y * Dc->DcLevel.xformWorld2Vport.eM22 + Dc->DcLevel.xformWorld2Vport.eDy;
}
VOID
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Mon Jun 2 14:51:04
2008
@@ -1336,10 +1336,10 @@
nDc_Attr->ptlCurrent = Dc_Attr->ptlCurrent;
nDc_Attr->ptfxCurrent = Dc_Attr->ptfxCurrent;
newdc->DcLevel.flPath = dc->DcLevel.flPath;
- newdc->w.xformWorld2Wnd = dc->w.xformWorld2Wnd;
- newdc->w.xformWorld2Vport = dc->w.xformWorld2Vport;
- newdc->w.xformVport2World = dc->w.xformVport2World;
- newdc->w.vport2WorldValid = dc->w.vport2WorldValid;
+ newdc->DcLevel.xformWorld2Wnd = dc->DcLevel.xformWorld2Wnd;
+ newdc->DcLevel.xformWorld2Vport = dc->DcLevel.xformWorld2Vport;
+ newdc->DcLevel.xformVport2World = dc->DcLevel.xformVport2World;
+ nDc_Attr->flXform = Dc_Attr->flXform;
nDc_Attr->ptlWindowOrg = Dc_Attr->ptlWindowOrg;
nDc_Attr->szlWindowExt = Dc_Attr->szlWindowExt;
nDc_Attr->ptlViewportOrg = Dc_Attr->ptlViewportOrg;
@@ -1403,10 +1403,10 @@
Dc_Attr->ptlCurrent = sDc_Attr->ptlCurrent;
Dc_Attr->ptfxCurrent = sDc_Attr->ptfxCurrent;
dc->DcLevel.flPath = dcs->DcLevel.flPath;
- dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd;
- dc->w.xformWorld2Vport = dcs->w.xformWorld2Vport;
- dc->w.xformVport2World = dcs->w.xformVport2World;
- dc->w.vport2WorldValid = dcs->w.vport2WorldValid;
+ dc->DcLevel.xformWorld2Wnd = dcs->DcLevel.xformWorld2Wnd;
+ dc->DcLevel.xformWorld2Vport = dcs->DcLevel.xformWorld2Vport;
+ dc->DcLevel.xformVport2World = dcs->DcLevel.xformVport2World;
+ Dc_Attr->flXform = sDc_Attr->flXform;
Dc_Attr->ptlWindowOrg = sDc_Attr->ptlWindowOrg;
Dc_Attr->szlWindowExt = sDc_Attr->szlWindowExt;
Dc_Attr->ptlViewportOrg = sDc_Attr->ptlViewportOrg;
@@ -2405,16 +2405,14 @@
if(!Dc_Attr) Dc_Attr = &NewDC->Dc_Attr;
NewDC->BaseObject.hHmgr = (HGDIOBJ) hDC; // Save the handle for this DC object.
- NewDC->w.xformWorld2Wnd.eM11 = 1.0f;
- NewDC->w.xformWorld2Wnd.eM12 = 0.0f;
- NewDC->w.xformWorld2Wnd.eM21 = 0.0f;
- NewDC->w.xformWorld2Wnd.eM22 = 1.0f;
- NewDC->w.xformWorld2Wnd.eDx = 0.0f;
- NewDC->w.xformWorld2Wnd.eDy = 0.0f;
- NewDC->w.xformWorld2Vport = NewDC->w.xformWorld2Wnd;
- NewDC->w.xformVport2World = NewDC->w.xformWorld2Wnd;
- NewDC->w.vport2WorldValid = TRUE;
-
+ NewDC->DcLevel.xformWorld2Wnd.eM11 = 1.0f;
+ NewDC->DcLevel.xformWorld2Wnd.eM12 = 0.0f;
+ NewDC->DcLevel.xformWorld2Wnd.eM21 = 0.0f;
+ NewDC->DcLevel.xformWorld2Wnd.eM22 = 1.0f;
+ NewDC->DcLevel.xformWorld2Wnd.eDx = 0.0f;
+ NewDC->DcLevel.xformWorld2Wnd.eDy = 0.0f;
+ NewDC->DcLevel.xformWorld2Vport = NewDC->DcLevel.xformWorld2Wnd;
+ NewDC->DcLevel.xformVport2World = NewDC->DcLevel.xformWorld2Wnd;
// Setup syncing bits for the dcattr data packets.
Dc_Attr->flXform = DEVICE_TO_PAGE_INVALID;
@@ -2603,10 +2601,13 @@
xformWnd2Vport.eDy = (FLOAT)Dc_Attr->ptlViewportOrg.y - scaleY *
(FLOAT)Dc_Attr->ptlWindowOrg.y;
/* Combine with the world transformation */
- IntGdiCombineTransform(&dc->w.xformWorld2Vport, &dc->w.xformWorld2Wnd,
&xformWnd2Vport);
+ IntGdiCombineTransform(&dc->DcLevel.xformWorld2Vport,
&dc->DcLevel.xformWorld2Wnd, &xformWnd2Vport);
/* Create inverse of world-to-viewport transformation */
- dc->w.vport2WorldValid = DC_InvertXform(&dc->w.xformWorld2Vport,
&dc->w.xformVport2World);
+ if (DC_InvertXform(&dc->DcLevel.xformWorld2Vport,
&dc->DcLevel.xformVport2World))
+ Dc_Attr->flXform &= ~DEVICE_TO_WORLD_INVALID;
+ else
+ Dc_Attr->flXform |= DEVICE_TO_WORLD_INVALID;
}
BOOL FASTCALL
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcutil.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dcutil.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dcutil.c [iso-8859-1] Mon Jun 2
14:51:04 2008
@@ -113,9 +113,9 @@
CopytoUserDcAttr(PDC dc, PDC_ATTR Dc_Attr)
{
NTSTATUS Status = STATUS_SUCCESS;
- XForm2MatrixS( &dc->Dc_Attr.mxWorldToDevice, &dc->w.xformWorld2Vport);
- XForm2MatrixS( &dc->Dc_Attr.mxDevicetoWorld, &dc->w.xformVport2World);
- XForm2MatrixS( &dc->Dc_Attr.mxWorldToPage, &dc->w.xformWorld2Wnd);
+ XForm2MatrixS( &dc->Dc_Attr.mxWorldToDevice,
&dc->DcLevel.xformWorld2Vport);
+ XForm2MatrixS( &dc->Dc_Attr.mxDevicetoWorld,
&dc->DcLevel.xformVport2World);
+ XForm2MatrixS( &dc->Dc_Attr.mxWorldToPage, &dc->DcLevel.xformWorld2Wnd);
_SEH_TRY
{
ProbeForWrite( Dc_Attr,
Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] Mon Jun 2 14:51:04
2008
@@ -431,7 +431,7 @@
* tests show that resetting the graphics mode to GM_COMPATIBLE does
* not reset the world transform.
*/
- xform = dc->w.xformWorld2Wnd;
+ xform = dc->DcLevel.xformWorld2Wnd;
/* Set MM_TEXT */
IntGdiSetMapMode( dc, MM_TEXT );
@@ -1493,7 +1493,7 @@
IntGetViewportOrgEx(dc, &ptViewportOrg);
IntGetWindowExtEx(dc, &szWindowExt);
IntGetWindowOrgEx(dc, &ptWindowOrg);
- xform = dc->w.xformWorld2Wnd;
+ xform = dc->DcLevel.xformWorld2Wnd;
/* Set MM_TEXT */
Dc_Attr->iMapMode = MM_TEXT;
@@ -1621,7 +1621,7 @@
Dc_Attr->ptlViewportOrg.y = ptViewportOrg.y;
/* Restore the world transform */
- dc->w.xformWorld2Wnd = xform;
+ dc->DcLevel.xformWorld2Wnd = xform;
/* If we've moved the current point then get its new position
which will be in device (MM_TEXT) co-ords, convert it to
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] Mon Jun 2 14:51:04
2008
@@ -2613,7 +2613,7 @@
}
Dc_Attr = dc->pDc_Attr;
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
- eM11 = dc->w.xformWorld2Vport.eM11;
+ eM11 = dc->DcLevel.xformWorld2Vport.eM11;
hFont = Dc_Attr->hlfntNew;
TextObj = TEXTOBJ_LockText(hFont);
DC_UnlockDc(dc);