[perf] Benchmark glyph painting
diff --git a/perf/benchmark-font.cc b/perf/benchmark-font.cc
index 244e06a..67e0517 100644
--- a/perf/benchmark-font.cc
+++ b/perf/benchmark-font.cc
@@ -42,6 +42,7 @@
glyph_h_advances,
glyph_extents,
draw_glyph,
+ paint_glyph,
load_face_and_shape,
};
@@ -192,6 +193,17 @@
hb_draw_funcs_destroy (draw_funcs);
break;
}
+ case paint_glyph:
+ {
+ hb_paint_funcs_t *paint_funcs = hb_paint_funcs_create ();
+ for (auto _ : state)
+ {
+ for (unsigned gid = 0; gid < num_glyphs; ++gid)
+ hb_font_paint_glyph (font, gid, paint_funcs, nullptr, 0, 0);
+ }
+ hb_paint_funcs_destroy (paint_funcs);
+ break;
+ }
case load_face_and_shape:
{
for (auto _ : state)
@@ -294,6 +306,7 @@
TEST_OPERATION (glyph_h_advances, benchmark::kMicrosecond);
TEST_OPERATION (glyph_extents, benchmark::kMicrosecond);
TEST_OPERATION (draw_glyph, benchmark::kMicrosecond);
+ TEST_OPERATION (paint_glyph, benchmark::kMillisecond);
TEST_OPERATION (load_face_and_shape, benchmark::kMicrosecond);
#undef TEST_OPERATION