diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-15 10:13:40 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-15 10:13:40 +0100 |
commit | ffbf6158be101553cd88eb3ad5dbcebac00a3774 (patch) | |
tree | 7056aad84fcc5d30c75581ed3a9475dcd5947879 /perf | |
parent | 9ab9d635cd54b36c701bed29b6029b002e9bcc36 (diff) |
perf: Add an a1-pixel variant
Just to measure the overhead and differences when switching between
antialiasing paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'perf')
-rw-r--r-- | perf/cairo-perf-micro.c | 1 | ||||
-rw-r--r-- | perf/cairo-perf.h | 1 | ||||
-rw-r--r-- | perf/micro/pixel.c | 22 |
3 files changed, 24 insertions, 0 deletions
diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c index bbcf5c9c4..61ed55fc3 100644 --- a/perf/cairo-perf-micro.c +++ b/perf/cairo-perf-micro.c @@ -545,6 +545,7 @@ main (int argc, #define FUNC(f) f, f##_enabled const cairo_perf_case_t perf_cases[] = { { FUNC(pixel), 1, 1 }, + { FUNC(a1_pixel), 1, 1 }, { FUNC(paint), 64, 512}, { FUNC(paint_with_alpha), 64, 512}, { FUNC(fill), 64, 512}, diff --git a/perf/cairo-perf.h b/perf/cairo-perf.h index b5e1d9696..feab74be3 100644 --- a/perf/cairo-perf.h +++ b/perf/cairo-perf.h @@ -225,6 +225,7 @@ CAIRO_PERF_DECL (a1_curve); CAIRO_PERF_DECL (line); CAIRO_PERF_DECL (a1_line); CAIRO_PERF_DECL (pixel); +CAIRO_PERF_DECL (a1_pixel); CAIRO_PERF_DECL (sierpinski); CAIRO_PERF_DECL (fill_clip); CAIRO_PERF_DECL (tiger); diff --git a/perf/micro/pixel.c b/perf/micro/pixel.c index dd3ba526e..b600b5170 100644 --- a/perf/micro/pixel.c +++ b/perf/micro/pixel.c @@ -213,3 +213,25 @@ pixel (cairo_perf_t *perf, cairo_t *cr, int width, int height) cairo_perf_run (perf, "pixel-circle", pixel_circle, NULL); cairo_perf_run (perf, "pixel-stroke", pixel_stroke, NULL); } + +cairo_bool_t +a1_pixel_enabled (cairo_perf_t *perf) +{ + return cairo_perf_can_run (perf, "a1-pixel", NULL); +} + +void +a1_pixel (cairo_perf_t *perf, cairo_t *cr, int width, int height) +{ + cairo_set_source_rgb (cr, 1., 1., 1.); + cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); + + cairo_perf_run (perf, "a1-pixel-direct", pixel_direct, NULL); + cairo_perf_run (perf, "a1-pixel-paint", pixel_paint, NULL); + cairo_perf_run (perf, "a1-pixel-mask", pixel_mask, NULL); + cairo_perf_run (perf, "a1-pixel-rectangle", pixel_rectangle, NULL); + cairo_perf_run (perf, "a1-pixel-subrectangle", pixel_subrectangle, NULL); + cairo_perf_run (perf, "a1-pixel-triangle", pixel_triangle, NULL); + cairo_perf_run (perf, "a1-pixel-circle", pixel_circle, NULL); + cairo_perf_run (perf, "a1-pixel-stroke", pixel_stroke, NULL); +} |