提交 4c4e8f0e 编写于 作者: B Behdad Esfahbod

[OTLayout] Reuse apply context for recursion

上级 53a69f49
......@@ -1537,8 +1537,13 @@ inline bool PosLookup::apply_recurse_func (hb_apply_context_t *c, unsigned int l
{
const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos);
const PosLookup &l = gpos.get_lookup (lookup_index);
unsigned int saved_lookup_props = c->lookup_props;
unsigned int saved_property = c->property;
c->set_lookup (l);
return l.apply_once (c);
bool ret = l.apply_once (c);
c->lookup_props = saved_lookup_props;
c->property = saved_property;
return ret;
}
......
......@@ -1402,8 +1402,13 @@ inline bool SubstLookup::apply_recurse_func (hb_apply_context_t *c, unsigned int
{
const GSUB &gsub = *(hb_ot_layout_from_face (c->face)->gsub);
const SubstLookup &l = gsub.get_lookup (lookup_index);
unsigned int saved_lookup_props = c->lookup_props;
unsigned int saved_property = c->property;
c->set_lookup (l);
return l.apply_once (c);
bool ret = l.apply_once (c);
c->lookup_props = saved_lookup_props;
c->property = saved_property;
return ret;
}
......
......@@ -233,10 +233,10 @@ struct hb_apply_context_t
if (unlikely (nesting_level_left == 0 || !recurse_func))
return default_return_value ();
/* TODO Reuse context. */
hb_apply_context_t new_c (*this);
new_c.nesting_level_left--;
return recurse_func (&new_c, lookup_index);
nesting_level_left--;
recurse_func (this, lookup_index);
nesting_level_left++;
return default_return_value ();
}
hb_font_t *font;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册