mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
compositor: Add an initial RefreshDriver (#37169)
This adds a *very* basic implementation of the `RefreshDriver` concept to the Servo renderer. The initial idea is that controls the frequency of display during animations. It eliminates the "slowdown" workaround for WPT tests and now Servo animations don't move faster than 120 FPS (observed to be slower in practice). This establishes a base change which will be used to implement non-display-list-producing layouts in a followup change. Fixes #3406. (though much more work remains) Testing: Covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
801ac9e22a
commit
9dc1391bef
6 changed files with 292 additions and 69 deletions
|
@ -11,7 +11,7 @@ use compositing_traits::rendering_context::RenderingContext;
|
|||
use compositing_traits::{CompositorMsg, CompositorProxy};
|
||||
use constellation_traits::EmbedderToConstellationMessage;
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use embedder_traits::ShutdownState;
|
||||
use embedder_traits::{EventLoopWaker, ShutdownState};
|
||||
use profile_traits::{mem, time};
|
||||
use webrender::RenderApi;
|
||||
use webrender_api::DocumentId;
|
||||
|
@ -22,9 +22,10 @@ pub use crate::compositor::{IOCompositor, WebRenderDebugOption};
|
|||
mod tracing;
|
||||
|
||||
mod compositor;
|
||||
mod refresh_driver;
|
||||
mod touch;
|
||||
pub mod webview_manager;
|
||||
pub mod webview_renderer;
|
||||
mod webview_manager;
|
||||
mod webview_renderer;
|
||||
|
||||
/// Data used to construct a compositor.
|
||||
pub struct InitialCompositorState {
|
||||
|
@ -49,4 +50,7 @@ pub struct InitialCompositorState {
|
|||
pub webrender_gl: Rc<dyn gleam::gl::Gl>,
|
||||
#[cfg(feature = "webxr")]
|
||||
pub webxr_main_thread: webxr::MainThreadRegistry,
|
||||
/// An [`EventLoopWaker`] used in order to wake up the embedder when it is
|
||||
/// time to paint.
|
||||
pub event_loop_waker: Box<dyn EventLoopWaker>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue