Revert "Revert "[glyf] Optimize shape loading""

This reverts commit 164bd288cf.
This commit is contained in:
Behdad Esfahbod 2022-06-26 16:02:27 -06:00
parent 164bd288cf
commit 7eac779abf
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ struct Glyph
break;
}
case SIMPLE:
if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, phantom_only)))
/* Load into all_points if it's empty, as an optimization. */
if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (all_points.length == 0 ? all_points : points, phantom_only)))
return false;
break;
}