summaryrefslogtreecommitdiff
path: root/src/cairo-bentley-ottmann.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-bentley-ottmann.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-bentley-ottmann.c')
-rw-r--r--src/cairo-bentley-ottmann.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c
index 3d3a3d60b..99f4655d7 100644
--- a/src/cairo-bentley-ottmann.c
+++ b/src/cairo-bentley-ottmann.c
@@ -2002,7 +2002,8 @@ _compute_clipped_trapezoid_edges (const cairo_traps_t *traps,
}
cairo_status_t
-_cairo_bentley_ottmann_tessellate_traps (cairo_traps_t *traps)
+_cairo_bentley_ottmann_tessellate_traps (cairo_traps_t *traps,
+ cairo_fill_rule_t fill_rule)
{
int intersections;
cairo_status_t status;
@@ -2054,7 +2055,7 @@ _cairo_bentley_ottmann_tessellate_traps (cairo_traps_t *traps)
_cairo_traps_clear (traps);
status = _cairo_bentley_ottmann_tessellate_bo_edges (event_ptrs,
num_events,
- CAIRO_FILL_RULE_WINDING,
+ fill_rule,
traps,
&intersections);