[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690

Alexandre Julliard julliard at winehq.org
Sun Jun 17 20:03:25 UTC 2012


The following commit has been merged in the wheezy branch:
commit 7fae46f64a72967f89ba5015e1312e63e8fa2d27
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Apr 13 14:03:49 2012 +0900

    gdiplus: Use StretchBlt instead of GdiAlphaBlend if device doesn't support alpha blending.
    (cherry picked from commit 600cbb78743fceb2f8abf29ebf23aa0ea97254a7)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index fee6935..b7daada 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -340,6 +340,30 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti,
     }
 }
 
+static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_width, INT dst_height,
+                            HDC hdc, INT src_x, INT src_y, INT src_width, INT src_height)
+{
+    if (GetDeviceCaps(graphics->hdc, SHADEBLENDCAPS) == SB_NONE)
+    {
+        TRACE("alpha blending not supported by device, fallback to StretchBlt\n");
+
+        StretchBlt(graphics->hdc, dst_x, dst_y, dst_width, dst_height,
+                   hdc, src_x, src_y, 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, dst_width, dst_height,
+                      hdc, src_x, src_y, src_width, src_height, bf);
+    }
+}
+
 /* Draw non-premultiplied ARGB data to the given graphics object */
 static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
     const BYTE *src, INT src_width, INT src_height, INT src_stride)
@@ -370,10 +394,9 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
     else
     {
         HDC hdc;
-        HBITMAP hbitmap, old_hbm=NULL;
+        HBITMAP hbitmap;
         BITMAPINFOHEADER bih;
         BYTE *temp_bits;
-        BLENDFUNCTION bf;
 
         hdc = CreateCompatibleDC(0);
 
@@ -395,17 +418,9 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
         convert_32bppARGB_to_32bppPARGB(src_width, src_height, temp_bits,
             4 * src_width, src, src_stride);
 
-        old_hbm = SelectObject(hdc, hbitmap);
-
-        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);
-
-        SelectObject(hdc, old_hbm);
+        SelectObject(hdc, hbitmap);
+        gdi_alpha_blend(graphics, dst_x, dst_y, src_width, src_height,
+                        hdc, 0, 0, src_width, src_height);
         DeleteDC(hdc);
         DeleteObject(hbitmap);
 
@@ -858,19 +873,12 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
             if (GetClipBox(graphics->hdc, &rc) != NULLREGION)
             {
                 HDC hdc = CreateCompatibleDC(NULL);
-                BLENDFUNCTION bf;
 
                 if (!hdc) break;
 
                 SelectObject(hdc, bmp);
-
-                bf.BlendOp = AC_SRC_OVER;
-                bf.BlendFlags = 0;
-                bf.SourceConstantAlpha = 255;
-                bf.AlphaFormat = AC_SRC_ALPHA;
-
-                GdiAlphaBlend(graphics->hdc, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, hdc, 0, 0, 1, 1, bf);
-
+                gdi_alpha_blend(graphics, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
+                                hdc, 0, 0, 1, 1);
                 DeleteDC(hdc);
             }
 
@@ -3001,15 +3009,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
 
             if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha))
             {
-                BLENDFUNCTION bf;
-
-                bf.BlendOp = AC_SRC_OVER;
-                bf.BlendFlags = 0;
-                bf.SourceConstantAlpha = 255;
-                bf.AlphaFormat = AC_SRC_ALPHA;
-
-                GdiAlphaBlend(graphics->hdc, pti[0].x, pti[0].y, pti[1].x-pti[0].x, pti[2].y-pti[0].y,
-                    hdc, srcx, srcy, srcwidth, srcheight, bf);
+                gdi_alpha_blend(graphics, pti[0].x, pti[0].y, pti[1].x - pti[0].x, pti[2].y - pti[0].y,
+                                hdc, srcx, srcy, srcwidth, srcheight);
             }
             else
             {

-- 
Debian Wine packaging



More information about the pkg-wine-party mailing list