diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-02-23 08:54:58 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-02-23 08:54:58 +0000 |
commit | 6ab5f89571b0252496d58242ed3060a9486d68d4 (patch) | |
tree | f8e9b5e2ebe309387d646b87675b68190cdf781c | |
parent | 1897156d96d77ff28f585794c1eb1baffa105488 (diff) |
bo-rectangular: Fix incorrect skipping of colinear eo edges
Fixes test/bug-bo-rectangular
After skipping edges, we need to bd careful to only terminate the box on
a closing edge.
-rw-r--r-- | src/cairo-bentley-ottmann-rectangular.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c index 736762e0..2cb01cb0 100644 --- a/src/cairo-bentley-ottmann-rectangular.c +++ b/src/cairo-bentley-ottmann-rectangular.c @@ -422,9 +422,6 @@ active_edges_to_traps (sweep_line_t *sweep, winding += right->dir; if (winding == 0) { - if (right->next == &sweep->tail) - break; - /* skip co-linear edges */ if (likely (right->x != right->next->x)) break; @@ -440,30 +437,31 @@ active_edges_to_traps (sweep_line_t *sweep, pos = right->next; } while (pos != &sweep->tail); } else { - edge_t *left, *right; do { - left = pos; - pos = left->next; - do { - right = pos; - pos = pos->next; + edge_t *right = pos->next; + int count = 0; - if (right->right != NULL) { + do { + /* End all subsumed traps */ + if (unlikely (right->right != NULL)) { edge_end_box (sweep, right, top, do_traps, container); } - if (pos == &sweep->tail) - break; + if (++count & 1) { + /* skip co-linear edges */ + if (likely (right->x != right->next->x)) + break; + } - /* skip co-linear edges */ - if (right->x != pos->x) - break; + right = right->next; } while (TRUE); edge_start_or_continue_box (sweep, - left, right, top, + pos, right, top, do_traps, container); + + pos = right->next; } while (pos != &sweep->tail); } @@ -717,7 +715,6 @@ _cairo_bentley_ottmann_tessellate_rectangular_traps (cairo_traps_t *traps, dump_traps (traps, "bo-rects-traps-out.txt"); - return status; } |