Skip to content

fix(render): keep one-off bitmaps out of the glyph atlas - #31

Draft
lunaynx wants to merge 2 commits into
mainfrom
fix/glyph-atlas-bitmaps
Draft

lunaynx wants to merge 2 commits into
mainfrom
fix/glyph-atlas-bitmaps

Conversation

@lunaynx

@lunaynx lunaynx commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Port of OneConfig's local fix/glyph-atlas-bitmaps (624e381a6) to PolyCompose.

Bitmaps drawn only once, such as the colour picker's gradient ramps while a colour is dragged (a new ramp each frame), each took an atlas slot. That gradually used up the shared glyph atlas, bumped PolyGlyphPage.revision every time, and eventually retired pages.

  • PolyGlyphPage.bitmap now places a bitmap only on its second draw. The first draw uses the bitmap's own texture.
  • PolyGlyphPage.pending(bitmap) (@ApiStatus.Internal) reports bitmaps that will get a slot on their next draw.
  • Linear ramps drawn past their ends still request their slot, so a slot left pending by an earlier draw doesn't keep recordings redrawing.
  • Second commit: since BlazeRenderer, GlHost and GlRenderer now live here rather than in OneConfig, they redraw cached recordings/captures that drew a pending bitmap from its own texture. Otherwise static content would stay on separate textures until something else forced a redraw.

Differences from the original: a bitmap is only marked pending after the lineage and area-budget checks pass, and the 128-per-second placement cap now counts only real placements. That way bitmaps that can't be placed never show up as pending, and one-offs don't use up the cap.

The OneConfig PR for this fix depends on this one. Its renderer part now lives in the second commit here.

Release Notes

  • Fixed gradients and images that are only drawn once, such as the colour picker's gradients while a colour is dragged, gradually using up texture space shared by the UI and HUDs, which made later drawing slower and used more memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant