Alexandre Julliard : gdi32: Avoid having the source alpha channel interfere with color comparisons in GdiTransparentBlt.
Alexandre Julliard
julliard at winehq.org
Wed Jul 12 15:37:25 CDT 2017
Module: wine
Branch: master
Commit: 474f9ff1fa2ebf4ae6c4ef3b0d4987062b30d838
URL: http://source.winehq.org/git/wine.git/?a=commit;h=474f9ff1fa2ebf4ae6c4ef3b0d4987062b30d838
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Jul 12 11:43:50 2017 +0200
gdi32: Avoid having the source alpha channel interfere with color comparisons in GdiTransparentBlt.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/bitblt.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c
index 3d8c128..1b057f7 100644
--- a/dlls/gdi32/bitblt.c
+++ b/dlls/gdi32/bitblt.c
@@ -857,7 +857,19 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest,
if(oldStretchMode == BLACKONWHITE || oldStretchMode == WHITEONBLACK)
SetStretchBltMode(hdcSrc, COLORONCOLOR);
hdcWork = CreateCompatibleDC(hdcDest);
- bmpWork = CreateCompatibleBitmap(hdcDest, widthDest, heightDest);
+ if (GetObjectType( hdcDest ) != OBJ_MEMDC && GetDeviceCaps( hdcDest, BITSPIXEL ) == 32)
+ {
+ /* screen DCs 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;
+ info.bmiHeader.biHeight = heightDest;
+ info.bmiHeader.biPlanes = 1;
+ info.bmiHeader.biBitCount = 24;
+ info.bmiHeader.biCompression = BI_RGB;
+ bmpWork = CreateDIBSection( 0, &info, DIB_RGB_COLORS, NULL, NULL, 0 );
+ }
+ else bmpWork = CreateCompatibleBitmap(hdcDest, widthDest, heightDest);
oldWork = SelectObject(hdcWork, bmpWork);
if(!StretchBlt(hdcWork, 0, 0, widthDest, heightDest, hdcSrc, xSrc, ySrc, widthSrc, heightSrc, SRCCOPY)) {
TRACE("Failed to stretch\n");
More information about the wine-cvs
mailing list