From: Behdad Esfahbod Date: Thu, 14 Feb 2013 16:05:56 +0000 (-0500) Subject: Clean-up add_bool_feature X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7ffcfafb1108801ac504f18f820e497226bf07f;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Clean-up add_bool_feature --- diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index b140207..344e914 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -155,8 +155,8 @@ struct hb_ot_map_builder_t HB_INTERNAL void add_feature (hb_tag_t tag, unsigned int value, bool global, bool has_fallback = false); - inline void add_bool_feature (hb_tag_t tag, bool global = true, bool has_fallback = false) - { add_feature (tag, 1, global, has_fallback); } + inline void add_global_bool_feature (hb_tag_t tag) + { add_feature (tag, 1, true, false); } inline void add_gsub_pause (hb_ot_map_t::pause_func_t pause_func) { add_pause (0, pause_func); } diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 3374cfc..2c23da5 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -178,25 +178,25 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) * TODO: Add test cases for these two. */ - map->add_bool_feature (HB_TAG('c','c','m','p')); - map->add_bool_feature (HB_TAG('l','o','c','l')); + map->add_global_bool_feature (HB_TAG('c','c','m','p')); + map->add_global_bool_feature (HB_TAG('l','o','c','l')); map->add_gsub_pause (NULL); for (unsigned int i = 0; i < ARABIC_NUM_FEATURES; i++) - map->add_bool_feature (arabic_features[i], false, i < 4); /* The first four features have fallback. */ + map->add_feature (arabic_features[i], 1, false, i < 4); /* The first four features have fallback. */ map->add_gsub_pause (NULL); - map->add_bool_feature (HB_TAG('r','l','i','g'), true, true); + map->add_feature (HB_TAG('r','l','i','g'), 1, true, true); map->add_gsub_pause (arabic_fallback_shape); - map->add_bool_feature (HB_TAG('c','a','l','t')); + map->add_global_bool_feature (HB_TAG('c','a','l','t')); map->add_gsub_pause (NULL); - map->add_bool_feature (HB_TAG('c','s','w','h')); - map->add_bool_feature (HB_TAG('d','l','i','g')); - map->add_bool_feature (HB_TAG('m','s','e','t')); + map->add_global_bool_feature (HB_TAG('c','s','w','h')); + map->add_global_bool_feature (HB_TAG('d','l','i','g')); + map->add_global_bool_feature (HB_TAG('m','s','e','t')); } #include "hb-ot-shape-complex-arabic-fallback.hh" diff --git a/src/hb-ot-shape-complex-default.cc b/src/hb-ot-shape-complex-default.cc index d406f8c..fad57f6 100644 --- a/src/hb-ot-shape-complex-default.cc +++ b/src/hb-ot-shape-complex-default.cc @@ -68,7 +68,7 @@ collect_features_default (hb_ot_shape_planner_t *plan) } for (; script_features && *script_features; script_features++) - plan->map.add_bool_feature (*script_features); + plan->map.add_global_bool_feature (*script_features); } static hb_ot_shape_normalization_mode_t diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 4491daa..bf82615 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -419,21 +419,21 @@ collect_features_indic (hb_ot_shape_planner_t *plan) /* Do this before any lookups have been applied. */ map->add_gsub_pause (setup_syllables); - map->add_bool_feature (HB_TAG('l','o','c','l')); + map->add_global_bool_feature (HB_TAG('l','o','c','l')); /* The Indic specs do not require ccmp, but we apply it here since if * there is a use of it, it's typically at the beginning. */ - map->add_bool_feature (HB_TAG('c','c','m','p')); + map->add_global_bool_feature (HB_TAG('c','c','m','p')); unsigned int i = 0; map->add_gsub_pause (initial_reordering); for (; i < INDIC_BASIC_FEATURES; i++) { - map->add_bool_feature (indic_features[i].tag, indic_features[i].is_global); + map->add_feature (indic_features[i].tag, 1, indic_features[i].is_global); map->add_gsub_pause (NULL); } map->add_gsub_pause (final_reordering); for (; i < INDIC_NUM_FEATURES; i++) { - map->add_bool_feature (indic_features[i].tag, indic_features[i].is_global); + map->add_feature (indic_features[i].tag, 1, indic_features[i].is_global); } } diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc index a115064..3f63770 100644 --- a/src/hb-ot-shape-complex-myanmar.cc +++ b/src/hb-ot-shape-complex-myanmar.cc @@ -98,21 +98,21 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan) /* Do this before any lookups have been applied. */ map->add_gsub_pause (setup_syllables); - map->add_bool_feature (HB_TAG('l','o','c','l')); + map->add_global_bool_feature (HB_TAG('l','o','c','l')); /* The Indic specs do not require ccmp, but we apply it here since if * there is a use of it, it's typically at the beginning. */ - map->add_bool_feature (HB_TAG('c','c','m','p')); + map->add_global_bool_feature (HB_TAG('c','c','m','p')); unsigned int i = 0; map->add_gsub_pause (initial_reordering); for (; i < MYANMAR_BASIC_FEATURES; i++) { - map->add_bool_feature (myanmar_features[i]); + map->add_global_bool_feature (myanmar_features[i]); map->add_gsub_pause (NULL); } map->add_gsub_pause (final_reordering); for (; i < MYANMAR_NUM_FEATURES; i++) { - map->add_bool_feature (myanmar_features[i]); + map->add_global_bool_feature (myanmar_features[i]); } } diff --git a/src/hb-ot-shape-complex-sea.cc b/src/hb-ot-shape-complex-sea.cc index cfd0baa..c9bce6c 100644 --- a/src/hb-ot-shape-complex-sea.cc +++ b/src/hb-ot-shape-complex-sea.cc @@ -100,21 +100,21 @@ collect_features_sea (hb_ot_shape_planner_t *plan) /* Do this before any lookups have been applied. */ map->add_gsub_pause (setup_syllables); - map->add_bool_feature (HB_TAG('l','o','c','l')); + map->add_global_bool_feature (HB_TAG('l','o','c','l')); /* The Indic specs do not require ccmp, but we apply it here since if * there is a use of it, it's typically at the beginning. */ - map->add_bool_feature (HB_TAG('c','c','m','p')); + map->add_global_bool_feature (HB_TAG('c','c','m','p')); unsigned int i = 0; map->add_gsub_pause (initial_reordering); for (; i < SEA_BASIC_FEATURES; i++) { - map->add_bool_feature (sea_features[i]); + map->add_global_bool_feature (sea_features[i]); map->add_gsub_pause (NULL); } map->add_gsub_pause (final_reordering); for (; i < SEA_NUM_FEATURES; i++) { - map->add_bool_feature (sea_features[i]); + map->add_global_bool_feature (sea_features[i]); } } diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index d529223..2a1bfb7 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -83,12 +83,12 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, switch (props->direction) { case HB_DIRECTION_LTR: - map->add_bool_feature (HB_TAG ('l','t','r','a')); - map->add_bool_feature (HB_TAG ('l','t','r','m')); + map->add_global_bool_feature (HB_TAG ('l','t','r','a')); + map->add_global_bool_feature (HB_TAG ('l','t','r','m')); break; case HB_DIRECTION_RTL: - map->add_bool_feature (HB_TAG ('r','t','l','a')); - map->add_bool_feature (HB_TAG ('r','t','l','m'), false); + map->add_global_bool_feature (HB_TAG ('r','t','l','a')); + map->add_feature (HB_TAG ('r','t','l','m'), 1, false); break; case HB_DIRECTION_TTB: case HB_DIRECTION_BTT: @@ -100,7 +100,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, #define ADD_FEATURES(array) \ HB_STMT_START { \ for (unsigned int i = 0; i < ARRAY_LENGTH (array); i++) \ - map->add_bool_feature (array[i]); \ + map->add_global_bool_feature (array[i]); \ } HB_STMT_END if (planner->shaper->collect_features)