[glyf] Optimize shape loading

Do away with a copy for simple glyph load.
This commit is contained in:
Behdad Esfahbod 2022-06-26 15:52:54 -06:00
parent ea5131507a
commit f0819301b7
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;
}