Alexandre Julliard : gdi32: Implement the LineTo entry point in the path driver.
Alexandre Julliard
julliard at winehq.org
Thu Oct 27 13:30:11 CDT 2011
Module: wine
Branch: master
Commit: fc5e29486dafefaaf3167c60ea1be4e36791a96e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fc5e29486dafefaaf3167c60ea1be4e36791a96e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Oct 26 19:58:51 2011 +0200
gdi32: Implement the LineTo entry point in the path driver.
---
dlls/gdi32/gdi_private.h | 1 -
dlls/gdi32/painting.c | 11 +++------
dlls/gdi32/path.c | 54 ++++++++++++++++++---------------------------
3 files changed, 26 insertions(+), 40 deletions(-)
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index e0b3b76..79fb082 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_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,
LPCWSTR str, UINT count, const INT *dx) DECLSPEC_HIDDEN;
diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c
index 5eb5654..7e88219 100644
--- a/dlls/gdi32/painting.c
+++ b/dlls/gdi32/painting.c
@@ -232,18 +232,15 @@ BOOL nulldrv_PolylineTo( PHYSDEV dev, const POINT *points, INT count )
BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
{
DC * dc = get_dc_ptr( hdc );
+ PHYSDEV physdev;
BOOL ret;
if(!dc) return FALSE;
update_dc( dc );
- if(PATH_IsPathOpen(dc->path))
- ret = PATH_LineTo(dc, x, y);
- else
- {
- PHYSDEV physdev = GET_DC_PHYSDEV( dc, pLineTo );
- ret = physdev->funcs->pLineTo( physdev, x, y );
- }
+ physdev = GET_DC_PHYSDEV( dc, pLineTo );
+ ret = physdev->funcs->pLineTo( physdev, x, y );
+
if(ret) {
dc->CursPosX = x;
dc->CursPosY = y;
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 25e1d52..11be17c 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -895,42 +895,32 @@ static BOOL pathdrv_MoveTo( PHYSDEV dev, INT x, INT y )
return TRUE;
}
-/* PATH_LineTo
- *
- * Should be called when a LineTo is performed on a DC that has an
- * open path. This adds a PT_LINETO entry to the path (and possibly
- * a PT_MOVETO entry, if this is the first LineTo in a stroke).
- * Returns TRUE if successful, else FALSE.
+
+/*************************************************************
+ * pathdrv_LineTo
*/
-BOOL PATH_LineTo(DC *dc, INT x, INT y)
+static BOOL pathdrv_LineTo( PHYSDEV dev, INT x, INT y )
{
- GdiPath *pPath = &dc->path;
- POINT point, pointCurPos;
-
- /* Check that path is open */
- if(pPath->state!=PATH_Open)
- return FALSE;
+ struct path_physdev *physdev = get_path_physdev( dev );
+ POINT point, pointCurPos;
- /* Convert point to device coordinates */
- point.x=x;
- point.y=y;
- if(!LPtoDP(dc->hSelf, &point, 1))
- return FALSE;
+ /* Convert point to device coordinates */
+ point.x = x;
+ point.y = y;
+ LPtoDP( dev->hdc, &point, 1 );
- /* Add a PT_MOVETO if necessary */
- if(pPath->newStroke)
- {
- pPath->newStroke=FALSE;
- pointCurPos.x = dc->CursPosX;
- pointCurPos.y = dc->CursPosY;
- if(!LPtoDP(dc->hSelf, &pointCurPos, 1))
- return FALSE;
- if(!PATH_AddEntry(pPath, &pointCurPos, PT_MOVETO))
- return FALSE;
- }
+ /* Add a PT_MOVETO if necessary */
+ if(physdev->path->newStroke)
+ {
+ physdev->path->newStroke = FALSE;
+ GetCurrentPositionEx( dev->hdc, &pointCurPos );
+ LPtoDP( dev->hdc, &pointCurPos, 1 );
+ if(!PATH_AddEntry(physdev->path, &pointCurPos, PT_MOVETO))
+ return FALSE;
+ }
- /* Add a PT_LINETO entry */
- return PATH_AddEntry(pPath, &point, PT_LINETO);
+ /* Add a PT_LINETO entry */
+ return PATH_AddEntry(physdev->path, &point, PT_LINETO);
}
/* PATH_RoundRect
@@ -2360,7 +2350,7 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pGetTextMetrics */
NULL, /* pIntersectClipRect */
NULL, /* pInvertRgn */
- NULL, /* pLineTo */
+ pathdrv_LineTo, /* pLineTo */
NULL, /* pModifyWorldTransform */
pathdrv_MoveTo, /* pMoveTo */
NULL, /* pOffsetClipRgn */
More information about the wine-cvs
mailing list