Damjan Jovanovic : gdiplus: In CompositingModeSourceCopy, fully transparent pixels are drawn black.

Alexandre Julliard julliard at winehq.org
Thu Mar 5 16:35:27 CST 2020


Module: wine
Branch: master
Commit: 99a171981cc42970f0caee69e1ceb0e810d5955f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=99a171981cc42970f0caee69e1ceb0e810d5955f

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Thu Mar  5 03:35:40 2020 +0200

gdiplus: In CompositingModeSourceCopy, fully transparent pixels are drawn black.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42585
Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/graphics.c    | 7 ++++++-
 dlls/gdiplus/tests/image.c | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 0b6e4ec377..04c5501deb 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -384,7 +384,12 @@ static GpStatus alpha_blend_bmp_pixels(GpGraphics *graphics, INT dst_x, INT dst_
             src_color = ((ARGB*)(src + src_stride * y))[x];
 
             if (comp_mode == CompositingModeSourceCopy)
-                GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, src_color);
+            {
+                if (!(src_color & 0xff000000))
+                    GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, 0);
+                else
+                    GdipBitmapSetPixel(dst_bitmap, x+dst_x, y+dst_y, src_color);
+            }
             else
             {
                 if (!(src_color & 0xff000000))
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index bbb9365edb..0b4ae3cd9c 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -4491,7 +4491,7 @@ static void test_DrawImage_SourceCopy(void)
     expect(0, dst_pixels[0]);
     expect(0xffff0000, dst_pixels[1]);
     expect(0, dst_pixels[2]);
-    todo_wine expect(0, dst_pixels[3]);
+    expect(0, dst_pixels[3]);
 
     status = GdipDeleteGraphics(graphics);
     expect(Ok, status);




More information about the wine-cvs mailing list