mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
nitpicker: avoid color bleeding
This patch improves the output of opaque pixels in the presence of an alpha channel by adding a special case for the maximum alpha value. Fixes #2831
This commit is contained in:
parent
97bfc13237
commit
76e96e92cb
@ -98,13 +98,15 @@ struct Texture_painter
|
||||
* Copy texture with alpha blending
|
||||
*/
|
||||
for (j = clipped.h(); j--; src += src_w, alpha += src_w, dst += dst_w)
|
||||
for (i = clipped.w(), s = src, a = alpha, d = dst; i--; s++, d++, a++)
|
||||
if (*a)
|
||||
*d = PT::mix(*d, *s, *a);
|
||||
for (i = clipped.w(), s = src, a = alpha, d = dst; i--; s++, d++, a++) {
|
||||
unsigned char const alpha_value = *a;
|
||||
if (__builtin_expect(alpha_value != 0, true))
|
||||
*d = PT::mix(*d, *s, alpha_value + 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case MIXED:
|
||||
|
||||
|
||||
for (j = clipped.h(); j--; src += src_w, dst += dst_w)
|
||||
for (i = clipped.w(), s = src, d = dst; i--; s++, d++)
|
||||
*d = PT::avr(mix_pixel, *s);
|
||||
|
Loading…
Reference in New Issue
Block a user