summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GDEF/GDEF.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GDEF/GDEF.hh')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GDEF/GDEF.hh24
1 files changed, 24 insertions, 0 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GDEF/GDEF.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GDEF/GDEF.hh
index 0551fcf812a..c1ff7961996 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GDEF/GDEF.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GDEF/GDEF.hh
@@ -32,6 +32,7 @@
#include "../../../hb-ot-layout-common.hh"
#include "../../../hb-font.hh"
+#include "../../../hb-cache.hh"
namespace OT {
@@ -861,7 +862,30 @@ struct GDEF
}
~accelerator_t () { table.destroy (); }
+ unsigned int get_glyph_props (hb_codepoint_t glyph) const
+ {
+ unsigned v;
+
+#ifndef HB_NO_GDEF_CACHE
+ if (glyph_props_cache.get (glyph, &v))
+ return v;
+#endif
+
+ v = table->get_glyph_props (glyph);
+
+#ifndef HB_NO_GDEF_CACHE
+ if (likely (table.get_blob ())) // Don't try setting if we are the null instance!
+ glyph_props_cache.set (glyph, v);
+#endif
+
+ return v;
+
+ }
+
hb_blob_ptr_t<GDEF> table;
+#ifndef HB_NO_GDEF_CACHE
+ mutable hb_cache_t<21, 3, 8> glyph_props_cache;
+#endif
};
void collect_variation_indices (hb_collect_variation_indices_context_t *c) const