summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-01-12 17:00:25 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-01-12 17:07:30 +0000
commit74ea4c908067f5579b51d3dbaea387da8f343671 (patch)
tree446c908643e34fde4673f7a2ffddf870d99a7b82 /src/cairo-path-fixed.c
parenta5dd5a6069c0d7435260a954d8d98483f5fbcc1c (diff)
path: Do not remove anti-parallel line segments in case we are stroking
Bug 26010 - cairo_line_to optimizes away path segments http://bugs.freedesktop.org/show_bug.cgi?id=26010 As exercised by path-stroke-twice, we incorrectly optimise away a line segment if the path doubled back upon itself. This is very reminiscent of the optimisation bug for replacing curve-to with line-to.
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r--src/cairo-path-fixed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 42172c674..34de6a37b 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -480,7 +480,10 @@ _cairo_path_fixed_line_to (cairo_path_fixed_t *path,
_cairo_slope_init (&prev, p, &path->current_point);
_cairo_slope_init (&self, &path->current_point, &point);
- if (_cairo_slope_equal (&prev, &self)) {
+ if (_cairo_slope_equal (&prev, &self) &&
+ /* cannot trim anti-parallel segments whilst stroking */
+ ! _cairo_slope_backwards (&prev, &self))
+ {
buf->points[buf->num_points - 1] = point;
goto FLAGS;
}