提交 c6fb843f 编写于 作者: B Behdad Esfahbod

[OTLayout] Templatize process_recurse_func

上级 9b34677f
......@@ -1354,6 +1354,8 @@ struct PosLookup : Lookup
}
return TRACE_RETURN (c->default_return_value ());
}
template <typename context_t>
static inline typename context_t::return_t process_recurse_func (context_t *c, unsigned int lookup_index);
template <typename set_t>
inline void add_coverage (set_t *glyphs) const
......@@ -1523,6 +1525,14 @@ GPOS::position_finish (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer, hb_bool_t
/* Out-of-class implementation for methods recursing */
template <typename context_t>
inline typename context_t::return_t PosLookup::process_recurse_func (context_t *c, unsigned int lookup_index)
{
const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos);
const PosLookup &l = gpos.get_lookup (lookup_index);
return l.process (c);
}
inline bool PosLookup::apply_recurse_func (hb_apply_context_t *c, unsigned int lookup_index)
{
const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos);
......
......@@ -1140,11 +1140,12 @@ struct SubstLookup : Lookup
}
return TRACE_RETURN (c->default_return_value ());
}
template <typename context_t>
static inline typename context_t::return_t process_recurse_func (context_t *c, unsigned int lookup_index);
static inline void_t closure_recurse_func (hb_closure_context_t *c, unsigned int lookup_index);
inline hb_closure_context_t::return_t closure (hb_closure_context_t *c) const
{
c->set_recurse_func (closure_recurse_func);
c->set_recurse_func (process_recurse_func<hb_closure_context_t>);
return process (c);
}
......@@ -1377,7 +1378,8 @@ inline bool ExtensionSubst::is_reverse (void) const
return SubstLookup::lookup_type_is_reverse (type);
}
inline void_t SubstLookup::closure_recurse_func (hb_closure_context_t *c, unsigned int lookup_index)
template <typename context_t>
inline typename context_t::return_t SubstLookup::process_recurse_func (context_t *c, unsigned int lookup_index)
{
const GSUB &gsub = *(hb_ot_layout_from_face (c->face)->gsub);
const SubstLookup &l = gsub.get_lookup (lookup_index);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册