mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Rename Fonts::end_frame to Fonts::prune_cache
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user