diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index 1f7e1673d..f9faf3cca 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -33,15 +33,14 @@ int cairo_perf_alarm_expired = 0; typedef struct _cairo_perf { const char *name; - cairo_perf_func_t setup; cairo_perf_func_t run; unsigned int min_size; unsigned int max_size; } cairo_perf_t; cairo_perf_t perfs[] = { - { "paint", paint_setup, paint, 32, 1024 }, - { "paint_alpha", paint_alpha_setup, paint, 32, 1024 }, + { "paint", paint, 32, 1024 }, + { "paint_alpha", paint_alpha, 32, 1024 }, { NULL } }; @@ -105,7 +104,6 @@ main (int argc, char *argv[]) size, size, &target->closure); cr = cairo_create (surface); - perf->setup (cr, size, size); perf->run (cr, size, size); } } diff --git a/perf/cairo-perf.h b/perf/cairo-perf.h index 5c06d325f..6300de0f4 100644 --- a/perf/cairo-perf.h +++ b/perf/cairo-perf.h @@ -68,8 +68,7 @@ typedef void (*cairo_perf_func_t) (cairo_t *cr, int width, int height); #define CAIRO_PERF_DECL(func) void func (cairo_t *cr, int width, int height) -CAIRO_PERF_DECL (paint_setup); -CAIRO_PERF_DECL (paint_alpha_setup); CAIRO_PERF_DECL (paint); +CAIRO_PERF_DECL (paint_alpha); #endif diff --git a/perf/paint.c b/perf/paint.c index d077c0491..3a0cd1168 100644 --- a/perf/paint.c +++ b/perf/paint.c @@ -25,20 +25,8 @@ #include "cairo-perf.h" -void -paint_setup (cairo_t *cr, int width, int height) -{ - cairo_set_source_rgba (cr, 1.0, 0.2, 0.6, 0.5); -} - -void -paint_alpha_setup (cairo_t *cr, int width, int height) -{ - cairo_set_source_rgb (cr, 0.2, 0.6, 0.9); -} - -void -paint (cairo_t *cr, int width, int height) +static void +do_paint (cairo_t *cr) { cairo_perf_timer_t timer; @@ -50,3 +38,20 @@ paint (cairo_t *cr, int width, int height) printf ("Rate: %g\n", CAIRO_PERF_LOOP_RATE (timer)); } + +void +paint (cairo_t *cr, int width, int height) +{ + cairo_set_source_rgb (cr, 0.2, 0.6, 0.9); + + do_paint (cr); +} + +void +paint_alpha (cairo_t *cr, int width, int height) +{ + cairo_set_source_rgb (cr, 0.2, 0.6, 0.9); + + do_paint (cr); +} +