[HB] Remove apply_subtables() again
This commit is contained in:
parent
d468f9af5b
commit
923923feb2
|
@ -1132,7 +1132,7 @@ struct PosLookupSubTable
|
||||||
Extension = 9,
|
Extension = 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
|
bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
|
||||||
{
|
{
|
||||||
switch (lookup_type) {
|
switch (lookup_type) {
|
||||||
case Single: return u.single->apply (APPLY_ARG);
|
case Single: return u.single->apply (APPLY_ARG);
|
||||||
|
@ -1192,14 +1192,17 @@ struct PosLookup : Lookup
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool apply_subtables (hb_ot_layout_t *layout,
|
inline bool apply_once (hb_ot_layout_t *layout,
|
||||||
hb_buffer_t *buffer,
|
hb_buffer_t *buffer,
|
||||||
unsigned int context_length,
|
unsigned int context_length,
|
||||||
unsigned int nesting_level_left,
|
unsigned int nesting_level_left) const
|
||||||
unsigned int property) const
|
|
||||||
{
|
{
|
||||||
unsigned int lookup_type = get_type ();
|
unsigned int lookup_type = get_type ();
|
||||||
unsigned int lookup_flag = get_flag ();
|
unsigned int lookup_flag = get_flag ();
|
||||||
|
unsigned int property;
|
||||||
|
|
||||||
|
if (!_hb_ot_layout_check_glyph_property (layout, IN_CURITEM (), lookup_flag, &property))
|
||||||
|
return false;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < get_subtable_count (); i++)
|
for (unsigned int i = 0; i < get_subtable_count (); i++)
|
||||||
if (get_subtable (i).apply (APPLY_ARG, lookup_type))
|
if (get_subtable (i).apply (APPLY_ARG, lookup_type))
|
||||||
|
@ -1208,17 +1211,6 @@ struct PosLookup : Lookup
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool apply_once (hb_ot_layout_t *layout, hb_buffer_t *buffer) const
|
|
||||||
{
|
|
||||||
unsigned int lookup_flag = get_flag ();
|
|
||||||
|
|
||||||
unsigned int property;
|
|
||||||
if (!_hb_ot_layout_check_glyph_property (layout, IN_CURITEM (), lookup_flag, &property))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return apply_subtables (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL, property);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool apply_string (hb_ot_layout_t *layout,
|
bool apply_string (hb_ot_layout_t *layout,
|
||||||
hb_buffer_t *buffer,
|
hb_buffer_t *buffer,
|
||||||
hb_ot_layout_feature_mask_t mask) const
|
hb_ot_layout_feature_mask_t mask) const
|
||||||
|
@ -1236,7 +1228,7 @@ struct PosLookup : Lookup
|
||||||
bool done;
|
bool done;
|
||||||
if (~IN_PROPERTIES (buffer->in_pos) & mask)
|
if (~IN_PROPERTIES (buffer->in_pos) & mask)
|
||||||
{
|
{
|
||||||
done = apply_once (layout, buffer);
|
done = apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL);
|
||||||
ret |= done;
|
ret |= done;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1309,8 +1301,7 @@ static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
|
||||||
if (HB_UNLIKELY (context_length < 1))
|
if (HB_UNLIKELY (context_length < 1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* XXX This should be apply_one I guess */
|
return l.apply_once (layout, buffer, context_length, nesting_level_left);
|
||||||
return l.apply_subtables (layout, buffer, context_length, nesting_level_left, property);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -590,7 +590,7 @@ struct SubstLookupSubTable
|
||||||
ReverseChainSingle = 8,
|
ReverseChainSingle = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
|
bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
|
||||||
{
|
{
|
||||||
switch (lookup_type) {
|
switch (lookup_type) {
|
||||||
case Single: return u.single->apply (APPLY_ARG);
|
case Single: return u.single->apply (APPLY_ARG);
|
||||||
|
@ -653,14 +653,17 @@ struct SubstLookup : Lookup
|
||||||
return HB_UNLIKELY (get_effective_type () == SubstLookupSubTable::ReverseChainSingle);
|
return HB_UNLIKELY (get_effective_type () == SubstLookupSubTable::ReverseChainSingle);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool apply_subtables (hb_ot_layout_t *layout,
|
inline bool apply_once (hb_ot_layout_t *layout,
|
||||||
hb_buffer_t *buffer,
|
hb_buffer_t *buffer,
|
||||||
unsigned int context_length,
|
unsigned int context_length,
|
||||||
unsigned int nesting_level_left,
|
unsigned int nesting_level_left) const
|
||||||
unsigned int property) const
|
|
||||||
{
|
{
|
||||||
unsigned int lookup_type = get_type ();
|
unsigned int lookup_type = get_type ();
|
||||||
unsigned int lookup_flag = get_flag ();
|
unsigned int lookup_flag = get_flag ();
|
||||||
|
unsigned int property;
|
||||||
|
|
||||||
|
if (!_hb_ot_layout_check_glyph_property (layout, IN_CURITEM (), lookup_flag, &property))
|
||||||
|
return false;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < get_subtable_count (); i++)
|
for (unsigned int i = 0; i < get_subtable_count (); i++)
|
||||||
if (get_subtable (i).apply (APPLY_ARG, lookup_type))
|
if (get_subtable (i).apply (APPLY_ARG, lookup_type))
|
||||||
|
@ -669,17 +672,6 @@ struct SubstLookup : Lookup
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool apply_once (hb_ot_layout_t *layout, hb_buffer_t *buffer) const
|
|
||||||
{
|
|
||||||
unsigned int lookup_flag = get_flag ();
|
|
||||||
|
|
||||||
unsigned int property;
|
|
||||||
if (!_hb_ot_layout_check_glyph_property (layout, IN_CURITEM (), lookup_flag, &property))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return apply_subtables (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL, property);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool apply_string (hb_ot_layout_t *layout,
|
bool apply_string (hb_ot_layout_t *layout,
|
||||||
hb_buffer_t *buffer,
|
hb_buffer_t *buffer,
|
||||||
hb_ot_layout_feature_mask_t mask) const
|
hb_ot_layout_feature_mask_t mask) const
|
||||||
|
@ -697,7 +689,7 @@ struct SubstLookup : Lookup
|
||||||
while (buffer->in_pos < buffer->in_length)
|
while (buffer->in_pos < buffer->in_length)
|
||||||
{
|
{
|
||||||
if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
|
if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
|
||||||
apply_once (layout, buffer))
|
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
_hb_buffer_next_glyph (buffer);
|
_hb_buffer_next_glyph (buffer);
|
||||||
|
@ -715,7 +707,7 @@ struct SubstLookup : Lookup
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
|
if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
|
||||||
apply_once (layout, buffer))
|
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
buffer->in_pos--;
|
buffer->in_pos--;
|
||||||
|
@ -782,8 +774,7 @@ static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
|
||||||
if (HB_UNLIKELY (context_length < 1))
|
if (HB_UNLIKELY (context_length < 1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* XXX This should be apply_one I guess */
|
return l.apply_once (layout, buffer, context_length, nesting_level_left);
|
||||||
return l.apply_subtables (layout, buffer, context_length, nesting_level_left, property);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue