mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-19 03:34:03 +00:00
[Composites] Pre-alloc phantom-points space
This commit is contained in:
parent
0c7cb57539
commit
f90e3fc3f4
2 changed files with 2 additions and 0 deletions
|
@ -108,6 +108,7 @@ struct CompositeGlyphRecord
|
|||
float matrix[4];
|
||||
contour_point_t trans;
|
||||
get_transformation (matrix, trans);
|
||||
points.alloc (points.length + 4); // For phantom points
|
||||
if (unlikely (!points.resize (points.length + 1))) return false;
|
||||
points[points.length - 1] = trans;
|
||||
return true;
|
||||
|
|
|
@ -196,6 +196,7 @@ struct VarCompositeGlyphRecord
|
|||
{
|
||||
unsigned num_points = get_num_points ();
|
||||
|
||||
points.alloc (points.length + num_points + 4); // For phantom points
|
||||
if (unlikely (!points.resize (points.length + num_points, false))) return false;
|
||||
contour_point_t *rec_points = points.as_array ().sub_array (points.length - num_points).arrayZ;
|
||||
memset (rec_points, 0, num_points * sizeof (rec_points[0]));
|
||||
|
|
Loading…
Add table
Reference in a new issue