Author: tkreuzer
Date: Sat Jul 28 18:31:24 2012
New Revision: 56970
URL:
http://svn.reactos.org/svn/reactos?rev=56970&view=rev
Log:
[WIN32K]
- Take translation into account when inverting an XFORMOBJ
- Always use the matrices from the DCATTR instead of DCLEVEL
- Mark Device-to-World translation as invalid when the Window Origin is modified
Fixes 7088
See issue #7088 for more details.
Modified:
trunk/reactos/win32ss/gdi/ntgdi/coord.c
trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
trunk/reactos/win32ss/gdi/ntgdi/freetype.c
trunk/reactos/win32ss/gdi/ntgdi/gdifloat.h
trunk/reactos/win32ss/gdi/ntgdi/path.c
trunk/reactos/win32ss/gdi/ntgdi/xformobj.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/coord.c?…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] Sat Jul 28 18:31:24 2012
@@ -635,7 +635,7 @@
pdcattr->ptlWindowOrg.x += XOffset;
pdcattr->ptlWindowOrg.y += YOffset;
- pdcattr->flXform |= PAGE_XLATE_CHANGED;
+ pdcattr->flXform |= PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID;
DC_UnlockDc(dc);
@@ -1052,8 +1052,6 @@
pdcattr->flXform |= (PAGE_EXTENTS_CHANGED |
INVALIDATE_ATTRIBUTES |
DEVICE_TO_WORLD_INVALID);
-
-// DC_UpdateXforms(pdc);
}
// NtGdiSetLayout
Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/fillshap…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] Sat Jul 28 18:31:24 2012
@@ -663,7 +663,7 @@
}
/* Do we rotate or shear? */
- if (!(dc->dclevel.mxWorldToDevice.flAccel & XFORM_SCALE))
+ if (!(dc->pdcattr->mxWorldToDevice.flAccel & XFORM_SCALE))
{
POINTL DestCoords[4];
ULONG PolyCounts = 4;
Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Sat Jul 28 18:31:24 2012
@@ -1490,7 +1490,7 @@
pdcattr = dc->pdcattr;
- MatrixS2XForm(&xForm, &dc->dclevel.mxWorldToDevice);
+ MatrixS2XForm(&xForm, &dc->pdcattr->mxWorldToDevice);
eM11 = xForm.eM11;
hFont = pdcattr->hlfntNew;
Modified: trunk/reactos/win32ss/gdi/ntgdi/gdifloat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/gdifloat…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/gdifloat.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/gdifloat.h [iso-8859-1] Sat Jul 28 18:31:24 2012
@@ -23,8 +23,8 @@
{
FLOAT x, y;
XFORM xformWorld2Vport;
-
- MatrixS2XForm(&xformWorld2Vport, &dc->dclevel.mxWorldToDevice);
+
+ MatrixS2XForm(&xformWorld2Vport, &dc->pdcattr->mxWorldToDevice);
/* Perform the transformation */
x = point->x;
Modified: trunk/reactos/win32ss/gdi/ntgdi/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/path.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] Sat Jul 28 18:31:24 2012
@@ -76,7 +76,7 @@
{
XFORMOBJ xo;
- XFORMOBJ_vInit(&xo, &pdc->dclevel.mxDeviceToWorld);
+ XFORMOBJ_vInit(&xo, &pdc->pdcattr->mxDeviceToWorld);
return XFORMOBJ_bApplyXform(&xo, XF_LTOL, count, (PPOINTL)ppt, (PPOINTL)ppt);
}
@@ -124,7 +124,7 @@
* tests show that resetting the graphics mode to GM_COMPATIBLE does
* not reset the world transform.
*/
- MatrixS2XForm(&xform, &dc->dclevel.mxWorldToPage);
+ MatrixS2XForm(&xform, &dc->pdcattr->mxWorldToPage);
/* Set MM_TEXT */
// IntGdiSetMapMode( dc, MM_TEXT );
@@ -1429,7 +1429,7 @@
szWindowExt = dc->pdcattr->szlWindowExt;
ptWindowOrg = dc->pdcattr->ptlWindowOrg;
- MatrixS2XForm(&xform, &dc->dclevel.mxWorldToPage);
+ MatrixS2XForm(&xform, &dc->pdcattr->mxWorldToPage);
/* Set MM_TEXT */
pdcattr->iMapMode = MM_TEXT;
@@ -1556,7 +1556,7 @@
pdcattr->ptlViewportOrg.y = ptViewportOrg.y;
/* Restore the world transform */
- XForm2MatrixS(&dc->dclevel.mxWorldToPage, &xform);
+ XForm2MatrixS(&dc->pdcattr->mxWorldToPage, &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/win32ss/gdi/ntgdi/xformobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/xformobj…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/xformobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/xformobj.c [iso-8859-1] Sat Jul 28 18:31:24 2012
@@ -288,6 +288,16 @@
FLOATOBJ_Div(&pmxDst->efM12, &foDet);
pmxDst->efM21 = pmxSrc->efM21;
FLOATOBJ_Div(&pmxDst->efM21, &foDet);
+
+ /* Calculate the inverted x shift: Dx' = -Dx * M11' - Dy * M21' */
+ pmxDst->efDx = pmxSrc->efDx;
+ FLOATOBJ_Neg(&pmxDst->efDx);
+ MulSub(&pmxDst->efDx, &pmxDst->efDx, &pmxDst->efM11,
&pmxSrc->efDy, &pmxDst->efM21);
+
+ /* Calculate the inverted y shift: Dy' = -Dy * M22' - Dx * M12' */
+ pmxDst->efDy = pmxSrc->efDy;
+ FLOATOBJ_Neg(&pmxDst->efDy);
+ MulSub(&pmxDst->efDy, &pmxDst->efDy, &pmxDst->efM22,
&pmxSrc->efDx, &pmxDst->efM12);
/* Update accelerators and return complexity */
return XFORMOBJ_UpdateAccel(pxoDst);