[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);
}
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,
Iterator items)
{

View File

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