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>
This commit is contained in:
Chris Wilson 2011-09-15 10:13:40 +01:00
parent 9ab9d635cd
commit ffbf6158be
3 changed files with 24 additions and 0 deletions

View file

@ -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},

View file

@ -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);

View file

@ -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);
}