Repository navigation
Stop redrawing the window at the live rate when nothing moves - #17
Merged
Merged
Conversation
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.
With the window still, SimRig redrew at about 36 fps and kept the integrated GPU busy.
Live inputs arrive at 60 Hz and each card is rebuilt and written back when it changed. The comparison always failed: Slint never finds two empty images equal, and every card carries at least one (picture, gate or frame), so every card was rewritten on every live frame. The Inputs view had the same issue, with new lists each time rebuilding the whole view.
same_cardcompares cards treating empty images as equal, used by the home cards and the open component.same_viewcompares the Inputs view by the contents of its lists.Measured on a real rig (CSL DD, wheel, pedals, shifter, handbrake) on the home: from ~36 fps to 0 with nothing moving, and 5 card updates in 30 s instead of thousands.
The press badge on the steering wheel card faded with an animation bound to the whole
device: every live frame started it again, which drew one more frame, so a moving wheel redrew at twice the live rate (120 fps). It now follows a property set only when the badge shows or hides. With the simulated rig moving: 60 fps, GPU from 14.5% to 7%.