sna/gradient: Use a high-precision ramp for a color step rather than fallback

Slightly less precise, but the difference should not be observable in
practice...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-08-11 01:08:49 +01:00
parent 0e61e235bf
commit bfbe36cfea
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ sna_gradient_sample_width(PictGradient *gradient)
int ramp;
if (dx == 0)
return 0;
return 1024;
max = gradient->stops[n].color.red -
gradient->stops[n-1].color.red;
@ -72,7 +72,7 @@ sna_gradient_sample_width(PictGradient *gradient)
if (delta > max)
max = delta;
ramp = 128 * max / xFixedToDouble(dx);
ramp = 128 * max / dx;
if (ramp > width)
width = ramp;
}