diff options
author | Andrea Canciani <ranma42@gmail.com> | 2010-10-16 23:08:03 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2010-10-29 17:31:21 +0200 |
commit | 14cc9846b302a990e65d7572e7f095a8873a213d (patch) | |
tree | b2edb6f4e82653325a4320839b5957fceae751e9 | |
parent | ac7b2a972097f4080ab6e5a29974c830b8b57a4f (diff) |
path: Replace _cairo_path_fixed_is_equal with _cairo_path_fixed_equal
Remove _cairo_path_fixed_is_equal and use _cairo_path_fixed_equal
instead.
The latter function can recognize that two paths are equal even if the
drawing commands have been partitioned in a different way in the buf
list.
-rw-r--r-- | src/cairo-path-fixed.c | 35 | ||||
-rw-r--r-- | src/cairo-recording-surface.c | 4 | ||||
-rw-r--r-- | src/cairoint.h | 4 |
3 files changed, 2 insertions, 41 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index eea8630b..b6495e1d 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -1044,41 +1044,6 @@ _cairo_path_fixed_transform (cairo_path_fixed_t *path, } cairo_path_foreach_buf_end (buf, path); } -cairo_bool_t -_cairo_path_fixed_is_equal (const cairo_path_fixed_t *path, - const cairo_path_fixed_t *other) -{ - const cairo_path_buf_t *path_buf, *other_buf; - - if (path->current_point.x != other->current_point.x || - path->current_point.y != other->current_point.y || - path->has_current_point != other->has_current_point || - path->has_curve_to != other->has_curve_to || - path->is_rectilinear != other->is_rectilinear || - path->maybe_fill_region != other->maybe_fill_region || - path->last_move_point.x != other->last_move_point.x || - path->last_move_point.y != other->last_move_point.y) - { - return FALSE; - } - - other_buf = cairo_path_head (other); - cairo_path_foreach_buf_start (path_buf, path) { - if (path_buf->num_ops != other_buf->num_ops || - path_buf->num_points != other_buf->num_points || - memcmp (path_buf->op, other_buf->op, - sizeof (cairo_path_op_t) * path_buf->num_ops) != 0 || - memcmp (path_buf->points, other_buf->points, - sizeof (cairo_point_t) * path_buf->num_points) != 0) - { - return FALSE; - } - other_buf = cairo_path_buf_next (other_buf); - } cairo_path_foreach_buf_end (path_buf, path); - - return TRUE; -} - /* Closure for path flattening */ typedef struct cairo_path_flattener { double tolerance; diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c index 79d51e8c..0ac938b6 100644 --- a/src/cairo-recording-surface.c +++ b/src/cairo-recording-surface.c @@ -898,8 +898,8 @@ _cairo_recording_surface_replay_internal (cairo_surface_t *surface, if (stroke_command != NULL && stroke_command->header.type == CAIRO_COMMAND_STROKE && - _cairo_path_fixed_is_equal (&command->fill.path, - &stroke_command->stroke.path)) + _cairo_path_fixed_equal (&command->fill.path, + &stroke_command->stroke.path)) { status = _cairo_surface_wrapper_fill_stroke (&wrapper, command->header.op, diff --git a/src/cairoint.h b/src/cairoint.h index 346fc51f..a0d988c8 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -1130,10 +1130,6 @@ cairo_private cairo_status_t _cairo_path_fixed_init_copy (cairo_path_fixed_t *path, const cairo_path_fixed_t *other); -cairo_private cairo_bool_t -_cairo_path_fixed_is_equal (const cairo_path_fixed_t *path, - const cairo_path_fixed_t *other); - cairo_private void _cairo_path_fixed_fini (cairo_path_fixed_t *path); |