[PATCH v2 4/5] gdiplus: Fix hatch brush patterns that require anti-aliasing.

Jeff Smith whydoubt at gmail.com
Sat Jun 13 23:10:56 CDT 2020


On Sat, Jun 13, 2020 at 9:29 PM Esme Povirk (they/them)
<vincent at codeweavers.com> wrote:
>
> +static ARGB blend_colors_pre(ARGB start, ARGB end, REAL position)
> +{
> +    const BYTE a = ((start >> 24) & 0xff) * (1 - position) + ((end >>
> 24) & 0xff) * position;
> +    const BYTE r = ((start >> 16) & 0xff) * (1 - position) + ((end >>
> 16) & 0xff) * position;
> +    const BYTE g = ((start >> 8) & 0xff) * (1 - position) + ((end >>
> 8) & 0xff) * position;
> +    const BYTE b = (start & 0xff) * (1 - position) + (end & 0xff) * position;
> +
> +    return (a << 24) | (r << 16) | (g << 8) | b;
> +}
>
> I'm confused by the introduction of this function. It seems to be for
> blending PARGB colors, but the hatch brush colors are ARGB.

While hatch brush colors are specified as ARGB, for the purpose of
anti-aliasing, they are blended as PARGB. This is effectively the same
for opaque hatch colors. For transparent hatch colors, alpha will be
correct, but rgb components will be off to some degree.

Fixing the transparent colors takes a bit of extra work, and I didn't
want to make this patchset any larger. I'm not quite satisfied with
the state of that work either, to be honest.



More information about the wine-devel mailing list