diff --git a/patches/gdiplus-DC_Handling/0001-gdiplus-Ignore-an-externally-set-DC-origin.patch b/patches/gdiplus-DC_Handling/0001-gdiplus-Ignore-an-externally-set-DC-origin.patch new file mode 100644 index 00000000..34314f1a --- /dev/null +++ b/patches/gdiplus-DC_Handling/0001-gdiplus-Ignore-an-externally-set-DC-origin.patch @@ -0,0 +1,28 @@ +From 36195993f4774dc100437f2aef60201041ee752a Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Mon, 26 Dec 2016 21:17:29 +0800 +Subject: gdiplus: Ignore an externally set DC origin. + +gdiplus maintains its own graphics state. + +FIXME: perhaps some other places need a similar fix. +--- + dlls/gdiplus/graphics.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c +index f9a6f3e..e086dfc 100644 +--- a/dlls/gdiplus/graphics.c ++++ b/dlls/gdiplus/graphics.c +@@ -497,6 +497,8 @@ static GpStatus alpha_blend_pixels_hrgn(GpGraphics *graphics, INT dst_x, INT dst + + save = SaveDC(graphics->hdc); + ++ SetViewportOrgEx(graphics->hdc, 0, 0, NULL); ++ + if (hrgn) + ExtSelectClipRgn(graphics->hdc, hrgn, RGN_AND); + +-- +2.9.0 + diff --git a/patches/gdiplus-DC_Handling/0002-gdiplus-Ignore-an-externally-set-DC-clipping-region.patch b/patches/gdiplus-DC_Handling/0002-gdiplus-Ignore-an-externally-set-DC-clipping-region.patch new file mode 100644 index 00000000..551b822e --- /dev/null +++ b/patches/gdiplus-DC_Handling/0002-gdiplus-Ignore-an-externally-set-DC-clipping-region.patch @@ -0,0 +1,29 @@ +From c1d9a2c8a3b018f3b5c244d62c3515e2f5a47d49 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Mon, 26 Dec 2016 21:22:02 +0800 +Subject: gdiplus: Ignore an externally set DC clipping region. + +gdiplus maintains its own graphics state. + +FIXME: perhaps some other places need a similar fix. +--- + dlls/gdiplus/graphics.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c +index e086dfc..47b7bda 100644 +--- a/dlls/gdiplus/graphics.c ++++ b/dlls/gdiplus/graphics.c +@@ -499,8 +499,7 @@ static GpStatus alpha_blend_pixels_hrgn(GpGraphics *graphics, INT dst_x, INT dst + + SetViewportOrgEx(graphics->hdc, 0, 0, NULL); + +- if (hrgn) +- ExtSelectClipRgn(graphics->hdc, hrgn, RGN_AND); ++ ExtSelectClipRgn(graphics->hdc, hrgn, RGN_COPY); + + if (hregion) + ExtSelectClipRgn(graphics->hdc, hregion, RGN_AND); +-- +2.9.0 + diff --git a/patches/gdiplus-DC_Handling/definition b/patches/gdiplus-DC_Handling/definition new file mode 100644 index 00000000..464acd5b --- /dev/null +++ b/patches/gdiplus-DC_Handling/definition @@ -0,0 +1 @@ +Fixes: [35372] Ignore externally set DC state in gdiplus diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a30bd8f7..94898c4a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -155,6 +155,7 @@ patch_enable_all () enable_gdi32_MultiMonitor="$1" enable_gdi32_Path_Metafile="$1" enable_gdi32_Symbol_Truetype_Font="$1" + enable_gdiplus_DC_Handling="$1" enable_gdiplus_Grayscale_PNG="$1" enable_hal_KeQueryPerformanceCounter="$1" enable_hnetcfg_INetFwAuthorizedApplication="$1" @@ -654,6 +655,9 @@ patch_enable () gdi32-Symbol_Truetype_Font) enable_gdi32_Symbol_Truetype_Font="$2" ;; + gdiplus-DC_Handling) + enable_gdiplus_DC_Handling="$2" + ;; gdiplus-Grayscale_PNG) enable_gdiplus_Grayscale_PNG="$2" ;; @@ -4034,6 +4038,23 @@ if test "$enable_gdi32_Symbol_Truetype_Font" -eq 1; then ) >> "$patchlist" fi +# Patchset gdiplus-DC_Handling +# | +# | This patchset fixes the following Wine bugs: +# | * [#35372] Ignore externally set DC state in gdiplus +# | +# | Modified files: +# | * dlls/gdiplus/graphics.c +# | +if test "$enable_gdiplus_DC_Handling" -eq 1; then + patch_apply gdiplus-DC_Handling/0001-gdiplus-Ignore-an-externally-set-DC-origin.patch + patch_apply gdiplus-DC_Handling/0002-gdiplus-Ignore-an-externally-set-DC-clipping-region.patch + ( + echo '+ { "Dmitry Timoshkov", "gdiplus: Ignore an externally set DC origin.", 1 },'; + echo '+ { "Dmitry Timoshkov", "gdiplus: Ignore an externally set DC clipping region.", 1 },'; + ) >> "$patchlist" +fi + # Patchset gdiplus-Grayscale_PNG # | # | This patchset fixes the following Wine bugs: