[iter] Port Coverage::serialize to hb_is_iterator

This commit is contained in:
Behdad Esfahbod 2018-12-30 18:45:50 -05:00
parent 06a44e2e53
commit 851fbb23ea
2 changed files with 13 additions and 7 deletions

View File

@ -553,7 +553,7 @@ struct ArrayOf
return_trace (true); return_trace (true);
} }
template <typename Iterator> template <typename Iterator>
hb_enable_if_t (hb_is_iterator (Iterator, Type), hb_enable_if_t (hb_is_iterator (Iterator, Type),
bool) serialize (hb_serialize_context_t *c, bool) serialize (hb_serialize_context_t *c,
Iterator items) Iterator items)
{ {

View File

@ -826,8 +826,10 @@ struct CoverageFormat1
return i; return i;
} }
bool serialize (hb_serialize_context_t *c, template <typename Iterator>
hb_array_t<const GlyphID> glyphs) hb_enable_if_t (hb_is_iterator (Iterator, const GlyphID),
bool) serialize (hb_serialize_context_t *c,
Iterator glyphs)
{ {
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
return_trace (glyphArray.serialize (c, glyphs)); return_trace (glyphArray.serialize (c, glyphs));
@ -893,8 +895,10 @@ struct CoverageFormat2
NOT_COVERED; NOT_COVERED;
} }
bool serialize (hb_serialize_context_t *c, template <typename Iterator>
hb_array_t<const GlyphID> glyphs) hb_enable_if_t (hb_is_iterator (Iterator, const GlyphID),
bool) serialize (hb_serialize_context_t *c,
Iterator glyphs)
{ {
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (*this))) return_trace (false); if (unlikely (!c->extend_min (*this))) return_trace (false);
@ -1040,8 +1044,10 @@ struct Coverage
} }
} }
bool serialize (hb_serialize_context_t *c, template <typename Iterator>
hb_array_t<const GlyphID> glyphs) hb_enable_if_t (hb_is_iterator (Iterator, const GlyphID),
bool) serialize (hb_serialize_context_t *c,
Iterator glyphs)
{ {
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (*this))) return_trace (false); if (unlikely (!c->extend_min (*this))) return_trace (false);