fix(renderer): kitty images should all be processed (#8488)

When processing kitty images in a loop in a few places we were returning
under certain conditions where we should instead have just continued the
loop. This caused serious problems for kitty images, especially for apps
that used multiple images on screen at once.

... I have no clue how I originally wrote this code and didn't see such
a trivial mistake, I think I was sleep deprived or something.

Should fix #8471
pull/8490/head
Mitchell Hashimoto 2025-09-02 12:14:11 -07:00 committed by GitHub
commit 4af290d5f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -1551,15 +1551,17 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
// Look up the image // Look up the image
const image = self.images.get(p.image_id) orelse { const image = self.images.get(p.image_id) orelse {
log.warn("image not found for placement image_id={}", .{p.image_id}); log.warn("image not found for placement image_id={}", .{p.image_id});
return; continue;
}; };
// Get the texture // Get the texture
const texture = switch (image.image) { const texture = switch (image.image) {
.ready => |t| t, .ready,
.unload_ready,
=> |t| t,
else => { else => {
log.warn("image not ready for placement image_id={}", .{p.image_id}); log.warn("image not ready for placement image_id={}", .{p.image_id});
return; continue;
}, },
}; };
@ -1909,7 +1911,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
if (img.isUnloading()) { if (img.isUnloading()) {
img.deinit(self.alloc); img.deinit(self.alloc);
self.images.removeByPtr(kv.key_ptr); self.images.removeByPtr(kv.key_ptr);
return; continue;
} }
if (img.isPending()) try img.upload(self.alloc, &self.api); if (img.isPending()) try img.upload(self.alloc, &self.api);
} }