pub struct AtlasSnapshot<'a> {
pub dirty: bool,
pub width: u32,
pub height: u32,
pub pixels: &'a [u8],
pub glyphs_evicted: bool,
}Expand description
Outcome of a call to TextFontService::atlas_snapshot.
Bundles the four signals a framework adapter needs to upload (or skip uploading) the glyph atlas texture to the GPU:
- whether the atlas has pending pixel changes since the last snapshot,
- its current pixel dimensions,
- a borrow of the raw RGBA pixel buffer, and
- whether any cached glyphs were evicted during this snapshot — a signal that callers with paint caches holding old atlas UVs must treat as an invalidation even if the atlas itself reports clean afterwards (evicted slots may be reused by future allocations, so any cached UV pointing into them is stale).
Exposed as a struct rather than a tuple so every caller names fields explicitly and can’t swap positions silently.
Fields§
§dirty: boolTrue if the atlas texture has pending pixel changes
since it was last marked clean. The snapshot call clears
this flag, so the caller must either upload pixels now
or accept a one-frame delay.
width: u32Current atlas texture width in pixels.
height: u32Current atlas texture height in pixels.
pixels: &'a [u8]Raw RGBA8 pixel buffer backing the atlas texture.
glyphs_evicted: boolTrue if eviction freed at least one glyph slot during this snapshot. Callers that cache glyph positions (e.g. framework paint caches indexed by layout key) must invalidate when this is true — evicted slots may be reused by future allocations and old UVs would then point to the wrong glyph.