class

Egui::Backend::GlyphAtlas

Inherits Reference < Object

RGBA8 glyph atlas with shelf packing. RGB is white; alpha is the glyph coverage — the draw path multiplies by the text color. Baked glyphs are never freed individually; when the shelves run out (font-size drags bake a set per fractional size), reset empties everything for a full re-bake. The registry may share ONE atlas between many stacks (see AtlasFonts#initialize); epoch lets each stack detect a foreign reset and drop its stale UVs.

Constructors

new(size : Int32)
Source

Instance methods

alloc(w : Int32, h : Int32) : Tuple(Int32, Int32) | Nil

Shelf packer with a 1px border around every glyph so LINEAR sampling never bleeds between neighbours.

Source
blit(x : Int32, y : Int32, w : Int32, h : Int32, cov : Bytes) : Nil
Source
debug_region(g : Glyph) : Bytes

The alpha bytes of a glyph's atlas slot (debug/tests).

Source
epoch

Bumped by every #reset: stacks sharing this atlas compare their remembered epoch in AtlasFonts#glyph and invalidate on a drift.

Source
flush

Create/update this atlas's GPU texture. Outside of a render pass only. The shim keeps a per-instance registry keyed by the view id, so several backends' atlases can coexist.

Source
reset

Empty the atlas: shelf state back to the origin, pixels zeroed. Keeps the GPU texture/view id — the next flush re-uploads the whole buffer. (fontstash's reset-and-rebake, invoked by AtlasFonts#reset_if_full when the packer runs out of space, or by the backend registry when ANY sharing stack overflowed.)

Source
size
Source
view_id
Source