From: Paul Gofman pgofman@codeweavers.com
Fixes a regression introduced by c0bf67636ab3de46c67b8d02e44fb39b5853384a. --- dlls/uxtheme/msstyles.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index aa78c372d15..1efd78f2295 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -1218,12 +1218,37 @@ static BOOL prepare_alpha (HBITMAP bmp, BOOL* hasAlpha, BOOL *hasDefaultTranspar }
if (dib.dsBm.bmBitsPixel != 32) + { + if (dib.dsBm.bmBitsPixel <= 8) + { + RGBQUAD p[256]; + HDC hdc = CreateCompatibleDC(NULL); + HBITMAP prev = SelectObject(hdc, bmp); + UINT count = GetDIBColorTable(hdc, 0, 256, p); + + SelectObject(hdc, prev); + DeleteDC(hdc); + + for (n = 0; n < count; ++n) + { + if (RGB(p[n].rgbRed, p[n].rgbGreen, p[n].rgbBlue) == DEFAULT_TRANSPARENT_COLOR) + { + *hasDefaultTransparentColour = TRUE; + return TRUE; + } + } + } return 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 (RGB(p[0], p[1], p[2]) == DEFAULT_TRANSPARENT_COLOR) + *hasDefaultTransparentColour = TRUE; + }
if (!*hasAlpha) return TRUE;