From fed65c8bf8d6f5550eadf368ffa6845c2d61a50d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 19 Jul 2025 15:35:20 -0600 Subject: [PATCH] [ot-font] Mark a function hot --- src/hb-ot-font.cc | 1 + src/hb-ot-var-hvar-table.hh | 4 +++- src/hb-ot-vorg-table.hh | 1 + src/hb.hh | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index bfb7d9c27..15b772b1d 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -619,6 +619,7 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data, #endif #ifndef HB_NO_VERTICAL +HB_HOT static hb_bool_t hb_ot_get_glyph_v_origins (hb_font_t *font, void *font_data, diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh index 67797c581..d9437d832 100644 --- a/src/hb-ot-var-hvar-table.hh +++ b/src/hb-ot-var-hvar-table.hh @@ -384,6 +384,7 @@ struct HVARVVAR hvar_plan.index_map_plans.as_array ())); } + HB_ALWAYS_INLINE float get_advance_delta_unscaled (hb_codepoint_t glyph, const int *coords, unsigned int coord_count, hb_scalar_cache_t *store_cache = nullptr) const @@ -446,9 +447,10 @@ struct VVAR : HVARVVAR { bool subset (hb_subset_context_t *c) const { return HVARVVAR::_subset (c); } + HB_ALWAYS_INLINE float get_vorg_delta_unscaled (hb_codepoint_t glyph, const int *coords, unsigned int coord_count, - hb_scalar_cache_t *store_cache = nullptr) const + hb_scalar_cache_t *store_cache = nullptr) const { if (!vorgMap) return 0.f; uint32_t varidx = (this+vorgMap).map (glyph); diff --git a/src/hb-ot-vorg-table.hh b/src/hb-ot-vorg-table.hh index 95ae8ef55..1ba9ca269 100644 --- a/src/hb-ot-vorg-table.hh +++ b/src/hb-ot-vorg-table.hh @@ -61,6 +61,7 @@ struct VORG bool has_data () const { return version.to_int (); } + HB_ALWAYS_INLINE int get_y_origin (hb_codepoint_t glyph) const { unsigned int i; diff --git a/src/hb.hh b/src/hb.hh index ce8d075cd..47b710e67 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -314,6 +314,10 @@ #endif #endif +#ifndef HB_HOT +#define HB_HOT __attribute__((hot)) +#endif + /* * Borrowed from https://bugzilla.mozilla.org/show_bug.cgi?id=1215411 * HB_FALLTHROUGH is an annotation to suppress compiler warnings about switch