mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 10:18:02 +02:00
perf/micro: Show megapixel fill rate during paint.
This commit is contained in:
parent
8f7078eba7
commit
fe610d559c
2 changed files with 15 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue