Skip to content

Fix text input flicker when glyph atlas grows#52

Open
mirsella wants to merge 1 commit into
ickshonpe:masterfrom
mirsella:fix/defer-glyph-layout-atlas-update
Open

Fix text input flicker when glyph atlas grows#52
mirsella wants to merge 1 commit into
ickshonpe:masterfrom
mirsella:fix/defer-glyph-layout-atlas-update

Conversation

@mirsella

Copy link
Copy Markdown

Text input redraws currently replace the visible glyph layout immediately after adding missing glyphs to the atlas. On native/mobile render paths, that can expose newly allocated atlas entries before the render-side texture upload is ready, producing a one-frame blank/flicker the first time a glyph/cache-key is used.

This stages the next glyph layout locally during redraw. If any glyph had to be added to the atlas, the system keeps the previous visible layout for the frame and retries the redraw next frame. Once every glyph is already cached, the staged layout replaces the visible layout and redraw is cleared.

Validated with:

  • cargo check
  • cargo clippy --all-targets

Note: clippy reports an existing collapsible_match warning in src/edit.rs, unrelated to this change.

Keep the currently displayed text-input layout visible when a redraw has to add glyphs to the atlas. This avoids exposing newly allocated atlas entries to extraction before the render texture upload is ready, preventing first-use glyph flicker on native mobile.
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