mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Cache GlyphIds for allocation instead of full info
This commit is contained in:
@@ -82,7 +82,7 @@ pub struct FontImpl {
|
|||||||
tweak: FontTweak,
|
tweak: FontTweak,
|
||||||
glyph_info_cache: ahash::HashMap<char, GlyphInfo>,
|
glyph_info_cache: ahash::HashMap<char, GlyphInfo>,
|
||||||
glyph_alloc_cache:
|
glyph_alloc_cache:
|
||||||
ahash::HashMap<(GlyphInfo, OrderedFloat<f32>, OrderedFloat<f32>), GlyphAllocation>,
|
ahash::HashMap<(ab_glyph::GlyphId, OrderedFloat<f32>, OrderedFloat<f32>), GlyphAllocation>,
|
||||||
}
|
}
|
||||||
|
|
||||||
trait FontExt {
|
trait FontExt {
|
||||||
@@ -263,7 +263,7 @@ impl FontImpl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let entry = match self.glyph_alloc_cache.entry((
|
let entry = match self.glyph_alloc_cache.entry((
|
||||||
glyph_info,
|
glyph_id,
|
||||||
metrics.px_scale_factor.into(),
|
metrics.px_scale_factor.into(),
|
||||||
metrics.pixels_per_point.into(),
|
metrics.pixels_per_point.into(),
|
||||||
)) {
|
)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user