Alexandre Julliard : gdi32: Implement PolylineTo in enhanced metafiles.

Alexandre Julliard julliard at winehq.org
Fri Jun 17 10:35:01 CDT 2016


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jun 17 14:00:17 2016 +0900

gdi32: Implement PolylineTo in enhanced metafiles.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/enhmfdrv/enhmetafiledrv.h |  1 +
 dlls/gdi32/enhmfdrv/graphics.c       | 14 ++++++++++++--
 dlls/gdi32/enhmfdrv/init.c           |  2 +-
 dlls/gdi32/tests/metafile.c          | 28 +++++++++++++++++-----------
 4 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
index aa24913..f4ed165 100644
--- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
+++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
@@ -98,6 +98,7 @@ extern BOOL     EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* cou
 extern BOOL     EMFDRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polys) DECLSPEC_HIDDEN;
 extern BOOL     EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN;
 extern BOOL     EMFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN;
+extern BOOL     EMFDRV_PolylineTo( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN;
 extern BOOL     EMFDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN;
 extern BOOL     EMFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN;
 extern BOOL     EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c
index 6724c10..98be711 100644
--- a/dlls/gdi32/enhmfdrv/graphics.c
+++ b/dlls/gdi32/enhmfdrv/graphics.c
@@ -389,7 +389,7 @@ EMFDRV_Polylinegon( PHYSDEV dev, const POINT* pt, INT count, DWORD iType )
         return ret;
     }
 
-    if(iType == EMR_POLYBEZIERTO) {
+    if(iType == EMR_POLYBEZIERTO || iType == EMR_POLYLINETO) {
         POINT cur_pt;
 
         GetCurrentPositionEx( dev->hdc, &cur_pt );
@@ -467,7 +467,7 @@ EMFDRV_Polylinegon16( PHYSDEV dev, const POINT* pt, INT count, DWORD iType )
         return ret;
     }
 
-    if(iType == EMR_POLYBEZIERTO16) {
+    if(iType == EMR_POLYBEZIERTO16 || iType == EMR_POLYLINETO16) {
         POINT cur_pt;
 
         GetCurrentPositionEx( dev->hdc, &cur_pt );
@@ -512,6 +512,16 @@ BOOL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
 }
 
 /**********************************************************************
+ *          EMFDRV_PolylineTo
+ */
+BOOL EMFDRV_PolylineTo( PHYSDEV dev, const POINT* pt, INT count )
+{
+    if( EMFDRV_Polylinegon16( dev, pt, count, EMR_POLYLINETO16 ) )
+        return TRUE;
+    return EMFDRV_Polylinegon( dev, pt, count, EMR_POLYLINETO );
+}
+
+/**********************************************************************
  *          EMFDRV_Polygon
  */
 BOOL EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
index 4d13c2b..8d6acf2 100644
--- a/dlls/gdi32/enhmfdrv/init.c
+++ b/dlls/gdi32/enhmfdrv/init.c
@@ -111,7 +111,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
     EMFDRV_PolyPolyline,             /* pPolyPolyline */
     EMFDRV_Polygon,                  /* pPolygon */
     EMFDRV_Polyline,                 /* pPolyline */
-    NULL,                            /* pPolylineTo */
+    EMFDRV_PolylineTo,               /* pPolylineTo */
     NULL,                            /* pPutImage */
     NULL,                            /* pRealizeDefaultPalette */
     NULL,                            /* pRealizePalette */
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 4cf61a2..f90a747 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -3601,7 +3601,7 @@ static const unsigned char EMF_PATH_BITS[] =
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0xd8, 0xff, 0xff, 0xff, 0xd8, 0xff, 0xff, 0xff,
     0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
-    0x34, 0x02, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
+    0x60, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
     0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x20, 0x03, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00,
@@ -3655,17 +3655,22 @@ static const unsigned char EMF_PATH_BITS[] =
     0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00,
     0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x0a, 0x00,
     0x0a, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00,
-    0x5a, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
+    0x59, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-    0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
-    0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
-    0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x0a, 0x00,
-    0x0a, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00,
-    0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
-    0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
-    0x14, 0x00, 0x00, 0x00
+    0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00,
+    0x14, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00,
+    0x14, 0x00, 0x14, 0x00, 0x5a, 0x00, 0x00, 0x00,
+    0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00,
+    0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+    0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00,
+    0x14, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00,
+    0x14, 0x00, 0x14, 0x00, 0x3c, 0x00, 0x00, 0x00,
+    0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
+    0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
 };
 
 static void test_emf_GetPath(void)
@@ -3700,11 +3705,12 @@ static void test_emf_GetPath(void)
     Ellipse(hdcMetafile, 10, 10, 20, 20);
     RoundRect(hdcMetafile, 10, 10, 20, 20, 3, 5);
     Polyline(hdcMetafile, pts, 4);
+    PolylineTo(hdcMetafile, pts, 4);
     PolyPolyline(hdcMetafile, pts, counts, 2);
     EndPath(hdcMetafile);
 
     size = GetPath(hdcMetafile, NULL, NULL, 0);
-    todo_wine ok( size == 88, "GetPath returned %d.\n", size);
+    todo_wine ok( size == 93, "GetPath returned %d.\n", size);
 
     hemf = CloseEnhMetaFile(hdcMetafile);
     ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());




More information about the wine-cvs mailing list