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>
This commit is contained in:
Chris Wilson 2011-11-21 16:57:42 +00:00
parent adb5eb6f69
commit 56746110fe

View file

@ -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;