summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-12-29 12:45:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-12-29 12:55:09 +0000
commit010085622674bd02098742f401409da8e7c1b1dc (patch)
tree4db64f71ca0e5040df36cda4ed565d243b6c0cdc
parent84b81388bef4a2f300580081415fe09947edb96e (diff)
[path] Remove tolerance from path bounders
With Behdad's analytical analysis of the spline bbox, tolerance is now redundant for the path extents and the approximate bounds, so remove it from the functions parameters.
-rw-r--r--src/cairo-analysis-surface.c3
-rw-r--r--src/cairo-gstate.c3
-rw-r--r--src/cairo-path-bounds.c18
-rw-r--r--src/cairo-surface-fallback.c1
-rw-r--r--src/cairoint.h5
5 files changed, 9 insertions, 21 deletions
diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index b3eab41f..b80ad628 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -481,7 +481,7 @@ _cairo_analysis_surface_stroke (void *abstract_surface,
cairo_rectangle_int_t mask_extents;
_cairo_path_fixed_approximate_stroke_extents (path,
- style, ctm, tolerance,
+ style, ctm,
&mask_extents);
is_empty = _cairo_rectangle_intersect (&extents, &mask_extents);
@@ -539,7 +539,6 @@ _cairo_analysis_surface_fill (void *abstract_surface,
cairo_rectangle_int_t mask_extents;
_cairo_path_fixed_approximate_fill_extents (path,
- tolerance,
&mask_extents);
is_empty = _cairo_rectangle_intersect (&extents, &mask_extents);
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 9ebc5d17..df7ec5c4 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -796,8 +796,7 @@ _cairo_gstate_path_extents (cairo_gstate_t *gstate,
double px1, py1, px2, py2;
_cairo_path_fixed_bounds (path,
- &px1, &py1, &px2, &py2,
- gstate->tolerance);
+ &px1, &py1, &px2, &py2);
_cairo_gstate_backend_to_user_rectangle (gstate,
&px1, &py1, &px2, &py2,
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c
index 698d1fa5..56f2df52 100644
--- a/src/cairo-path-bounds.c
+++ b/src/cairo-path-bounds.c
@@ -37,8 +37,6 @@
#include "cairoint.h"
typedef struct cairo_path_bounder {
- double tolerance;
-
cairo_point_t current_point;
cairo_bool_t has_initial_point;
cairo_bool_t has_point;
@@ -47,9 +45,8 @@ typedef struct cairo_path_bounder {
} cairo_path_bounder_t;
static void
-_cairo_path_bounder_init (cairo_path_bounder_t *bounder, double tolerance)
+_cairo_path_bounder_init (cairo_path_bounder_t *bounder)
{
- bounder->tolerance = tolerance;
bounder->has_initial_point = FALSE;
bounder->has_point = FALSE;
}
@@ -167,7 +164,7 @@ _cairo_path_fixed_approximate_extents (cairo_path_fixed_t *path,
cairo_path_bounder_t bounder;
cairo_status_t status;
- _cairo_path_bounder_init (&bounder, 0.);
+ _cairo_path_bounder_init (&bounder);
status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
_cairo_path_bounder_move_to,
@@ -192,13 +189,12 @@ _cairo_path_fixed_approximate_extents (cairo_path_fixed_t *path,
*/
void
_cairo_path_fixed_approximate_fill_extents (cairo_path_fixed_t *path,
- double tolerance,
cairo_rectangle_int_t *extents)
{
cairo_path_bounder_t bounder;
cairo_status_t status;
- _cairo_path_bounder_init (&bounder, tolerance);
+ _cairo_path_bounder_init (&bounder);
status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
_cairo_path_bounder_move_to,
@@ -223,13 +219,12 @@ void
_cairo_path_fixed_approximate_stroke_extents (cairo_path_fixed_t *path,
cairo_stroke_style_t *style,
const cairo_matrix_t *ctm,
- double tolerance,
cairo_rectangle_int_t *extents)
{
cairo_path_bounder_t bounder;
cairo_status_t status;
- _cairo_path_bounder_init (&bounder, tolerance);
+ _cairo_path_bounder_init (&bounder);
status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
_cairo_path_bounder_move_to,
@@ -261,13 +256,12 @@ _cairo_path_fixed_approximate_stroke_extents (cairo_path_fixed_t *path,
void
_cairo_path_fixed_bounds (cairo_path_fixed_t *path,
double *x1, double *y1,
- double *x2, double *y2,
- double tolerance)
+ double *x2, double *y2)
{
cairo_path_bounder_t bounder;
cairo_status_t status;
- _cairo_path_bounder_init (&bounder, tolerance);
+ _cairo_path_bounder_init (&bounder);
status = _cairo_path_fixed_interpret (path, CAIRO_DIRECTION_FORWARD,
_cairo_path_bounder_move_to,
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 9cd59d42..6cc67d19 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -958,7 +958,6 @@ _cairo_surface_fallback_fill (cairo_surface_t *surface,
cairo_rectangle_int_t path_extents;
_cairo_path_fixed_approximate_fill_extents (path,
- tolerance,
&path_extents);
if (! _cairo_rectangle_intersect (&extents, &path_extents))
return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairoint.h b/src/cairoint.h
index 95b5e0fa..2a6681d0 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1545,21 +1545,18 @@ _cairo_path_fixed_approximate_extents (cairo_path_fixed_t *path,
cairo_private void
_cairo_path_fixed_approximate_fill_extents (cairo_path_fixed_t *path,
- double tolerance,
cairo_rectangle_int_t *extents);
cairo_private void
_cairo_path_fixed_approximate_stroke_extents (cairo_path_fixed_t *path,
cairo_stroke_style_t *style,
const cairo_matrix_t *ctm,
- double tolerance,
cairo_rectangle_int_t *extents);
cairo_private void
_cairo_path_fixed_bounds (cairo_path_fixed_t *path,
double *x1, double *y1,
- double *x2, double *y2,
- double tolerance);
+ double *x2, double *y2);
cairo_private void
_cairo_path_fixed_transform (cairo_path_fixed_t *path,