Huw Davies : gdi32: Ignore the alpha channel for blits to DDBs too.

Alexandre Julliard julliard at winehq.org
Fri Oct 6 14:58:53 CDT 2017


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Oct  6 13:08:47 2017 +0100

gdi32: Ignore the alpha channel for blits to DDBs too.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/bitblt.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c
index 1b057f7..0f21283 100644
--- a/dlls/gdi32/bitblt.c
+++ b/dlls/gdi32/bitblt.c
@@ -843,6 +843,7 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest,
     COLORREF oldBackground;
     COLORREF oldForeground;
     int oldStretchMode;
+    DIBSECTION dib;
 
     if(widthDest < 0 || heightDest < 0 || widthSrc < 0 || heightSrc < 0) {
         TRACE("Cannot mirror\n");
@@ -857,9 +858,11 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest,
     if(oldStretchMode == BLACKONWHITE || oldStretchMode == WHITEONBLACK)
         SetStretchBltMode(hdcSrc, COLORONCOLOR);
     hdcWork = CreateCompatibleDC(hdcDest);
-    if (GetObjectType( hdcDest ) != OBJ_MEMDC && GetDeviceCaps( hdcDest, BITSPIXEL ) == 32)
+    if ((GetObjectType( hdcDest ) != OBJ_MEMDC ||
+         GetObjectW( GetCurrentObject( hdcDest, OBJ_BITMAP ), sizeof(dib), &dib ) == sizeof(BITMAP)) &&
+        GetDeviceCaps( hdcDest, BITSPIXEL ) == 32)
     {
-        /* screen DCs are not supposed to have an alpha channel, so use a 24-bpp bitmap as copy */
+        /* screen DCs or DDBs are not supposed to have an alpha channel, so use a 24-bpp bitmap as copy */
         BITMAPINFO info;
         info.bmiHeader.biSize = sizeof(info.bmiHeader);
         info.bmiHeader.biWidth = widthDest;




More information about the wine-cvs mailing list