From bde5e3959c0ffdb92db87668035b01aaee9b2352 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 10 Sep 2016 02:43:20 -0700 Subject: [PATCH] Move add_lookups from map to map-builder In prep for more changes. --- src/hb-ot-map-private.hh | 15 ++++++++------- src/hb-ot-map.cc | 29 +++++++++++++++-------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index 8692caa..fc5ce66 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -139,12 +139,6 @@ struct hb_ot_map_t private: - HB_INTERNAL void add_lookups (hb_face_t *face, - unsigned int table_index, - unsigned int feature_index, - hb_mask_t mask, - bool auto_zwj); - hb_mask_t global_mask; hb_prealloced_array_t features; @@ -182,7 +176,7 @@ struct hb_ot_map_builder_t inline void add_gpos_pause (hb_ot_map_t::pause_func_t pause_func) { add_pause (1, pause_func); } - HB_INTERNAL void compile (struct hb_ot_map_t &m); + HB_INTERNAL void compile (hb_ot_map_t &m); inline void finish (void) { feature_infos.finish (); @@ -194,6 +188,13 @@ struct hb_ot_map_builder_t private: + HB_INTERNAL void add_lookups (hb_ot_map_t &m, + hb_face_t *face, + unsigned int table_index, + unsigned int feature_index, + hb_mask_t mask, + bool auto_zwj); + struct feature_info_t { hb_tag_t tag; unsigned int seq; /* sequence#, used for stable sorting only */ diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index 17e3f40..a45c2f9 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -32,11 +32,12 @@ void -hb_ot_map_t::add_lookups (hb_face_t *face, - unsigned int table_index, - unsigned int feature_index, - hb_mask_t mask, - bool auto_zwj) +hb_ot_map_builder_t::add_lookups (hb_ot_map_t &m, + hb_face_t *face, + unsigned int table_index, + unsigned int feature_index, + hb_mask_t mask, + bool auto_zwj) { unsigned int lookup_indices[32]; unsigned int offset, len; @@ -57,7 +58,7 @@ hb_ot_map_t::add_lookups (hb_face_t *face, { if (lookup_indices[i] >= table_lookup_count) continue; - hb_ot_map_t::lookup_map_t *lookup = lookups[table_index].push (); + hb_ot_map_t::lookup_map_t *lookup = m.lookups[table_index].push (); if (unlikely (!lookup)) return; lookup->mask = mask; @@ -268,17 +269,17 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m) { if (required_feature_index[table_index] != HB_OT_LAYOUT_NO_FEATURE_INDEX && required_feature_stage[table_index] == stage) - m.add_lookups (face, table_index, - required_feature_index[table_index], - 1 /* mask */, - true /* auto_zwj */); + add_lookups (m, face, table_index, + required_feature_index[table_index], + 1 /* mask */, + true /* auto_zwj */); for (unsigned i = 0; i < m.features.len; i++) if (m.features[i].stage[table_index] == stage) - m.add_lookups (face, table_index, - m.features[i].index[table_index], - m.features[i].mask, - m.features[i].auto_zwj); + add_lookups (m, face, table_index, + m.features[i].index[table_index], + m.features[i].mask, + m.features[i].auto_zwj); /* Sort lookups and merge duplicates */ if (last_num_lookups < m.lookups[table_index].len) -- 2.7.4