-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized paint request and throttling algorithm
Previously a repaint was requested through method Paint() and was synchronous. Frame throttling was computed using time.Now(), which is a relatively expensive call. It also led to a bug were a dropped frame would not be redrawn if repaint wasn't explicitly requested after the frame had been dropped. Now tuikit.Init() returns a sending channel. The client writes to the channel to request a repaint. This decouples painting from application logic and allows for a more fine-grained throttling algorithm. As a side-effect the bug mentioned earlier is fixed and there isn't any call to time.Now() anymore. The examples were also adjusted to use the new channel.
- Loading branch information
Showing
3 changed files
with
44 additions
and
27 deletions.
There are no files selected for viewing
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