Author: jimtabor
Date: Fri Jun 27 05:58:11 2008
New Revision: 34128
URL:
http://svn.reactos.org/svn/reactos?rev=34128&view=rev
Log:
Path needed some love Phase II:
- Fixed path coordinate problem by enabling old code and fixing arc move to issues. See
that code that everyone thought that had no real use was usefull after all.
- Found more image and region problems, see bug 3402.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/arc.c
trunk/reactos/subsystems/win32/win32k/objects/line.c
trunk/reactos/subsystems/win32/win32k/objects/path.c
trunk/reactos/subsystems/win32/win32k/objects/region.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Fri Jun 27 05:58:11
2008
@@ -1,4 +1,3 @@
-
#include <w32k.h>
#define NDEBUG
@@ -259,8 +258,7 @@
if (arctype == GdiTypeArcTo)
{
- dc->ptlDCOrig.x = EfCx;
- dc->ptlDCOrig.y = EfCy;
+ IntGdiMoveToEx(dc, EfCx, EfCy, NULL);
}
return Ret;
@@ -306,12 +304,7 @@
if (result)
{
- POINT point;
- point.x=x2;
- point.y=y2;
-// CoordLPtoDP ( pDC, &point );
- pDC->ptlDCOrig.x = point.x;
- pDC->ptlDCOrig.y = point.y;
+ IntGdiMoveToEx(pDC, x2, y2, NULL);
}
return result;
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] Fri Jun 27 05:58:11
2008
@@ -102,7 +102,7 @@
if (PATH_IsPathOpen(dc->DcLevel))
{
Ret = PATH_LineTo(dc, XEnd, YEnd);
-#if 0
+//#if 0
if (Ret)
{
// FIXME - PATH_LineTo should maybe do this...
@@ -112,7 +112,7 @@
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
Dc_Attr->ulDirty_ &=
~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
-#endif
+//#endif
return Ret;
}
else
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] Fri Jun 27 05:58:11
2008
@@ -123,32 +123,32 @@
xform = dc->DcLevel.xformWorld2Wnd;
/* Set MM_TEXT */
- IntGdiSetMapMode( dc, MM_TEXT );
- Dc_Attr->ptlViewportOrg.x = 0;
- Dc_Attr->ptlViewportOrg.y = 0;
- Dc_Attr->ptlWindowOrg.x = 0;
- Dc_Attr->ptlWindowOrg.y = 0;
+// IntGdiSetMapMode( dc, MM_TEXT );
+// Dc_Attr->ptlViewportOrg.x = 0;
+// Dc_Attr->ptlViewportOrg.y = 0;
+// Dc_Attr->ptlWindowOrg.x = 0;
+// Dc_Attr->ptlWindowOrg.y = 0;
graphicsMode = Dc_Attr->iGraphicsMode;
- Dc_Attr->iGraphicsMode = GM_ADVANCED;
- IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
- Dc_Attr->iGraphicsMode = graphicsMode;
+// Dc_Attr->iGraphicsMode = GM_ADVANCED;
+// IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
+// Dc_Attr->iGraphicsMode = graphicsMode;
/* Paint the region */
IntGdiPaintRgn( dc, hrgn );
NtGdiDeleteObject( hrgn );
/* Restore the old mapping mode */
- IntGdiSetMapMode( dc, mapMode );
- Dc_Attr->szlViewportExt = ptViewportExt;
- Dc_Attr->ptlViewportOrg = ptViewportOrg;
- Dc_Attr->szlWindowExt = ptWindowExt;
- Dc_Attr->ptlWindowOrg = ptWindowOrg;
+// IntGdiSetMapMode( dc, mapMode );
+// Dc_Attr->szlViewportExt = ptViewportExt;
+// Dc_Attr->ptlViewportOrg = ptViewportOrg;
+// Dc_Attr->szlWindowExt = ptWindowExt;
+// Dc_Attr->ptlWindowOrg = ptWindowOrg;
/* Go to GM_ADVANCED temporarily to restore the world transform */
graphicsMode = Dc_Attr->iGraphicsMode;
- Dc_Attr->iGraphicsMode = GM_ADVANCED;
- IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
- Dc_Attr->iGraphicsMode = graphicsMode;
+// Dc_Attr->iGraphicsMode = GM_ADVANCED;
+// IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
+// Dc_Attr->iGraphicsMode = graphicsMode;
return TRUE;
}
return FALSE;
Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Fri Jun 27
05:58:11 2008
@@ -1959,7 +1959,7 @@
BOOL FASTCALL
REGION_LPTODP(
- HDC hdc,
+ PDC dc,
HRGN hDest,
HRGN hSrc)
{
@@ -1967,7 +1967,6 @@
PROSRGNDATA srcObj = NULL;
PROSRGNDATA destObj = NULL;
- DC * dc = DC_LockDc(hdc);
RECT tmpRect;
BOOL ret = FALSE;
PDC_ATTR Dc_Attr;
@@ -2027,7 +2026,6 @@
REGION_UnlockRgn(destObj);
done:
- DC_UnlockDc(dc);
return ret;
}
@@ -2878,8 +2876,7 @@
HRGN hRgn
)
{
- //RECT box;
- HRGN tmpVisRgn; //, prevVisRgn;
+ HRGN tmpVisRgn;
PROSRGNDATA visrgn;
CLIPOBJ* ClipRegion;
BOOL bRet = FALSE;
@@ -2889,36 +2886,26 @@
BITMAPOBJ *BitmapObj;
PDC_ATTR Dc_Attr;
- if (!dc)
- return FALSE;
+ if (!dc) return FALSE;
Dc_Attr = dc->pDc_Attr;
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
- if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0)))
- {
- DC_UnlockDc(dc);
+ if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))) return FALSE;
+
+ // Transform region into device co-ords
+ if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) ||
+ NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
+ {
+ NtGdiDeleteObject(tmpVisRgn);
return FALSE;
}
- /* ei enable later
- // Transform region into device co-ords
- if (!REGION_LPTODP(hDC, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn,
dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
- {
+ NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->w.hGCClipRgn, RGN_AND);
+
+ visrgn = REGION_LockRgn(tmpVisRgn);
+ if (visrgn == NULL)
+ {
NtGdiDeleteObject(tmpVisRgn);
- DC_UnlockDc(dc);
- return FALSE;
- }
- */
- /* enable when clipping is implemented
- NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->w.hGCClipRgn, RGN_AND);
- */
-
- //visrgn = REGION_LockRgn(tmpVisRgn);
- visrgn = REGION_LockRgn(hRgn);
- if (visrgn == NULL)
- {
- NtGdiDeleteObject(tmpVisRgn);
- DC_UnlockDc(dc);
return FALSE;
}