gpui: Skip sprites whose atlas texture was released instead of panicking (#64623)

## Objective

Each rendering backend looked up the atlas texture for a sprite batch
with an `unwrap`, so a scene referencing a texture the atlas had already
released aborted the process (`metal_atlas.rs:196` in the Delta crash
reports). This happens when an image is dropped while a cached view
still replays a paint from before the drop — Delta hit it when
re-rasterizing a zoomed Mermaid diagram.

## Solution

Texture lookups now return `Option`, and the Metal, wgpu, and DirectX
sprite draws skip a batch whose texture is gone. The stale paint is
replaced as soon as its view re-renders, so nothing is lost beyond that
frame. wgpu also drops the cached bind group for a released texture and
no longer fails the whole frame on a missing one.

This is a renderer-level safety net and is complementary to #64619,
which fixes the lifetime rule in `Window` so that atlas entries are not
released while a retained frame still references them. Both can land
independently.

## Testing

- `corgi test -p gpui_apple metal_atlas` — 4 passed, including a new
regression that the lookup reports `None` after the last tile is
removed.
- `cargo test -p gpui_wgpu wgpu_atlas` — 5 passed (extended the
generation test to assert `None` after removal).
- `corgi check -p gpui_wgpu`.
- DirectX changes are the same shape but have **not been compiled**; no
Windows target available.

Release Notes:

- N/A
- [GPUI] Fixed a crash when an image was removed from the sprite atlas
while a cached view still referenced it.
96e95edac4Mikayla Maki committed on 9/22/2026, 10:57:07 PM· committed by GitHubparente5221fa
6 files changedLine totals unavailable