sna/trapezoids: Avoid the multiply for an opaque source

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-01-15 18:34:07 +00:00
parent 7f968c8c99
commit da4972eec5
1 changed files with 2 additions and 1 deletions

View File

@ -4417,7 +4417,8 @@ struct inplace {
static force_inline uint8_t coverage_opacity(int coverage, uint8_t opacity)
{
coverage = coverage * 256 / FAST_SAMPLES_XY;
return mul_8_8(coverage - (coverage >> 8), opacity);
coverage -= coverage >> 8;
return opacity == 255 ? coverage : mul_8_8(coverage, opacity);
}
static void