[v3 PATCH] gdi32: Support Begin/End Path for metafile DCs

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Feb 16 04:28:06 CST 2016


From: Dmitry Timoshkov <dmitry at baikal.ru>

Correct failed test.
Updated Author/signoffs.
v3 - Removed Dmitry signoff on request.

Fixes https://bugs.winehq.org/show_bug.cgi?id=39185

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/gdi32/enhmfdrv/dc.c    |  4 +++-
 dlls/gdi32/path.c           | 20 +++++++++++++++++++-
 dlls/gdi32/tests/metafile.c |  2 +-
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c
index cbf3f5c..a92cf4d 100644
--- a/dlls/gdi32/enhmfdrv/dc.c
+++ b/dlls/gdi32/enhmfdrv/dc.c
@@ -420,12 +420,14 @@ BOOL EMFDRV_AbortPath( PHYSDEV dev )
 
 BOOL EMFDRV_BeginPath( PHYSDEV dev )
 {
+    PHYSDEV next = GET_NEXT_PHYSDEV( dev, pBeginPath );
     EMRBEGINPATH emr;
 
     emr.emr.iType = EMR_BEGINPATH;
     emr.emr.nSize = sizeof(emr);
 
-    return EMFDRV_WriteRecord( dev, &emr.emr );
+    if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
+    return next->funcs->pBeginPath( next );
 }
 
 BOOL EMFDRV_CloseFigure( PHYSDEV dev )
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index e09cd0b..166b6b2 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -804,13 +804,23 @@ static BOOL pathdrv_EndPath( PHYSDEV dev )
 {
     struct path_physdev *physdev = get_path_physdev( dev );
     DC *dc = get_dc_ptr( dev->hdc );
+    BOOL ret = TRUE;
+    DWORD type;
 
     if (!dc) return FALSE;
+
+    type = GetObjectType(dev->hdc);
+    if (type == OBJ_METADC || type == OBJ_ENHMETADC)
+    {
+        PHYSDEV next = GET_NEXT_PHYSDEV( dev, pEndPath );
+        ret = next->funcs->pEndPath( next );
+    }
+
     dc->path = physdev->path;
     pop_dc_driver( dc, &path_driver );
     HeapFree( GetProcessHeap(), 0, physdev );
     release_dc_ptr( dc );
-    return TRUE;
+    return ret;
 }
 
 
@@ -1513,6 +1523,14 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
     struct path_physdev *physdev = get_path_physdev( dev );
     unsigned int idx, ggo_flags = GGO_NATIVE;
     POINT offset = {0, 0};
+    DWORD type;
+
+    type = GetObjectType(dev->hdc);
+    if (type == OBJ_METADC || type == OBJ_ENHMETADC)
+    {
+        PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExtTextOut );
+        return next->funcs->pExtTextOut( next, x, y, flags, lprc, str, count, dx );
+    }
 
     if (!count) return TRUE;
     if (flags & ETO_GLYPH_INDEX) ggo_flags |= GGO_GLYPH_INDEX;
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 6804a96..07dac13 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -3386,7 +3386,7 @@ static void test_emf_GetPath(void)
     EndPath(hdcMetafile);
 
     size = GetPath(hdcMetafile, NULL, NULL, 0);
-    todo_wine ok( size == 5, "GetPath returned %d.\n", size);
+    ok( size == 5, "GetPath returned %d.\n", size);
 
     hemf = CloseEnhMetaFile(hdcMetafile);
     ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());
-- 
2.7.0




More information about the wine-patches mailing list