From f0819301b74871c4c0a58e16918d3f8df2c6f74d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Jun 2022 15:52:54 -0600 Subject: [PATCH] [glyf] Optimize shape loading Do away with a copy for simple glyph load. --- src/OT/glyf/Glyph.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 2bb7984f7..1dd2338a9 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -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; }