mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Rename Fonts::end_frame to Fonts::prune_cache
This commit is contained in:
@@ -627,7 +627,7 @@ impl Context {
|
|||||||
self.memory()
|
self.memory()
|
||||||
.end_frame(&self.input, &self.frame_state().used_ids);
|
.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());
|
let mut output: Output = std::mem::take(&mut self.output());
|
||||||
if self.repaint_requests.load(SeqCst) > 0 {
|
if self.repaint_requests.load(SeqCst) > 0 {
|
||||||
|
|||||||
@@ -398,8 +398,8 @@ impl Fonts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Must be called once per frame to clear the [`Galley`] cache.
|
/// Must be called once per frame to clear the [`Galley`] cache.
|
||||||
pub fn end_frame(&self) {
|
pub fn prune_cache(&self) {
|
||||||
self.galley_cache.lock().end_frame();
|
self.galley_cache.lock().prune();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,8 +453,8 @@ impl GalleyCache {
|
|||||||
self.cache.len()
|
self.cache.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Must be called once per frame to clear the [`Galley`] cache.
|
/// Must be called once per frame to prune the [`Galley`] cache.
|
||||||
pub fn end_frame(&mut self) {
|
pub fn prune(&mut self) {
|
||||||
let current_generation = self.generation;
|
let current_generation = self.generation;
|
||||||
self.cache.retain(|_key, cached| {
|
self.cache.retain(|_key, cached| {
|
||||||
cached.last_used == current_generation // only keep those that were used this frame
|
cached.last_used == current_generation // only keep those that were used this frame
|
||||||
|
|||||||
Reference in New Issue
Block a user