diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index af84b49149d..7d2206c7ffc 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -610,7 +610,7 @@ impl IOCompositor { let _ = sender.send(()); }, - CompositorMsg::NewWebRenderFrameReady(recomposite_needed) => { + CompositorMsg::NewWebRenderFrameReady(_document_id, recomposite_needed) => { self.pending_frames -= 1; if recomposite_needed { @@ -991,7 +991,7 @@ impl IOCompositor { ); } }, - CompositorMsg::NewWebRenderFrameReady(_) => { + CompositorMsg::NewWebRenderFrameReady(..) => { // Subtract from the number of pending frames, but do not do any compositing. self.pending_frames -= 1; }, @@ -2378,12 +2378,12 @@ impl IOCompositor { let mut found_recomposite_msg = false; while let Some(msg) = self.port.try_recv_compositor_msg() { match msg { - CompositorMsg::NewWebRenderFrameReady(_) if found_recomposite_msg => { + CompositorMsg::NewWebRenderFrameReady(..) if found_recomposite_msg => { // Only take one of duplicate NewWebRendeFrameReady messages, but do subtract // one frame from the pending frames. self.pending_frames -= 1; }, - CompositorMsg::NewWebRenderFrameReady(_) => { + CompositorMsg::NewWebRenderFrameReady(..) => { found_recomposite_msg = true; compositor_messages.push(msg) }, @@ -2437,7 +2437,7 @@ impl IOCompositor { pub fn repaint_synchronously(&mut self) { while self.shutdown_state != ShutdownState::ShuttingDown { let msg = self.port.recv_compositor_msg(); - let need_recomposite = matches!(msg, CompositorMsg::NewWebRenderFrameReady(_)); + let need_recomposite = matches!(msg, CompositorMsg::NewWebRenderFrameReady(..)); let keep_going = self.handle_browser_message(msg); if need_recomposite { self.composite(); diff --git a/components/servo/lib.rs b/components/servo/lib.rs index ff5a1e54efd..99947da8cad 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -206,13 +206,16 @@ impl webrender_api::RenderNotifier for RenderNotifier { fn new_frame_ready( &self, - _document_id: DocumentId, + document_id: DocumentId, _scrolled: bool, composite_needed: bool, _frame_publish_id: FramePublishId, ) { self.compositor_proxy - .send(CompositorMsg::NewWebRenderFrameReady(composite_needed)); + .send(CompositorMsg::NewWebRenderFrameReady( + document_id, + composite_needed, + )); } } diff --git a/components/shared/compositing/lib.rs b/components/shared/compositing/lib.rs index 66d2199930e..e3c0c079037 100644 --- a/components/shared/compositing/lib.rs +++ b/components/shared/compositing/lib.rs @@ -22,6 +22,7 @@ use script_traits::{ }; use style_traits::CSSPixel; use webrender_api::units::{DeviceIntPoint, DeviceIntSize, DeviceRect}; +use webrender_api::DocumentId; use webrender_traits::{ CanvasToCompositorMsg, FontToCompositorMsg, NetToCompositorMsg, ScriptToCompositorMsg, }; @@ -93,8 +94,9 @@ pub enum CompositorMsg { /// Set whether to use less resources by stopping animations. SetThrottled(PipelineId, bool), /// WebRender has produced a new frame. This message informs the compositor that - /// the frame is ready, so that it may trigger a recomposite. - NewWebRenderFrameReady(bool /* composite_needed */), + /// the frame is ready. It contains a bool to indicate if it needs to composite and the + /// `DocumentId` of the new frame. + NewWebRenderFrameReady(DocumentId, bool), /// A pipeline was shut down. // This message acts as a synchronization point between the constellation, // when it shuts down a pipeline, to the compositor; when the compositor