uxtheme: Use TransparentBlt() for bitmaps with all alpha values being 0xff.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51553 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ea430bf2b7
commit
96b7a8a317
|
@ -1072,11 +1072,18 @@ static BOOL prepare_alpha (HBITMAP bmp, BOOL* hasAlpha)
|
|||
if (!bmp || GetObjectW( bmp, sizeof(dib), &dib ) != sizeof(dib))
|
||||
return FALSE;
|
||||
|
||||
if(dib.dsBm.bmBitsPixel != 32)
|
||||
if (dib.dsBm.bmBitsPixel != 32 || dib.dsBmih.biCompression != BI_RGB)
|
||||
/* nothing to do */
|
||||
return TRUE;
|
||||
|
||||
*hasAlpha = TRUE;
|
||||
/* If all alpha values are 0xff, don't use alpha blending */
|
||||
for (n = 0, p = dib.dsBm.bmBits; n < dib.dsBmih.biWidth * dib.dsBmih.biHeight; n++, p += 4)
|
||||
if ((*hasAlpha = (p[3] != 0xff)))
|
||||
break;
|
||||
|
||||
if (!*hasAlpha)
|
||||
return TRUE;
|
||||
|
||||
p = dib.dsBm.bmBits;
|
||||
n = dib.dsBmih.biHeight * dib.dsBmih.biWidth;
|
||||
/* AlphaBlend() wants premultiplied alpha, so do that now */
|
||||
|
|
Loading…
Reference in New Issue