Commit 96b7a8a3 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

uxtheme: Use TransparentBlt() for bitmaps with all alpha values being 0xff.

parent ea430bf2
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment