From 66eb2fb5f71c99899bd930a125322ea808b73459 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 3 Nov 2021 22:23:52 +0100 Subject: [PATCH] Rename Fonts::end_frame to Fonts::prune_cache --- egui/src/context.rs | 2 +- epaint/src/text/fonts.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/egui/src/context.rs b/egui/src/context.rs index 0553dc1a..96e080d6 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -627,7 +627,7 @@ impl Context { self.memory() .end_frame(&self.input, &self.frame_state().used_ids); - self.fonts().end_frame(); + self.fonts().prune_cache(); let mut output: Output = std::mem::take(&mut self.output()); if self.repaint_requests.load(SeqCst) > 0 { diff --git a/epaint/src/text/fonts.rs b/epaint/src/text/fonts.rs index 8fb6d9f0..90fb5062 100644 --- a/epaint/src/text/fonts.rs +++ b/epaint/src/text/fonts.rs @@ -398,8 +398,8 @@ impl Fonts { } /// Must be called once per frame to clear the [`Galley`] cache. - pub fn end_frame(&self) { - self.galley_cache.lock().end_frame(); + pub fn prune_cache(&self) { + self.galley_cache.lock().prune(); } } @@ -453,8 +453,8 @@ impl GalleyCache { self.cache.len() } - /// Must be called once per frame to clear the [`Galley`] cache. - pub fn end_frame(&mut self) { + /// Must be called once per frame to prune the [`Galley`] cache. + pub fn prune(&mut self) { let current_generation = self.generation; self.cache.retain(|_key, cached| { cached.last_used == current_generation // only keep those that were used this frame