Alexandre Julliard : gdi32: Implement the MoveTo entry point in the path driver.
Alexandre Julliard
julliard at winehq.org
Thu Oct 27 13:30:10 CDT 2011
Module: wine
Branch: master
Commit: 2c1ec7fc3b99c7ce38b777e010f480ce06b41ce1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2c1ec7fc3b99c7ce38b777e010f480ce06b41ce1
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Oct 26 19:57:28 2011 +0200
gdi32: Implement the MoveTo entry point in the path driver.
---
dlls/gdi32/gdi_private.h | 1 -
dlls/gdi32/painting.c | 11 ++++-------
dlls/gdi32/path.c | 26 ++++++++------------------
3 files changed, 12 insertions(+), 26 deletions(-)
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index db5ec43..e0b3b76 100644
--- a/dlls/gdi32/gdi_private.h
+++ b/dlls/gdi32/gdi_private.h
@@ -325,7 +325,6 @@ extern void PATH_DestroyGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
extern BOOL PATH_SavePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
extern BOOL PATH_RestorePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
-extern BOOL PATH_MoveTo(DC *dc) DECLSPEC_HIDDEN;
extern BOOL PATH_LineTo(DC *dc, INT x, INT y) DECLSPEC_HIDDEN;
extern BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2) DECLSPEC_HIDDEN;
extern BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c
index 60b2898..5eb5654 100644
--- a/dlls/gdi32/painting.c
+++ b/dlls/gdi32/painting.c
@@ -258,7 +258,8 @@ BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
*/
BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, LPPOINT pt )
{
- BOOL ret = TRUE;
+ BOOL ret;
+ PHYSDEV physdev;
DC * dc = get_dc_ptr( hdc );
if(!dc) return FALSE;
@@ -270,12 +271,8 @@ BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, LPPOINT pt )
dc->CursPosX = x;
dc->CursPosY = y;
- if(PATH_IsPathOpen(dc->path)) ret = PATH_MoveTo(dc);
- else
- {
- PHYSDEV physdev = GET_DC_PHYSDEV( dc, pMoveTo );
- ret = physdev->funcs->pMoveTo( physdev, x, y );
- }
+ physdev = GET_DC_PHYSDEV( dc, pMoveTo );
+ ret = physdev->funcs->pMoveTo( physdev, x, y );
release_dc_ptr( dc );
return ret;
}
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index ba67952..25e1d52 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -884,25 +884,15 @@ BOOL PATH_RestorePath( DC *dst, DC *src )
return ret;
}
-/* PATH_MoveTo
- *
- * Should be called when a MoveTo is performed on a DC that has an
- * open path. This starts a new stroke. Returns TRUE if successful, else
- * FALSE.
+
+/*************************************************************
+ * pathdrv_MoveTo
*/
-BOOL PATH_MoveTo(DC *dc)
+static BOOL pathdrv_MoveTo( PHYSDEV dev, INT x, INT y )
{
- GdiPath *pPath = &dc->path;
-
- /* Check that path is open */
- if(pPath->state!=PATH_Open)
- /* FIXME: Do we have to call SetLastError? */
- return FALSE;
-
- /* Start a new stroke */
- pPath->newStroke=TRUE;
-
- return TRUE;
+ struct path_physdev *physdev = get_path_physdev( dev );
+ physdev->path->newStroke = TRUE;
+ return TRUE;
}
/* PATH_LineTo
@@ -2372,7 +2362,7 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pInvertRgn */
NULL, /* pLineTo */
NULL, /* pModifyWorldTransform */
- NULL, /* pMoveTo */
+ pathdrv_MoveTo, /* pMoveTo */
NULL, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrg */
NULL, /* pOffsetWindowOrg */
More information about the wine-cvs
mailing list