Tighten glyph atlas updates

This commit is contained in:
iris committed 2026-09-13 02:42:28 -04:00
1 parent 71e46c125a
commit 5fe7c3b6df
4 files changed
+91 -73

No files matched your search

+10 -10
View File
@@ -17,36 +17,36 @@ pub struct GpuTextures {
impl GpuTextures {
pub fn update(&mut self, textures: &mut Textures) -> bool {
let mut changed = false;
let mut bindings_changed = false;
for update in textures.updates() {
match update {
bindings_changed |= match update {
TextureUpdate::Push(image) => {
self.push(image);
changed = true;
true
}
TextureUpdate::Set(i, image) => {
self.set(i, image);
changed = true;
true
}
TextureUpdate::Patch(i, rect, image) => {
// Patching contents leaves the binding array unchanged.
self.patch(i, rect, image);
false
}
TextureUpdate::SetFree => {
self.view_count += 1;
changed = true;
true
}
TextureUpdate::Free(i) => {
self.free(i);
changed = true;
true
}
TextureUpdate::PushFree => {
self.push_free();
changed = true;
true
}
}
};
}
changed
bindings_changed
}
fn set(&mut self, i: u32, image: &DynamicImage) {
self.view_count += 1;