unsigned int index[2]; /* GSUB, GPOS */
unsigned int shift;
hb_mask_t mask;
+ hb_mask_t _1_mask; /* mask for value=1, for quick access */
static int cmp (const feature_map_t *a, const feature_map_t *b)
{ return a->tag < b->tag ? -1 : a->tag > b->tag ? 1 : 0; }
HB_INTERNAL void compile (hb_face_t *face,
const hb_segment_properties_t *props);
- hb_mask_t get_global_mask (void) const { return global_mask; }
+ inline hb_mask_t get_global_mask (void) const { return global_mask; }
- hb_mask_t get_mask (hb_tag_t tag, unsigned int *shift = NULL) const {
+ inline hb_mask_t get_mask (hb_tag_t tag, unsigned int *shift = NULL) const {
const feature_map_t *map = (const feature_map_t *) bsearch (&tag, feature_maps, feature_count, sizeof (feature_maps[0]), (hb_compare_func_t) feature_map_t::cmp);
if (shift) *shift = map ? map->shift : 0;
return map ? map->mask : 0;
}
+ inline hb_mask_t get_1_mask (hb_tag_t tag) const {
+ const feature_map_t *map = (const feature_map_t *) bsearch (&tag, feature_maps, feature_count, sizeof (feature_maps[0]), (hb_compare_func_t) feature_map_t::cmp);
+ return map ? map->_1_mask : 0;
+ }
+
inline void substitute (hb_face_t *face, hb_buffer_t *buffer) const {
for (unsigned int i = 0; i < lookup_count[0]; i++)
hb_ot_layout_substitute_lookup (face, buffer, lookup_maps[0][i].index, lookup_maps[0][i].mask);
hb_mask_t mask_array[TOTAL_NUM_FEATURES + 1] = {0};
unsigned int num_masks = c->buffer->props.script == HB_SCRIPT_SYRIAC ? SYRIAC_NUM_FEATURES : COMMON_NUM_FEATURES;
for (unsigned int i = 0; i < num_masks; i++)
- mask_array[i] = c->plan->map.get_mask (arabic_syriac_features[i]);
+ mask_array[i] = c->plan->map.get_1_mask (arabic_syriac_features[i]);
for (unsigned int i = 0; i < count; i++)
c->buffer->info[i].mask |= mask_array[c->buffer->info[i].gproperty];
if (HB_DIRECTION_IS_FORWARD (c->buffer->props.direction))
return;
- hb_mask_t rtlm_mask = c->plan->map.get_mask (HB_TAG ('r','t','l','m'));
+ hb_mask_t rtlm_mask = c->plan->map.get_1_mask (HB_TAG ('r','t','l','m'));
unsigned int count = c->buffer->len;
for (unsigned int i = 0; i < count; i++) {