diff options
author | Emmanuel Pacaud <emmanuel.pacaud@free.fr> | 2007-08-25 20:49:50 +0200 |
---|---|---|
committer | Emmanuel Pacaud <emmanuel.pacaud@free.fr> | 2007-08-25 20:49:50 +0200 |
commit | ac51fff0db73c5917a38af3f610d4751b8fec626 (patch) | |
tree | 5d3c9da300f9dc4f2b1d731169779b23d68a449c /src/cairo-path-fixed.c | |
parent | 43d35e01106659ac689846a8d5875d235b0d3c9f (diff) |
Add a new fill_stroke surface backend method.
This method is for use in vector backends, where fill immediatly followed by
stroke command with the same path can be emited in the same backend command.
This commit also factorize the detection of such cases in the meta surface
backend and automatically call the fill_stroke method on replay.
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r-- | src/cairo-path-fixed.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index 86c771ee..7c8f34bd 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -550,3 +550,30 @@ _cairo_path_fixed_device_transform (cairo_path_fixed_t *path, _cairo_fixed_from_double (device_transform->xx), _cairo_fixed_from_double (device_transform->yy)); } + +cairo_bool_t +_cairo_path_fixed_is_equal (cairo_path_fixed_t *path, + cairo_path_fixed_t *other) +{ + 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->last_move_point.x != other->last_move_point.x || + path->last_move_point.y != other->last_move_point.y) + return FALSE; + + other_buf = other->buf_head; + for (path_buf = path->buf_head; path_buf != NULL; path_buf = path_buf->next) { + if (other_buf == NULL || + path_buf->num_ops != other_buf->num_ops || + path_buf->num_points != other_buf->num_points || + memcmp (path_buf->op, other_buf->op, path_buf->num_ops) != 0 || + memcmp (path_buf->points, other_buf->points, path_buf->num_points != 0)) + return FALSE; + other_buf = other_buf->next; + } + return TRUE; +} |