sna/gen3: Fix pre-multiplication of opacity masks

The return type for the multipliation was only 8-bits wide dating back
to the time when the function just computed a single channel and didn't
try to blend the output back into the argb pixel value. Inlining the
shift into the function means that we need the output to be 32-bits wide
instead.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49887
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-05-14 14:12:06 +01:00
parent 053bd5bf24
commit 3c9759ef2a
1 changed files with 2 additions and 1 deletions

View File

@ -2543,7 +2543,7 @@ mul_8_8(uint8_t a, uint8_t b)
return ((t >> 8) + t) >> 8;
}
static inline uint8_t multa(uint32_t s, uint32_t m, int shift)
static inline uint32_t multa(uint32_t s, uint32_t m, int shift)
{
return mul_8_8((s >> shift) & 0xff, m >> 24) << shift;
}
@ -2944,6 +2944,7 @@ gen3_render_composite(struct sna *sna,
tmp->src.u.gen3.type = SHADER_CONSTANT;
tmp->src.u.gen3.mode = v;
tmp->src.is_opaque = false;
tmp->mask.u.gen3.type = SHADER_NONE;
}