mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 15:02:25 +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,9 +98,11 @@ struct Texture_painter
|
|||||||
* Copy texture with alpha blending
|
* Copy texture with alpha blending
|
||||||
*/
|
*/
|
||||||
for (j = clipped.h(); j--; src += src_w, alpha += src_w, dst += dst_w)
|
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++)
|
for (i = clipped.w(), s = src, a = alpha, d = dst; i--; s++, d++, a++) {
|
||||||
if (*a)
|
unsigned char const alpha_value = *a;
|
||||||
*d = PT::mix(*d, *s, *a);
|
if (__builtin_expect(alpha_value != 0, true))
|
||||||
|
*d = PT::mix(*d, *s, alpha_value + 1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MIXED:
|
case MIXED:
|
||||||
|
Loading…
Reference in New Issue
Block a user