From bfbe36cfea76337689dd8a101ec03469f6d3553d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 11 Aug 2011 01:08:49 +0100 Subject: [PATCH] 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 --- src/sna/sna_gradient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_gradient.c b/src/sna/sna_gradient.c index 5fb74ebc..6b85b100 100644 --- a/src/sna/sna_gradient.c +++ b/src/sna/sna_gradient.c @@ -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; }