iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
22.96k stars 1.06k forks source link

Make image `Cache` eviction strategy less aggressive in `iced_wgpu` #2403

Closed hecrj closed 3 weeks ago

hecrj commented 3 weeks ago

Instead of trimming unconditionally at the end of a frame, we now trim the cache only when there is a cache miss.

This way, images that are not visible but still a part of the layout will stay cached. Eviction will only happen when the images are not a part of the UI for two consectuive frames.