summaryrefslogtreecommitdiff
path: root/src/cairo-traps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-08-25 20:51:06 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-29 08:08:29 +0100
commit4051ed328b618e28cf1df276899eefa225225c76 (patch)
tree7e988ac283c4404326f806b13e6baf0ea7df7dc9 /src/cairo-traps.c
parent82ccb4c70cbf28167c280e590017b221a406b5c3 (diff)
downloadcairo-4051ed328b618e28cf1df276899eefa225225c76.tar.gz
[tessellator] Special case rectilinear tessellation
For the frequent cases where we know in advance that we are dealing with a rectilinear path, but can not use the simple region code, implement a variant of the Bentley-Ottmann tessellator. The advantages here are that edge comparison is very simple (we only have vertical edges) and there are no intersection, though possible overlaps. The idea is the same, maintain a y-x sorted queue of start/stop events that demarcate traps and sweep through the active edges at each event, looking for completed traps. The motivation for this was noticing a performance regression in box-fill-outline with the self-intersection work: 1.9.2 to HEAD^: 3.66x slowdown HEAD^ to HEAD: 5.38x speedup 1.9.2 to HEAD: 1.57x speedup The cause of which was choosing to use spans instead of the region handling code, as the complex polygon was no longer being tessellated.
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r--src/cairo-traps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index 5f04ce160..a5974cc23 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -51,6 +51,7 @@ _cairo_traps_init (cairo_traps_t *traps)
traps->status = CAIRO_STATUS_SUCCESS;
traps->maybe_region = 1;
+ traps->is_rectilinear = 0;
traps->num_traps = 0;
@@ -76,6 +77,7 @@ _cairo_traps_clear (cairo_traps_t *traps)
traps->status = CAIRO_STATUS_SUCCESS;
traps->maybe_region = 1;
+ traps->is_rectilinear = 0;
traps->num_traps = 0;
traps->has_intersections = FALSE;