[Wine-patches] [eter-2.0.0] Revert "gdiplus: Use StretchBlt instead of GdiAlphaBlend if device doesn't support alpha blending (eterbug #5892)."

Dmitry Timoshkov dmitry на baikal.ru
Пт Апр 20 08:19:33 MSK 2012


This reverts commit 13478e9847525773246497b657a7fd9353d9e15f.

A more general solution has been accepted by WineHQ.
---
 dlls/gdiplus/graphics.c |   25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 92c24cf..50d2f7c 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -217,6 +217,7 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
         HBITMAP hbitmap, old_hbm=NULL;
         BITMAPINFOHEADER bih;
         BYTE *temp_bits;
+        BLENDFUNCTION bf;
 
         hdc = CreateCompatibleDC(0);
 
@@ -240,25 +241,13 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
 
         old_hbm = SelectObject(hdc, hbitmap);
 
-        if (GetDeviceCaps(graphics->hdc, SHADEBLENDCAPS) == SB_NONE)
-        {
-            TRACE("alpha blending not supported by device, fallback to StretchBlt\n");
+        bf.BlendOp = AC_SRC_OVER;
+        bf.BlendFlags = 0;
+        bf.SourceConstantAlpha = 255;
+        bf.AlphaFormat = AC_SRC_ALPHA;
 
-            StretchBlt(graphics->hdc, dst_x, dst_y, src_width, src_height,
-                       hdc, 0, 0, src_width, src_height, SRCCOPY);
-        }
-        else
-        {
-            BLENDFUNCTION bf;
-
-            bf.BlendOp = AC_SRC_OVER;
-            bf.BlendFlags = 0;
-            bf.SourceConstantAlpha = 255;
-            bf.AlphaFormat = AC_SRC_ALPHA;
-
-            GdiAlphaBlend(graphics->hdc, dst_x, dst_y, src_width, src_height,
-                          hdc, 0, 0, src_width, src_height, bf);
-        }
+        GdiAlphaBlend(graphics->hdc, dst_x, dst_y, src_width, src_height,
+            hdc, 0, 0, src_width, src_height, bf);
 
         SelectObject(hdc, old_hbm);
         DeleteDC(hdc);
-- 
1.7.9.4



Подробная информация о списке рассылки Wine-patches