[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.
This commit is contained in:
Chris Wilson 2008-12-29 12:45:13 +00:00
parent 84b81388be
commit 0100856226
5 changed files with 9 additions and 21 deletions

View file

@ -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);

View file

@ -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,

View file

@ -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,

View file

@ -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;

View file

@ -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,