summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-08-13 23:23:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-26 23:51:42 +0100
commit54b2935c3842e77888faef06bbf247f99bd9de8c (patch)
tree748806be23acc520429fa3c3dcccac5d95e92d54 /perf
parentfddfe4973f5b49f280734ee7141ab72451cf94d2 (diff)
[perf] Reset the path after each spiral
Oops we were accumulating paths during each spiral iteration and so the tests were getting slower and slower and slower... [And fix a couple of other instances of path accumulation.]
Diffstat (limited to 'perf')
-rw-r--r--perf/intersections.c2
-rw-r--r--perf/spiral.c1
-rw-r--r--perf/world-map.c2
3 files changed, 5 insertions, 0 deletions
diff --git a/perf/intersections.c b/perf/intersections.c
index 7a7cc550..1a00b1d1 100644
--- a/perf/intersections.c
+++ b/perf/intersections.c
@@ -61,6 +61,7 @@ draw_random (cairo_t *cr, cairo_fill_rule_t fill_rule,
cairo_set_fill_rule (cr, fill_rule);
cairo_set_source_rgb (cr, 1, 0, 0);
+ cairo_new_path (cr);
cairo_move_to (cr, 0, 0);
for (i = 0; i < NUM_SEGMENTS; i++)
cairo_line_to (cr, x[i], y[i]);
@@ -98,6 +99,7 @@ draw_random_curve (cairo_t *cr, cairo_fill_rule_t fill_rule,
cairo_set_fill_rule (cr, fill_rule);
cairo_set_source_rgb (cr, 1, 0, 0);
+ cairo_new_path (cr);
cairo_move_to (cr, 0, 0);
for (i = 0; i < NUM_SEGMENTS; i++) {
cairo_curve_to (cr,
diff --git a/perf/spiral.c b/perf/spiral.c
index 2a4e568a..bd81c7e6 100644
--- a/perf/spiral.c
+++ b/perf/spiral.c
@@ -89,6 +89,7 @@ draw_spiral (cairo_t *cr,
cairo_set_fill_rule (cr, fill_rule);
cairo_set_source_rgb (cr, 1, 0, 0);
+ cairo_new_path (cr);
cairo_move_to (cr, x[0], y[0]);
for (i = 1; i < n; i++) {
cairo_line_to (cr, x[i], y[i]);
diff --git a/perf/world-map.c b/perf/world-map.c
index 265c8e31..d9a267dc 100644
--- a/perf/world-map.c
+++ b/perf/world-map.c
@@ -97,6 +97,8 @@ do_world_map (cairo_t *cr, int width, int height, int loops)
break;
e++;
}
+
+ cairo_new_path (cr);
}
cairo_perf_timer_stop ();