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:
@@ -16,7 +16,7 @@ use pathfinder_geometry::{
|
||||
rect::{RectF, RectI},
|
||||
vector::{Vector2F, Vector2I},
|
||||
};
|
||||
use smallvec::{SmallVec, smallvec};
|
||||
use smallvec::SmallVec;
|
||||
use std::{borrow::Cow, sync::Arc};
|
||||
|
||||
pub(crate) struct CosmicTextSystem(RwLock<CosmicTextSystemState>);
|
||||
@@ -443,7 +443,7 @@ impl CosmicTextSystemState {
|
||||
} else {
|
||||
runs.push(ShapedRun {
|
||||
font_id,
|
||||
glyphs: smallvec![shaped_glyph],
|
||||
glyphs: vec![shaped_glyph],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user