Decode on the fly in gallery example

Use `release` mode. Image decoding is terribly slow
in `debug` mode!
This commit is contained in:
Héctor Ramón Jiménez 2025-10-24 20:06:26 +02:00
parent 1b51364154
commit 6fa54f7f6b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 44 additions and 43 deletions

View file

@ -248,7 +248,7 @@ fn load_image<'a>(
} else if let core::image::Handle::Rgba { .. } = handle {
// Load RGBA handles synchronously, since it's very cheap
cache.insert(handle, Memory::load(handle));
} else {
} else if !pending.contains(&handle.id()) {
let _ = jobs.send(Job::Load(handle.clone()));
let _ = pending.insert(handle.id());
}