perf/micro: Show megapixel fill rate during paint.

This commit is contained in:
Chris Wilson 2010-03-31 09:33:30 +01:00
parent 8f7078eba7
commit fe610d559c
2 changed files with 15 additions and 2 deletions

View file

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

View file

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