Use Vec
instead of SmallVec
for glyphs
field of ShapedRun
(#30664)
This glyphs field is usually larger than 8 elements, and SmallVec is not efficient when it cannot store the value inline. This change also adds precise glyphs run preallocation in some places `ShapedRun` is constructed. Release Notes: - N/A
This commit is contained in:
parent
a4766e296f
commit
25cc05b45c
5 changed files with 6 additions and 7 deletions
|
@ -595,7 +595,7 @@ impl PlatformTextSystem for NoopTextSystem {
|
|||
.unwrap()
|
||||
.width
|
||||
/ metrics.units_per_em as f32;
|
||||
let mut glyphs = SmallVec::default();
|
||||
let mut glyphs = Vec::new();
|
||||
for (ix, c) in text.char_indices() {
|
||||
if let Some(glyph) = self.glyph_for_char(FontId(0), c) {
|
||||
glyphs.push(ShapedGlyph {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue