diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-31 09:33:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-02 08:51:03 +0100 |
commit | fe610d559c70ab67f782b122437908ac80788611 (patch) | |
tree | be0b47dce9f9657db4f8f0ad6416ef8f1b39f9b6 /perf | |
parent | 8f7078eba71dcd2aa70bf97c03ed7b4341260143 (diff) |
perf/micro: Show megapixel fill rate during paint.
Diffstat (limited to 'perf')
-rw-r--r-- | perf/micro/paint-with-alpha.c | 9 | ||||
-rw-r--r-- | perf/micro/paint.c | 8 |
2 files changed, 15 insertions, 2 deletions
diff --git a/perf/micro/paint-with-alpha.c b/perf/micro/paint-with-alpha.c index 048cdb01..051d653d 100644 --- a/perf/micro/paint-with-alpha.c +++ b/perf/micro/paint-with-alpha.c @@ -38,6 +38,12 @@ do_paint_with_alpha (cairo_t *cr, int width, int height, int loops) return cairo_perf_timer_elapsed (); } +static double +count_paint_with_alpha (cairo_t *cr, int width, int height) +{ + return width * height / 1e6; /* Mpix/s */ +} + void paint_with_alpha (cairo_perf_t *perf, cairo_t *cr, int width, int height) { @@ -45,5 +51,6 @@ paint_with_alpha (cairo_perf_t *perf, cairo_t *cr, int width, int height) return; cairo_perf_cover_sources_and_operators (perf, "paint-with-alpha", - do_paint_with_alpha, NULL); + do_paint_with_alpha, + count_paint_with_alpha); } diff --git a/perf/micro/paint.c b/perf/micro/paint.c index ce8cfd37..1ba108fb 100644 --- a/perf/micro/paint.c +++ b/perf/micro/paint.c @@ -38,11 +38,17 @@ do_paint (cairo_t *cr, int width, int height, int loops) return cairo_perf_timer_elapsed (); } +static double +count_paint (cairo_t *cr, int width, int height) +{ + return width * height / 1e6; /* Mpix/s */ +} + void paint (cairo_perf_t *perf, cairo_t *cr, int width, int height) { if (! cairo_perf_can_run (perf, "paint", NULL)) return; - cairo_perf_cover_sources_and_operators (perf, "paint", do_paint, NULL); + cairo_perf_cover_sources_and_operators (perf, "paint", do_paint, count_paint); } |