[PATCH] user32: Create a mask from alpha channel when loading a 32 bpp icon. (v3)

Alexandre Julliard julliard at winehq.org
Tue Aug 21 06:47:05 CDT 2018


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> Alexandre Julliard <julliard at winehq.org> wrote:
>
>> > +    else
>> > +    {
>> > +        if (bmi_has_alpha( bmi, color_bits ))
>> > +        {
>> > +            DWORD alpha_mask_bits_size = bmi_width * bmi_height;
>> > +            unsigned char *alpha_mask_bits = HeapAlloc( GetProcessHeap(), 0, alpha_mask_bits_size );
>> 
>> Rows need to be 32-bit aligned.
>
> Well spotted, thanks.
>
>> I expect it would also cause less code
>> duplication to directly create a 1-bpp bitmap.
>
> What kind of code duplication do you have in mind?

The duplicate setting of biBitCount and the StretchDIBits call. If you
generate a 1-bpp mask you can get rid of all that and simply fall
through to the normal code path.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list