summaryrefslogtreecommitdiff
path: root/src/cairo-polygon-intersect.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-21 16:57:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-21 16:57:42 +0000
commit56746110fe0a83979ceb51f7b186b2b74f7ff974 (patch)
tree98127b90036cdc4c3d4a3b011454800e81c527f1 /src/cairo-polygon-intersect.c
parentadb5eb6f69db3fa26abb7cfe64cad84f82eb96bb (diff)
downloadcairo-56746110fe0a83979ceb51f7b186b2b74f7ff974.tar.gz
polygon-intersection: Finish any edges upon intersection
In order to keep the bookkeeping in order, and so prevent a later assert, we need to clear any edges when swapping the active edge order upon an intersection event. The active edges are then reconstructed. Fixes evince http://www.horizonhobby.com/pdf/BLH3500-Manual_EN.pdf Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-polygon-intersect.c')
-rw-r--r--src/cairo-polygon-intersect.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cairo-polygon-intersect.c b/src/cairo-polygon-intersect.c
index 92becd07d..573f801a7 100644
--- a/src/cairo-polygon-intersect.c
+++ b/src/cairo-polygon-intersect.c
@@ -1172,6 +1172,8 @@ edges_start_or_continue (cairo_bo_edge_t *left,
int top,
cairo_polygon_t *polygon)
{
+ assert (right->deferred.other == NULL);
+
if (left->deferred.other == right)
return;
@@ -1233,13 +1235,11 @@ active_edges (cairo_bo_edge_t *left,
}
right = right->next;
- } while (right);
+ } while (1);
edges_start_or_continue (left, right, top, polygon);
- left = right;
- if (left != NULL)
- left = left->next;
+ left = right->next;
}
}
@@ -1324,6 +1324,11 @@ intersection_sweep (cairo_bo_event_t **start_events,
if (e2 != e1->next)
break;
+ if (e1->deferred.other)
+ edges_end (e1, sweep_line.current_y, polygon);
+ if (e2->deferred.other)
+ edges_end (e2, sweep_line.current_y, polygon);
+
left = e1->prev;
right = e2->next;