gdi32: Avoid having the source alpha channel interfere with color comparisons in GdiTransparentBlt.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-07-12 11:43:50 +02:00
parent 437c6674b0
commit 474f9ff1fa
1 changed files with 13 additions and 1 deletions

View File

@ -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");