1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Add Memory::caches for caching things from one frame to the next

This commit is contained in:
Emil Ernerfeldt
2021-10-06 17:44:51 +02:00
parent 613c0b29f6
commit a1bf5aff47
9 changed files with 239 additions and 38 deletions

View File

@@ -405,7 +405,7 @@ struct GalleyCache {
impl GalleyCache {
fn layout(&mut self, fonts: &Fonts, job: LayoutJob) -> Arc<Galley> {
let hash = crate::util::hash_with(&job, ahash::AHasher::new_with_keys(123, 456)); // TODO: even faster hasher?
let hash = crate::util::hash(&job); // TODO: even faster hasher?
match self.cache.entry(hash) {
std::collections::hash_map::Entry::Occupied(entry) => {