[subset] Simplify VarStore serialization

This commit is contained in:
Behdad Esfahbod 2021-07-28 17:33:26 -06:00
parent ad4c692492
commit 1c511ed6f6
1 changed files with 5 additions and 4 deletions

View File

@ -2560,7 +2560,10 @@ struct VarData
{ return shortCount + regionIndices.len; }
unsigned int get_size () const
{ return itemCount * get_row_size (); }
{ return min_size
- regionIndices.min_size + regionIndices.get_size ()
+ itemCount * get_row_size ();
}
float get_delta (unsigned int inner,
const int *coords, unsigned int coord_count,
@ -2665,9 +2668,7 @@ struct VarData
shortCount = new_short_count;
regionIndices.len = new_ri_count;
unsigned int size = regionIndices.get_size () - HBUINT16::static_size/*regionIndices.len*/ + (get_row_size () * itemCount);
if (unlikely (!c->allocate_size<HBUINT8> (size)))
return_trace (false);
if (unlikely (!c->extend (this))) return_trace (false);
for (r = 0; r < ri_count; r++)
if (delta_sz[r]) regionIndices[ri_map[r]] = region_map[src->regionIndices[r]];