[subset] Add serialize_serialize to OffsetTo.
Similar to serialize_subset() this will serialize the new object and then link it to the offset.
This commit is contained in:
parent
2b0ced28b6
commit
35458b6b66
|
@ -355,6 +355,23 @@ struct OffsetTo : Offset<OffsetType, has_null>
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <typename ...Ts>
|
||||||
|
bool serialize_serialize (hb_serialize_context_t *c, Ts&&... ds)
|
||||||
|
{
|
||||||
|
*this = 0;
|
||||||
|
|
||||||
|
Type* obj = c->push<Type> ();
|
||||||
|
bool ret = obj->serialize (c, hb_forward<Ts> (ds)...);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
c->add_link (*this, c->pop_pack ());
|
||||||
|
else
|
||||||
|
c->pop_discard ();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: Somehow merge this with previous function into a serialize_dispatch(). */
|
/* TODO: Somehow merge this with previous function into a serialize_dispatch(). */
|
||||||
/* Workaround clang bug: https://bugs.llvm.org/show_bug.cgi?id=23029
|
/* Workaround clang bug: https://bugs.llvm.org/show_bug.cgi?id=23029
|
||||||
* Can't compile: whence = hb_serialize_context_t::Head followed by Ts&&...
|
* Can't compile: whence = hb_serialize_context_t::Head followed by Ts&&...
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct SingleSubstFormat1
|
||||||
{
|
{
|
||||||
TRACE_SERIALIZE (this);
|
TRACE_SERIALIZE (this);
|
||||||
if (unlikely (!c->extend_min (*this))) return_trace (false);
|
if (unlikely (!c->extend_min (*this))) return_trace (false);
|
||||||
if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs))) return_trace (false);
|
if (unlikely (!coverage.serialize_serialize (c, glyphs))) return_trace (false);
|
||||||
c->check_assign (deltaGlyphID, delta, HB_SERIALIZE_ERROR_INT_OVERFLOW);
|
c->check_assign (deltaGlyphID, delta, HB_SERIALIZE_ERROR_INT_OVERFLOW);
|
||||||
return_trace (true);
|
return_trace (true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue