Repository navigation
fix(skia): Stop FPS indicator from waking renderer when idle - #23205
Merged
Merged
Conversation
Two compounding bugs in FpsHelper kept the renderer awake every 2-3 seconds after rendering went idle: A. The first-idle-tick branch of TimerTick called RequestRedraw, bumping _currentFrameGeneration via OnFrameRecorded. The next tick saw that as activity and reset the counter, so idle was never detected. B. The final idle redraw flowed through BeginFrame, which blindly restarted the 1 Hz timer. The immediate tick saw the just-recorded idle frame and flipped _isIdle back to false. Removed the spurious first-tick RequestRedraw and added an _idleRedrawPending flag set when triggering the final idle redraw and consumed by BeginFrame to skip the timer restart for that one render. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
MartinZikmund
enabled auto-merge
May 5, 2026 12:46
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23205/wasm-skia-net9/index.html |
Contributor
|
The build 210864 found UI Test snapshots differences: Details
|
morning4coffe-dev
approved these changes
May 5, 2026
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.
Summary
Fixes #23204.
The FPS diagnostic panel is meant to do a single final redraw to "Idle" and then go quiet. In practice the numeric values kept updating every 2-3 seconds, indicating the panel itself was waking the renderer continuously.
Two compounding bugs in
FpsHelper(src/Uno.UI/Helpers/SkiaRenderHelper.skia.cs):RequestRedrawsabotaged idle detection. ThenoNewFramesbranch ofTimerTickcalledRequestRedrawon every first idle tick. The resulting render flowed throughOnFrameRecorded, which bumped_currentFrameGeneration. The next tick observed the new generation, decidednoNewFrames = false, and reset_consecutiveIdleTicks = 0. The counter could never reach 2 and idle was never entered. (Leftover from the original idle-indicator commit, where the redraw was needed before the>= 2early-return path was introduced.)BeginFrame. Even with Bug A fixed, the legitimate final idle redraw flowed throughDraw()->RenderPicture()->BeginFrame(), which blindly restarted the timer because!_timerRunning. The immediateTimeSpan.Zerotick saw the just-recorded idle frame's bumped generation, cleared_isIdle, and the cycle restarted every 2-3 seconds.Changes
RequestRedrawcall inTimerTick._idleRedrawPendingflag set when triggering the final idle redraw and consumed byBeginFrameto skip the timer restart for that one render.StopTimerso disable/re-enable cycles start fresh.Test plan
No automated runtime test covers this — it's a timing/wakeup behaviour. Manual verification on Skia desktop:
Uno.UI-Skia-only.slnf.Render()or watching CPU/GPU usage).🤖 Generated with Claude Code