From b3765e7c401cd3dd982fbbef026dc18e0aead3b1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 19 Jul 2025 07:13:41 -0600 Subject: [PATCH] [benchmark-font] Call the plural glyph-v-origins API Ouch! --- perf/benchmark-font.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/perf/benchmark-font.cc b/perf/benchmark-font.cc index 8858b6b20..b6a07d3b6 100644 --- a/perf/benchmark-font.cc +++ b/perf/benchmark-font.cc @@ -33,7 +33,7 @@ enum operation_t nominal_glyphs, glyph_h_advances, glyph_v_advances, - glyph_v_origin, + glyph_v_origins, glyph_extents, draw_glyph, paint_glyph, @@ -183,7 +183,7 @@ static void BM_Font (benchmark::State &state, free (glyphs); break; } - case glyph_v_origin: + case glyph_v_origins: { hb_codepoint_t *glyphs = (hb_codepoint_t *) calloc (num_glyphs, sizeof (hb_codepoint_t)); hb_position_t *origins_x = (hb_position_t *) calloc (num_glyphs, sizeof (hb_codepoint_t)); @@ -193,10 +193,11 @@ static void BM_Font (benchmark::State &state, glyphs[g] = g; for (auto _ : state) - for (unsigned g = 0; g < num_glyphs; g++) - hb_font_get_glyph_v_origin (font, - glyphs[g], - &origins_x[g], &origins_y[g]); + hb_font_get_glyph_v_origins (font, + num_glyphs, + glyphs, sizeof (*glyphs), + origins_x, sizeof (*origins_x), + origins_y, sizeof (*origins_y)); free (origins_y); free (origins_x); @@ -339,7 +340,7 @@ int main(int argc, char** argv) TEST_OPERATION (nominal_glyphs, benchmark::kMicrosecond); TEST_OPERATION (glyph_h_advances, benchmark::kMicrosecond); TEST_OPERATION (glyph_v_advances, benchmark::kMicrosecond); - TEST_OPERATION (glyph_v_origin, benchmark::kMicrosecond); + TEST_OPERATION (glyph_v_origins, benchmark::kMicrosecond); TEST_OPERATION (glyph_extents, benchmark::kMicrosecond); TEST_OPERATION (draw_glyph, benchmark::kMillisecond); TEST_OPERATION (paint_glyph, benchmark::kMillisecond);