[name] Clean up serialize() API

This commit is contained in:
Behdad Esfahbod 2019-05-07 13:29:01 -07:00
parent 59ee61fddc
commit f982b9d9f8

View File

@ -170,8 +170,8 @@ struct name
{ return min_size + count * nameRecordZ.item_size; } { return min_size + count * nameRecordZ.item_size; }
bool serialize (hb_serialize_context_t *c, bool serialize (hb_serialize_context_t *c,
const name *source_name, const name *source_name,
const hb_subset_plan_t *plan) const hb_set_t *name_ids)
{ {
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
@ -181,7 +181,7 @@ struct name
auto it = auto it =
+ src_array + src_array
| hb_filter (plan->name_ids, &NameRecord::nameID) | hb_filter (name_ids, &NameRecord::nameID)
; ;
this->format = 0; this->format = 0;
@ -214,7 +214,7 @@ struct name
hb_serialize_context_t *serializer = c->serializer; hb_serialize_context_t *serializer = c->serializer;
name *name_prime = serializer->start_embed<name> (); name *name_prime = serializer->start_embed<name> ();
if (unlikely (!name_prime)) return_trace (false); if (unlikely (!name_prime)) return_trace (false);
name_prime->serialize (serializer, this, plan); name_prime->serialize (serializer, this, plan->name_ids);
return_trace (name_prime->count); return_trace (name_prime->count);
} }