Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/imagelist.c:
if (has_alpha) /* we already have an alpha channel in this case */ { - /* pre-multiply by the alpha channel */ - for (i = 0, ptr = bits; i < cx * cy; i++, ptr++) - { - DWORD alpha = *ptr >> 24; - *ptr = ((*ptr & 0xff000000) | - (((*ptr & 0x00ff0000) * alpha / 255) & 0x00ff0000) | - (((*ptr & 0x0000ff00) * alpha / 255) & 0x0000ff00) | - (((*ptr & 0x000000ff) * alpha / 255))); - } +#if __WINE_COMCTL32_VERSION == 5 + premultiply_alpha_channel(bits, cx * cy);
Let's not make changes to both v5 and v6 at the same time. It would be easier for review if you could split them. Also, try to avoid the __WINE_COMCTL32_VERSION checks in the middle of the function. See if you could move them into a helper. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9348#note_120710