summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-31 22:29:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-01 12:08:55 +0100
commitfec80f11990adbb4c1220d444186ed600082956d (patch)
tree130e150b717326e2e462af42d46acac9712fa057 /perf
parent4a8f638c9a7772e9e8eaa7246b892eedb1d784d9 (diff)
perf: Add a few more variations to dragon to exercise unaligned lines/spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'perf')
-rw-r--r--perf/micro/dragon.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/perf/micro/dragon.c b/perf/micro/dragon.c
index 29057e90..4b16f38d 100644
--- a/perf/micro/dragon.c
+++ b/perf/micro/dragon.c
@@ -203,6 +203,13 @@ do_dragon_solid (cairo_t *cr, int width, int height, int loops)
}
static cairo_perf_ticks_t
+do_dragon_solid_unaligned (cairo_t *cr, int width, int height, int loops)
+{
+ cairo_translate (cr, 0.01, 0.01);
+ return do_dragon_solid (cr, width, height, loops);
+}
+
+static cairo_perf_ticks_t
do_dragon_solid_aligned_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_reset_clip (cr);
@@ -214,6 +221,18 @@ do_dragon_solid_aligned_clip (cairo_t *cr, int width, int height, int loops)
}
static cairo_perf_ticks_t
+do_dragon_unaligned_solid_aligned_clip (cairo_t *cr, int width, int height, int loops)
+{
+ cairo_translate (cr, 0.01, 0.01);
+ cairo_reset_clip (cr);
+ cairo_rectangle (cr, 10, 10, width/2 + 10, height/2 + 10);
+ cairo_rectangle (cr, width/2-20, height/2-20, width/2 + 10, height/2 + 10);
+ cairo_clip (cr);
+
+ return do_dragon_solid (cr, width, height, loops);
+}
+
+static cairo_perf_ticks_t
do_dragon_solid_unaligned_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_reset_clip (cr);
@@ -225,6 +244,18 @@ do_dragon_solid_unaligned_clip (cairo_t *cr, int width, int height, int loops)
}
static cairo_perf_ticks_t
+do_dragon_unaligned_solid_unaligned_clip (cairo_t *cr, int width, int height, int loops)
+{
+ cairo_translate (cr, 0.01, 0.01);
+ cairo_reset_clip (cr);
+ cairo_rectangle (cr, 10.5, 10.5, width/2 + 10, height/2 + 10);
+ cairo_rectangle (cr, width/2-20, height/2-20, width/2 + 9.5, height/2 + 9.5);
+ cairo_clip (cr);
+
+ return do_dragon_solid (cr, width, height, loops);
+}
+
+static cairo_perf_ticks_t
do_dragon_solid_circle_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_reset_clip (cr);
@@ -241,8 +272,11 @@ dragon (cairo_perf_t *perf, cairo_t *cr, int width, int height)
return;
cairo_perf_run (perf, "dragon-solid", do_dragon_solid, NULL);
+ cairo_perf_run (perf, "dragon-unaligned-solid", do_dragon_solid_unaligned, NULL);
cairo_perf_run (perf, "dragon-solid-aligned-clip", do_dragon_solid_aligned_clip, NULL);
+ cairo_perf_run (perf, "dragon-unaligned-solid-aligned-clip", do_dragon_unaligned_solid_aligned_clip, NULL);
cairo_perf_run (perf, "dragon-solid-unaligned-clip", do_dragon_solid_unaligned_clip, NULL);
+ cairo_perf_run (perf, "dragon-unaligned-solid-unaligned-clip", do_dragon_unaligned_solid_unaligned_clip, NULL);
cairo_perf_run (perf, "dragon-solid-circle-clip", do_dragon_solid_circle_clip, NULL);
cairo_perf_run (perf, "dragon", do_dragon, NULL);
}