summaryrefslogtreecommitdiff
path: root/src/cairo-quartz-surface.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2011-01-03 16:41:34 +0100
committerAndrea Canciani <ranma42@gmail.com>2011-01-18 15:15:28 +0100
commit8c031c029d45d65dac22be9a809cc43f4449d41e (patch)
tree1e357265de9d0429c1fba739fc23e10e9ed5e85f /src/cairo-quartz-surface.c
parent78eade13b196d43a46d84b53e2e0f6cdf27de877 (diff)
pdf,ps,quartz: Use correct tolerance for gradient domain computation
The tolerance argument of _cairo_gradient_pattern_box_to_parameter () is in pattern space, so to have it constant in device space, it should depend on the pattern matrix. In ps and pdf the fallback resolution alone is not meaningful. The resolution/fallback_resolution ratio should be used instead.
Diffstat (limited to 'src/cairo-quartz-surface.c')
-rw-r--r--src/cairo-quartz-surface.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 06dd1287..d29eef06 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -842,7 +842,10 @@ _cairo_quartz_create_gradient_function (const cairo_gradient_pattern_t *gradient
if (gradient->base.extend != CAIRO_EXTEND_NONE) {
double bounds_x1, bounds_x2, bounds_y1, bounds_y2;
- double t[2];
+ double t[2], tolerance;
+
+ tolerance = fabs (_cairo_matrix_compute_determinant (&gradient->base.matrix));
+ tolerance /= _cairo_matrix_transformed_circle_major_axis (&gradient->base.matrix, 1);
bounds_x1 = extents->x;
bounds_y1 = extents->y;
@@ -853,8 +856,11 @@ _cairo_quartz_create_gradient_function (const cairo_gradient_pattern_t *gradient
&bounds_x2, &bounds_y2,
NULL);
- _cairo_gradient_pattern_box_to_parameter (gradient, bounds_x1, bounds_y1,
- bounds_x2, bounds_y2, 1, t);
+ _cairo_gradient_pattern_box_to_parameter (gradient,
+ bounds_x1, bounds_y1,
+ bounds_x2, bounds_y2,
+ tolerance,
+ t);
/* set the input range for the function -- the function knows how
to map values outside of 0.0 .. 1.0 to the correct color */