-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repaint rework: more responsive, less energy
Previously, we repainted every frame on Windows at full refresh rate. This is an enormous waste, as the UI will be static most of the time. This was to work around a bug with `rfd` + `eframe`. On other platforms, we only repainted every frame when a job was running, which was better, but still not ideal. We also had a 100ms deadline, so we'd repaint at ~10fps minimum to catch new events (file watcher, jobs). This removes all repaint logic from the main loop and moves it into the individual places where we change state from another thread. For example, the file watcher thread will now immediately notify egui to repaint, rather than relying on the 100ms deadline we had previously. Jobs, when updating their status, also notify egui to repaint. For `rfd` file dialogs, this migrates to using the async API built on top of a polling thread + `pollster`. This interacts better with `eframe` on Windows. Overall, this should reduce repaints and improve responsiveness to file changes and background tasks.
- Loading branch information
Showing
14 changed files
with
366 additions
and
104 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.