From 7eac779abf14243124af2c6e89cff71e18e41cb3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Jun 2022 16:02:27 -0600 Subject: [PATCH] Revert "Revert "[glyf] Optimize shape loading"" This reverts commit 164bd288cfe66f1742183ab38fa9bd121b1cd8a0. --- 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; }