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
|
@ -175,7 +175,6 @@ pub(crate) trait PlatformWindow: HasWindowHandle + HasDisplayHandle {
|
|||
fn on_close(&self, callback: Box<dyn FnOnce()>);
|
||||
fn on_appearance_changed(&self, callback: Box<dyn FnMut()>);
|
||||
fn is_topmost_for_position(&self, position: Point<Pixels>) -> bool;
|
||||
fn invalidate(&self);
|
||||
fn draw(&self, scene: &Scene);
|
||||
|
||||
fn sprite_atlas(&self) -> Arc<dyn PlatformAtlas>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue