summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-30 22:09:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-31 09:43:12 +0100
commit877ed645f95ff048f7c5d2ce0fb92389918711a6 (patch)
tree07fd9ea354eb85f1b571febde8144c51d7683c4e /perf
parent3dbc4170f0e89f02455b82c6496d6322e56e0491 (diff)
[perf] Add a more complex fill, a set of rings
In investigating performance regressions with the wip/tessellator, I'm keen to inspect how the tessellator scales with polygon complexity.
Diffstat (limited to 'perf')
-rw-r--r--perf/fill.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/perf/fill.c b/perf/fill.c
index f068561a..0bad3cd9 100644
--- a/perf/fill.c
+++ b/perf/fill.c
@@ -43,6 +43,42 @@ do_fill (cairo_t *cr, int width, int height)
}
static cairo_perf_ticks_t
+do_fill_annuli (cairo_t *cr, int width, int height)
+{
+ cairo_new_sub_path (cr);
+ cairo_arc (cr,
+ width/2.0, height/2.0,
+ width/3.0,
+ 0, 2 * M_PI);
+
+ cairo_new_sub_path (cr);
+ cairo_arc_negative (cr,
+ width/2.0, height/2.0,
+ width/4.0,
+ 2 * M_PI, 0);
+
+ cairo_new_sub_path (cr);
+ cairo_arc (cr,
+ width/2.0, height/2.0,
+ width/6.0,
+ 0, 2 * M_PI);
+
+ cairo_new_sub_path (cr);
+ cairo_arc_negative (cr,
+ width/2.0, height/2.0,
+ width/8.0,
+ 2 * M_PI, 0);
+
+ cairo_perf_timer_start ();
+
+ cairo_fill (cr);
+
+ cairo_perf_timer_stop ();
+
+ return cairo_perf_timer_elapsed ();
+}
+
+static cairo_perf_ticks_t
do_fill_eo_noaa (cairo_t *cr, int width, int height)
{
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
@@ -69,5 +105,6 @@ fill (cairo_perf_t *perf, cairo_t *cr, int width, int height)
return;
cairo_perf_cover_sources_and_operators (perf, "fill", do_fill);
+ cairo_perf_cover_sources_and_operators (perf, "fill-annuli", do_fill_annuli);
cairo_perf_cover_sources_and_operators (perf, "fill-eo-noaa", do_fill_eo_noaa);
}