diff options
author | Carl Worth <cworth@cworth.org> | 2006-12-19 21:34:16 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2006-12-22 17:59:20 -0800 |
commit | ba531642f79d492ecbad8f086f1e44b56e157e36 (patch) | |
tree | ff4ff528262e06116606b59e7dc213ee2f3b6eb9 /src/cairo-path-fixed.c | |
parent | b1189118532a1fe93e126843af739809d38a62bd (diff) |
Add optimization for rectilinear stroke
This custom stroking code allows backends to use optimized region-based
drawing operations for rectilinear strokes. This results in a 5-25x
performance improvement when drawing rectilinear shapes:
image-rgb box-outline-stroke-100 0.18 -> 0.01: 25.58x speedup
████████████████████████▋
image-rgba box-outline-stroke-100 0.18 -> 0.01: 25.57x speedup
████████████████████████▋
xlib-rgb box-outline-stroke-100 0.49 -> 0.06: 8.67x speedup
███████▋
xlib-rgba box-outline-stroke-100 0.22 -> 0.04: 5.39x speedup
████▍
In other words, using cairo_stroke instead of cairo_fill to draw the
same shape was 5-15x slower before, but is 1.2-2x faster now.
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r-- | src/cairo-path-fixed.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index 9549f8d3..71d646b8 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -88,6 +88,7 @@ _cairo_path_fixed_init (cairo_path_fixed_t *path) path->current_point.x = 0; path->current_point.y = 0; path->has_current_point = FALSE; + path->has_curve_to = FALSE; path->last_move_point = path->current_point; } @@ -101,6 +102,7 @@ _cairo_path_fixed_init_copy (cairo_path_fixed_t *path, _cairo_path_fixed_init (path); path->current_point = other->current_point; path->has_current_point = other->has_current_point; + path->has_curve_to = other->has_curve_to; path->last_move_point = other->last_move_point; for (other_op_buf = other->op_buf_head; @@ -164,6 +166,7 @@ _cairo_path_fixed_fini (cairo_path_fixed_t *path) path->arg_buf_tail = NULL; path->has_current_point = FALSE; + path->has_curve_to = FALSE; } void @@ -289,6 +292,7 @@ _cairo_path_fixed_curve_to (cairo_path_fixed_t *path, path->current_point = point[2]; path->has_current_point = TRUE; + path->has_curve_to = TRUE; return CAIRO_STATUS_SUCCESS; } |