Dmitry Timoshkov : gdiplus: If a device doesn't support AlphaBlend don' t convert image to PARGB.

Alexandre Julliard julliard at winehq.org
Mon Feb 25 14:33:46 CST 2013


Module: wine
Branch: master
Commit: 1896e5575ef63919fefbe3bfc587f41be086b211
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1896e5575ef63919fefbe3bfc587f41be086b211

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Feb 25 13:31:12 2013 +0800

gdiplus: If a device doesn't support AlphaBlend don't convert image to PARGB.

---

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

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 01e127c..853027c 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -398,8 +398,11 @@ static GpStatus alpha_blend_hdc_pixels(GpGraphics *graphics, INT dst_x, INT dst_
     hbitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS,
         (void**)&temp_bits, NULL, 0);
 
-    convert_32bppARGB_to_32bppPARGB(src_width, src_height, temp_bits,
-        4 * src_width, src, src_stride);
+    if (GetDeviceCaps(graphics->hdc, SHADEBLENDCAPS) == SB_NONE)
+        memcpy(temp_bits, src, src_width * src_height * 4);
+    else
+        convert_32bppARGB_to_32bppPARGB(src_width, src_height, temp_bits,
+                                        4 * src_width, src, src_stride);
 
     SelectObject(hdc, hbitmap);
     gdi_alpha_blend(graphics, dst_x, dst_y, src_width, src_height,




More information about the wine-cvs mailing list