[serialize] Switch to tetris-packing

This commit is contained in:
Behdad Esfahbod 2019-04-01 21:36:13 -07:00
parent f0ea3ac17b
commit bfa02bef45
1 changed files with 11 additions and 4 deletions

View File

@ -282,15 +282,22 @@ struct OffsetTo : Offset<OffsetType, has_null>
template <typename T> template <typename T>
void serialize_subset (hb_subset_context_t *c, const T &src, const void *base) void serialize_subset (hb_subset_context_t *c, const T &src, const void *base)
{
if (&src == &Null (T))
{ {
*this = 0; *this = 0;
if (&src == &Null (T))
return;
//serialize (c->serializer, base);
c->serializer->push ();
if (!src.subset (c))
{
c->serializer->pop_discard ();
return; return;
} }
serialize (c->serializer, base); c->serializer->add_link (*this,
if (!src.subset (c)) c->serializer->pop_pack (),
*this = 0; base);
} }
bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const