提交 a0fe3011 编写于 作者: R Rod Sheeter

copy all cmap groups at once

上级 d008b628
...@@ -272,17 +272,12 @@ struct CmapSubtableLongSegmented ...@@ -272,17 +272,12 @@ struct CmapSubtableLongSegmented
} }
inline bool serialize(hb_serialize_context_t *context, inline bool serialize(hb_serialize_context_t *context,
unsigned int group_count, hb_prealloced_array_t<CmapSubtableLongGroup> &group_data)
Supplier<CmapSubtableLongGroup> &group_supplier)
{ {
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
if (unlikely(!context->extend_min (*this))) return_trace (false); if (unlikely(!context->extend_min (*this))) return_trace (false);
if (unlikely(!groups.serialize(context, group_count))) return_trace (false); if (unlikely(!groups.serialize(context, group_data.len))) return_trace (false);
for (unsigned int i = 0; i < group_count; i++) memcpy(&groups[0], &group_data[0], group_data.len * sizeof(CmapSubtableLongGroup));
{
const CmapSubtableLongGroup &group = group_supplier[i];
memcpy(&groups[i], &group, sizeof(group));
}
return true; return true;
} }
...@@ -594,8 +589,7 @@ struct cmap ...@@ -594,8 +589,7 @@ struct cmap
format12.reservedZ.set(0); format12.reservedZ.set(0);
format12.lengthZ.set(16 + 12 * groups.len); format12.lengthZ.set(16 + 12 * groups.len);
OT::Supplier<CmapSubtableLongGroup> group_supplier (&groups[0], groups.len, sizeof (CmapSubtableLongGroup)); if (unlikely(!format12.serialize(&context, groups)))
if (unlikely(!format12.serialize(&context, groups.len, group_supplier)))
{ {
return false; return false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册