summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-11 01:08:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-11 19:42:42 +0100
commitbfbe36cfea76337689dd8a101ec03469f6d3553d (patch)
tree3e28dec43d985e64a1c474431c3f5b8f162118e3
parent0e61e235bf7a926fd4e5b1f5a05b72dce4c450f3 (diff)
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>
-rw-r--r--src/sna/sna_gradient.c4
1 files 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;
}