Fix text input flicker when glyph atlas grows#52
Open
mirsella wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Note: clippy reports an existing collapsible_match warning in src/edit.rs, unrelated to this change.