Added patch to ignore externally set DC state in gdiplus.

This commit is contained in:
Sebastian Lackner 2016-12-26 17:43:42 +01:00
parent 08fc972c37
commit ffccd4f5dd
4 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,28 @@
From 36195993f4774dc100437f2aef60201041ee752a Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
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

View File

@ -0,0 +1,29 @@
From c1d9a2c8a3b018f3b5c244d62c3515e2f5a47d49 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
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

View File

@ -0,0 +1 @@
Fixes: [35372] Ignore externally set DC state in gdiplus

View File

@ -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: