mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
[Composites] Pre-alloc phantom-points space
This commit is contained in:
1 parent
0c7cb57539
commit
f90e3fc3f4
2 files changed
+2
No files matched your search
@@ -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]));
|
||||
|
||||
Reference in new issue
Block a user