summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Vukicevic <vladimir@pobox.com>2007-11-15 11:56:56 -0800
committerVladimir Vukicevic <vladimir@h-232.office.mozilla.org>2007-11-15 11:56:56 -0800
commit50d5f5a4e6d7424694b0b27fc0c3a00c9eb203bb (patch)
treeee74d2927909790a0a601dd81a8c29acfb25e4a4
parentbcb0f57e5eca58480e24251777f0b967e1aadefe (diff)
[quartz] Fix gradients; the wrong color field was being used
The wrong color field was being used, effectively making gradients always have transparent black as their color stops.
-rw-r--r--src/cairo-quartz-surface.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 9c3014c1..37053a49 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -325,10 +325,10 @@ ComputeGradientValue (void *info, const float *in, float *out)
if (i == 0 || i == grad->n_stops) {
if (i == grad->n_stops)
--i;
- out[0] = grad->stops[i].color.red / 65535.;
- out[1] = grad->stops[i].color.green / 65535.;
- out[2] = grad->stops[i].color.blue / 65535.;
- out[3] = grad->stops[i].color.alpha / 65535.;
+ out[0] = grad->stops[i].color.red;
+ out[1] = grad->stops[i].color.green;
+ out[2] = grad->stops[i].color.blue;
+ out[3] = grad->stops[i].color.alpha;
} else {
float ax = _cairo_fixed_to_double(grad->stops[i-1].x);
float bx = _cairo_fixed_to_double(grad->stops[i].x) - ax;
@@ -336,17 +336,17 @@ ComputeGradientValue (void *info, const float *in, float *out)
float ap = 1.0 - bp;
out[0] =
- (grad->stops[i-1].color.red / 65535.) * ap +
- (grad->stops[i].color.red / 65535.) * bp;
+ grad->stops[i-1].color.red * ap +
+ grad->stops[i].color.red * bp;
out[1] =
- (grad->stops[i-1].color.green / 65535.) * ap +
- (grad->stops[i].color.green / 65535.) * bp;
+ grad->stops[i-1].color.green * ap +
+ grad->stops[i].color.green * bp;
out[2] =
- (grad->stops[i-1].color.blue / 65535.) * ap +
- (grad->stops[i].color.blue / 65535.) * bp;
+ grad->stops[i-1].color.blue * ap +
+ grad->stops[i].color.blue * bp;
out[3] =
- (grad->stops[i-1].color.alpha / 65535.) * ap +
- (grad->stops[i].color.alpha / 65535.) * bp;
+ grad->stops[i-1].color.alpha * ap +
+ grad->stops[i].color.alpha * bp;
}
}