From 6cf69d10e710cfa7282509c2a43e12618d4673bc Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 2 May 2022 16:07:32 -0600 Subject: [PATCH] [perf/benchmark-font] Add back testing of is_variable --- perf/benchmark-font.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/perf/benchmark-font.cc b/perf/benchmark-font.cc index 117ec8dd3..cf071edc3 100644 --- a/perf/benchmark-font.cc +++ b/perf/benchmark-font.cc @@ -21,10 +21,7 @@ struct test_input_t { {SUBSET_FONT_BASE_PATH "SourceSansPro-Regular.otf"}, {SUBSET_FONT_BASE_PATH "AdobeVFPrototype.otf"}, - {SUBSET_FONT_BASE_PATH "AdobeVFPrototype.otf"}, {SUBSET_FONT_BASE_PATH "SourceSerifVariable-Roman.ttf"}, - {SUBSET_FONT_BASE_PATH "SourceSerifVariable-Roman.ttf"}, - {SUBSET_FONT_BASE_PATH "Comfortaa-Regular-new.ttf"}, {SUBSET_FONT_BASE_PATH "Comfortaa-Regular-new.ttf"}, {SUBSET_FONT_BASE_PATH "Roboto-Regular.ttf"}, }; @@ -147,6 +144,7 @@ static void BM_Font (benchmark::State &state, static void test_backend (backend_t backend, const char *backend_name, + bool variable, operation_t op, const char *op_name, benchmark::TimeUnit time_unit, @@ -154,11 +152,12 @@ static void test_backend (backend_t backend, { char name[1024] = "BM_Font/"; strcat (name, op_name); + strcat (name, strrchr (test_input.font_path, '/')); strcat (name, "/"); strcat (name, backend_name); - strcat (name, strrchr (test_input.font_path, '/')); + strcat (name, variable ? "/var" : ""); - benchmark::RegisterBenchmark (name, BM_Font, false, backend, op, test_input) + benchmark::RegisterBenchmark (name, BM_Font, variable, backend, op, test_input) ->Unit(time_unit); } @@ -168,10 +167,15 @@ static void test_operation (operation_t op, { for (auto& test_input : tests) { - test_backend (HARFBUZZ, "hb", op, op_name, time_unit, test_input); + for (int variable = 0; variable < 2; variable++) + { + bool is_var = (bool) variable; + + test_backend (HARFBUZZ, "hb", is_var, op, op_name, time_unit, test_input); #ifdef HAVE_FREETYPE - test_backend (FREETYPE, "ft", op, op_name, time_unit, test_input); + test_backend (FREETYPE, "ft", is_var, op, op_name, time_unit, test_input); #endif + } } }