Author: fireball
Date: Sun Apr 25 17:44:02 2010
New Revision: 47015
URL:
http://svn.reactos.org/svn/reactos?rev=47015&view=rev
Log:
- RosGdiCreateDC: Remove transformation objects from DC. All needed transformations are
performed in usermode (additional bonus is that we remove part of floating point
operations done in kernelmode).
See issue #5237 for more details.
Modified:
branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c
branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h
Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] Sun Apr 25
17:44:02 2010
@@ -22,66 +22,11 @@
/* PUBLIC FUNCTIONS **********************************************************/
-// FIXME: don't use floating point in the kernel! use XFORMOBJ function
-static
-BOOL
-NTAPI
-IntGdiCombineTransform(
- LPXFORM XFormResult,
- LPXFORM xform1,
- LPXFORM xform2)
-{
- XFORM xformTemp;
- /* Check for illegal parameters */
- if (!XFormResult || !xform1 || !xform2)
- {
- return FALSE;
- }
-
- /* Create the result in a temporary XFORM, since xformResult may be
- * equal to xform1 or xform2 */
- xformTemp.eM11 = xform1->eM11 * xform2->eM11 + xform1->eM12 *
xform2->eM21;
- xformTemp.eM12 = xform1->eM11 * xform2->eM12 + xform1->eM12 *
xform2->eM22;
- xformTemp.eM21 = xform1->eM21 * xform2->eM11 + xform1->eM22 *
xform2->eM21;
- xformTemp.eM22 = xform1->eM21 * xform2->eM12 + xform1->eM22 *
xform2->eM22;
- xformTemp.eDx = xform1->eDx * xform2->eM11 + xform1->eDy *
xform2->eM21 + xform2->eDx;
- xformTemp.eDy = xform1->eDx * xform2->eM12 + xform1->eDy *
xform2->eM22 + xform2->eDy;
- *XFormResult = xformTemp;
-
- return TRUE;
-}
-
-// FIXME: Don't use floating point in the kernel!
-static
-BOOL
-NTAPI
-DC_InvertXform(const XFORM *xformSrc,
- XFORM *xformDest)
-{
- FLOAT determinant;
-
- determinant = xformSrc->eM11*xformSrc->eM22 -
xformSrc->eM12*xformSrc->eM21;
- if (determinant > -1e-12 && determinant < 1e-12)
- {
- return FALSE;
- }
-
- xformDest->eM11 = xformSrc->eM22 / determinant;
- xformDest->eM12 = -xformSrc->eM12 / determinant;
- xformDest->eM21 = -xformSrc->eM21 / determinant;
- xformDest->eM22 = xformSrc->eM11 / determinant;
- xformDest->eDx = -xformSrc->eDx * xformDest->eM11 - xformSrc->eDy *
xformDest->eM21;
- xformDest->eDy = -xformSrc->eDx * xformDest->eM12 - xformSrc->eDy *
xformDest->eM22;
-
- return TRUE;
-}
-
BOOL APIENTRY RosGdiCreateDC( PROS_DCINFO dc, HDC *pdev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW* initData )
{
HGDIOBJ hNewDC;
PDC pNewDC;
- XFORM xformWorld2Vport, xformVport2World;
/* TESTING: Create primary surface */
if (!PrimarySurface.pSurface && !IntCreatePrimarySurface())
@@ -96,17 +41,6 @@
/* Set physical device pointer */
pNewDC->pPDevice = (PVOID)&PrimarySurface;
-
- /* Initialize xform objects */
- IntGdiCombineTransform(&xformWorld2Vport, &dc->xfWorld2Wnd,
&dc->xfWnd2Vport);
-
- /* Create inverse of world-to-viewport transformation */
- DC_InvertXform(&xformWorld2Vport, &xformVport2World);
- XForm2MatrixS(&(pNewDC->mxWorldToDevice), &xformWorld2Vport);
- XForm2MatrixS(&(pNewDC->mxDeviceToWorld), &xformVport2World);
-
- /* Save the world transformation */
- XForm2MatrixS(&(pNewDC->mxWorldToPage), &dc->xfWorld2Wnd);
/* Set default fg/bg colors */
pNewDC->crBackgroundClr = RGB(255, 255, 255);
Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Sun Apr 25
17:44:02 2010
@@ -23,11 +23,6 @@
struct region *Clipping;
CLIPOBJ *CombinedClip;
PSWM_WINDOW pWindow;
-
- /* Transformations */
- MATRIX mxWorldToDevice;
- MATRIX mxDeviceToWorld;
- MATRIX mxWorldToPage;
} DC, *PDC;
#define DC_Lock(hDC) \