From ffbf6158be101553cd88eb3ad5dbcebac00a3774 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 15 Sep 2011 10:13:40 +0100 Subject: perf: Add an a1-pixel variant Just to measure the overhead and differences when switching between antialiasing paths. Signed-off-by: Chris Wilson --- perf/cairo-perf-micro.c | 1 + perf/cairo-perf.h | 1 + perf/micro/pixel.c | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+) (limited to 'perf') diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c index bbcf5c9c..61ed55fc 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 b5e1d969..feab74be 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 dd3ba526..b600b517 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); +} -- cgit v1.2.3