Maintain smooth frame rates when ProMotion and direct mode are enabled (#7305)
This is achieved by starting a `CADisplayLink` that will invoke the `on_request_frame` callback at the refresh interval of the display. We only actually draw frames when the window was dirty, or for 2 extra seconds after the last input event to ensure ProMotion doesn't downclock the refresh rate when the user is actively interacting with the window. Release Notes: - Improved performance when using a ProMotion display with fast key repeat rates. --------- Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f2ba969d5b
commit
15edc46827
5 changed files with 50 additions and 37 deletions
|
@ -282,8 +282,6 @@ impl PlatformWindow for TestWindow {
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
fn invalidate(&self) {}
|
||||
|
||||
fn draw(&self, _scene: &crate::Scene) {}
|
||||
|
||||
fn sprite_atlas(&self) -> sync::Arc<dyn crate::PlatformAtlas> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue