Added patch to implement support for paths on a metafile HDC.

This commit is contained in:
Sebastian Lackner 2016-02-18 12:21:14 +01:00
parent b6c11108ec
commit 2f5862fb37
3 changed files with 111 additions and 0 deletions

View File

@ -0,0 +1,91 @@
From 6092670380abae9d9e773d6c8d75b55c5fe8be80 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 18 Feb 2016 12:18:01 +0100
Subject: gdi32: Add support for paths on a metafile HDC.
---
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.1

View File

@ -0,0 +1 @@
Fixes: [39185] Add support for paths on a metafile HDC

View File

@ -146,6 +146,7 @@ patch_enable_all ()
enable_fonts_Missing_Fonts="$1"
enable_gdi32_Lazy_Font_Initialization="$1"
enable_gdi32_MultiMonitor="$1"
enable_gdi32_Path_Metafile="$1"
enable_gdi32_Symbol_Truetype_Font="$1"
enable_hal_KeQueryPerformanceCounter="$1"
enable_hid_HidP_TranslateUsagesToI8042ScanCodes="$1"
@ -581,6 +582,9 @@ patch_enable ()
gdi32-MultiMonitor)
enable_gdi32_MultiMonitor="$2"
;;
gdi32-Path_Metafile)
enable_gdi32_Path_Metafile="$2"
;;
gdi32-Symbol_Truetype_Font)
enable_gdi32_Symbol_Truetype_Font="$2"
;;
@ -3645,6 +3649,21 @@ if test "$enable_gdi32_MultiMonitor" -eq 1; then
) >> "$patchlist"
fi
# Patchset gdi32-Path_Metafile
# |
# | This patchset fixes the following Wine bugs:
# | * [#39185] Add support for paths on a metafile HDC
# |
# | Modified files:
# | * dlls/gdi32/enhmfdrv/dc.c, dlls/gdi32/path.c, dlls/gdi32/tests/metafile.c
# |
if test "$enable_gdi32_Path_Metafile" -eq 1; then
patch_apply gdi32-Path_Metafile/0001-gdi32-Add-support-for-paths-on-a-metafile-HDC.patch
(
echo '+ { "Dmitry Timoshkov", "gdi32: Add support for paths on a metafile HDC.", 1 },';
) >> "$patchlist"
fi
# Patchset gdi32-Symbol_Truetype_Font
# |
# | This patchset fixes the following Wine bugs: