Alexandre Julliard : gdi32: Add path entry points for functions that behave differently with an open path .

Alexandre Julliard julliard at winehq.org
Fri Oct 28 12:48:38 CDT 2011


Module: wine
Branch: master
Commit: 418424d36264e0508f123352d9769649c878c10d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=418424d36264e0508f123352d9769649c878c10d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Oct 28 13:16:11 2011 +0200

gdi32: Add path entry points for functions that behave differently with an open path.

---

 dlls/gdi32/path.c |   54 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index afb5660..65b2544 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -804,6 +804,16 @@ BOOL WINAPI SelectClipPath(HDC hdc, INT iMode)
 
 
 /***********************************************************************
+ *           pathdrv_BeginPath
+ */
+static BOOL pathdrv_BeginPath( PHYSDEV dev )
+{
+    /* path already open, nothing to do */
+    return TRUE;
+}
+
+
+/***********************************************************************
  *           pathdrv_AbortPath
  */
 static BOOL pathdrv_AbortPath( PHYSDEV dev )
@@ -1588,6 +1598,21 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
 }
 
 
+/*************************************************************
+ *           pathdrv_CloseFigure
+ */
+static BOOL pathdrv_CloseFigure( PHYSDEV dev )
+{
+    struct path_physdev *physdev = get_path_physdev( dev );
+
+    /* Set PT_CLOSEFIGURE on the last entry and start a new stroke */
+    /* It is not necessary to draw a line, PT_CLOSEFIGURE is a virtual closing line itself */
+    if (physdev->path->numEntriesUsed)
+        physdev->path->pFlags[physdev->path->numEntriesUsed - 1] |= PT_CLOSEFIGURE;
+    return TRUE;
+}
+
+
 /*******************************************************************
  *      FlattenPath [GDI32.@]
  *
@@ -2113,14 +2138,10 @@ BOOL nulldrv_BeginPath( PHYSDEV dev )
 {
     DC *dc = get_nulldrv_dc( dev );
 
-    /* If path is already open, do nothing */
-    if (dc->path.state != PATH_Open)
-    {
-        if (!path_driver.pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL )) return FALSE;
-        PATH_EmptyPath(&dc->path);
-        dc->path.newStroke = TRUE;
-        dc->path.state = PATH_Open;
-    }
+    if (!path_driver.pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL )) return FALSE;
+    PATH_EmptyPath(&dc->path);
+    dc->path.newStroke = TRUE;
+    dc->path.state = PATH_Open;
     return TRUE;
 }
 
@@ -2140,17 +2161,8 @@ BOOL nulldrv_AbortPath( PHYSDEV dev )
 
 BOOL nulldrv_CloseFigure( PHYSDEV dev )
 {
-    DC *dc = get_nulldrv_dc( dev );
-
-    if (dc->path.state != PATH_Open)
-    {
-        SetLastError( ERROR_CAN_NOT_COMPLETE );
-        return FALSE;
-    }
-    /* Set PT_CLOSEFIGURE on the last entry and start a new stroke */
-    /* It is not necessary to draw a line, PT_CLOSEFIGURE is a virtual closing line itself */
-    if (dc->path.numEntriesUsed) dc->path.pFlags[dc->path.numEntriesUsed - 1] |= PT_CLOSEFIGURE;
-    return TRUE;
+    SetLastError( ERROR_CAN_NOT_COMPLETE );
+    return FALSE;
 }
 
 BOOL nulldrv_SelectClipPath( PHYSDEV dev, INT mode )
@@ -2248,11 +2260,11 @@ const struct gdi_dc_funcs path_driver =
     pathdrv_AngleArc,                   /* pAngleArc */
     pathdrv_Arc,                        /* pArc */
     pathdrv_ArcTo,                      /* pArcTo */
-    NULL,                               /* pBeginPath */
+    pathdrv_BeginPath,                  /* pBeginPath */
     NULL,                               /* pBlendImage */
     NULL,                               /* pChoosePixelFormat */
     pathdrv_Chord,                      /* pChord */
-    NULL,                               /* pCloseFigure */
+    pathdrv_CloseFigure,                /* pCloseFigure */
     NULL,                               /* pCreateBitmap */
     NULL,                               /* pCreateCompatibleDC */
     pathdrv_CreateDC,                   /* pCreateDC */




More information about the wine-cvs mailing list