From 6e66eea2d494c3a571ff0ae3ec6600db0f8061b8 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Mon, 11 May 2020 20:08:08 +0000 Subject: [PATCH] Bug 1622360 - Remove render root arguments from ScheduleRender functions. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D74404 --- gfx/layers/apz/public/CompositorController.h | 8 ++------ gfx/layers/apz/src/APZCTreeManager.cpp | 3 +-- gfx/layers/apz/src/AsyncPanZoomController.cpp | 3 +-- gfx/layers/ipc/CompositorBridgeParent.cpp | 12 +++++------- gfx/layers/ipc/CompositorBridgeParent.h | 6 ++---- gfx/webrender_bindings/RenderThread.cpp | 10 ++-------- gfx/webrender_bindings/src/bindings.rs | 6 +++--- 7 files changed, 16 insertions(+), 32 deletions(-) diff --git a/gfx/layers/apz/public/CompositorController.h b/gfx/layers/apz/public/CompositorController.h index d6a6faf2e690..5b0dca0f7e23 100644 --- a/gfx/layers/apz/public/CompositorController.h +++ b/gfx/layers/apz/public/CompositorController.h @@ -19,13 +19,9 @@ class CompositorController { NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING /** - * Ask the compositor to schedule a new composite. If WebRender is enabled, - * and the provided render root set is non-empty, then only those render roots - * will be scheduled for a recomposite. Otherwise, all render roots will be - * scheduled. + * Ask the compositor to schedule a new composite. */ - virtual void ScheduleRenderOnCompositorThread( - const wr::RenderRootSet& aRenderRoots) = 0; + virtual void ScheduleRenderOnCompositorThread() = 0; virtual void ScheduleHideAllPluginWindows() = 0; virtual void ScheduleShowAllPluginWindows() = 0; diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index e0417e1fe663..18df69c2e883 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -717,8 +717,7 @@ void APZCTreeManager::SampleForWebRender( controller = aState.GetCompositorController(); }); if (controller) { - controller->ScheduleRenderOnCompositorThread( - wr::RenderRootSet(aRenderRoot)); + controller->ScheduleRenderOnCompositorThread(); } } diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 19ee4dc71f9e..c06169ce6cea 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -3807,8 +3807,7 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort( void AsyncPanZoomController::ScheduleComposite() { if (mCompositorController) { - mCompositorController->ScheduleRenderOnCompositorThread( - wr::RenderRootSet(mRenderRoot)); + mCompositorController->ScheduleRenderOnCompositorThread(); } } diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index 5644395e9cd6..fad8250c36e7 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -677,12 +677,11 @@ void CompositorBridgeParent::ActorDestroy(ActorDestroyReason why) { &CompositorBridgeParent::DeferredDestroy)); } -void CompositorBridgeParent::ScheduleRenderOnCompositorThread( - const wr::RenderRootSet& aRenderRoots) { +void CompositorBridgeParent::ScheduleRenderOnCompositorThread() { MOZ_ASSERT(CompositorThread()); - CompositorThread()->Dispatch(NewRunnableMethod( + CompositorThread()->Dispatch(NewRunnableMethod( "layers::CompositorBridgeParent::ScheduleComposition", this, - &CompositorBridgeParent::ScheduleComposition, aRenderRoots)); + &CompositorBridgeParent::ScheduleComposition)); } void CompositorBridgeParent::InvalidateOnCompositorThread() { @@ -751,7 +750,7 @@ void CompositorBridgeParent::ResumeComposition() { void CompositorBridgeParent::ForceComposition() { // Cancel the orientation changed state to force composition mForceCompositionTask = nullptr; - ScheduleRenderOnCompositorThread(wr::RenderRootSet()); + ScheduleRenderOnCompositorThread(); } void CompositorBridgeParent::CancelCurrentCompositeTask() { @@ -880,8 +879,7 @@ void CompositorBridgeParent::NotifyShadowTreeTransaction( } } -void CompositorBridgeParent::ScheduleComposition( - const wr::RenderRootSet& aRenderRoots) { +void CompositorBridgeParent::ScheduleComposition() { MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread()); if (mPaused) { return; diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h index 3722da384fb8..29a9a2497b21 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -475,8 +475,7 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase, void AsyncRender(); // Can be called from any thread - void ScheduleRenderOnCompositorThread( - const wr::RenderRootSet& aRenderRoots) override; + void ScheduleRenderOnCompositorThread() override; void SchedulePauseOnCompositorThread(); void InvalidateOnCompositorThread(); /** @@ -486,8 +485,7 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase, bool ScheduleResumeOnCompositorThread(); bool ScheduleResumeOnCompositorThread(int x, int y, int width, int height); - void ScheduleComposition( - const wr::RenderRootSet& aRenderRoots = wr::RenderRootSet()); + void ScheduleComposition(); void NotifyShadowTreeTransaction(LayersId aId, bool aIsFirstPaint, const FocusTarget& aFocusTarget, diff --git a/gfx/webrender_bindings/RenderThread.cpp b/gfx/webrender_bindings/RenderThread.cpp index b5803bdeec8c..d3564623e0fd 100644 --- a/gfx/webrender_bindings/RenderThread.cpp +++ b/gfx/webrender_bindings/RenderThread.cpp @@ -1080,17 +1080,11 @@ void wr_notifier_external_event(mozilla::wr::WrWindowId aWindowId, std::move(evt)); } -void wr_schedule_render(mozilla::wr::WrWindowId aWindowId, - const mozilla::wr::WrDocumentId* aDocumentIds, - size_t aDocumentIdsCount) { +void wr_schedule_render(mozilla::wr::WrWindowId aWindowId) { RefPtr cbp = mozilla::layers:: CompositorBridgeParent::GetCompositorBridgeParentFromWindowId(aWindowId); if (cbp) { - wr::RenderRootSet renderRoots; - for (size_t i = 0; i < aDocumentIdsCount; ++i) { - renderRoots += wr::RenderRootFromId(aDocumentIds[i]); - } - cbp->ScheduleRenderOnCompositorThread(renderRoots); + cbp->ScheduleRenderOnCompositorThread(); } } diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs index 61fb853a63aa..c81378ad7376 100644 --- a/gfx/webrender_bindings/src/bindings.rs +++ b/gfx/webrender_bindings/src/bindings.rs @@ -524,7 +524,7 @@ extern "C" { fn wr_notifier_new_frame_ready(window_id: WrWindowId); fn wr_notifier_nop_frame_done(window_id: WrWindowId); fn wr_notifier_external_event(window_id: WrWindowId, raw_event: usize); - fn wr_schedule_render(window_id: WrWindowId, document_id_array: *const WrDocumentId, document_id_count: usize); + fn wr_schedule_render(window_id: WrWindowId); // NOTE: This moves away from pipeline_info. fn wr_finished_scene_build( window_id: WrWindowId, @@ -939,8 +939,8 @@ impl SceneBuilderHooks for APZCallbacks { } } - fn post_resource_update(&self, document_ids: &Vec) { - unsafe { wr_schedule_render(self.window_id, document_ids.as_ptr(), document_ids.len()) } + fn post_resource_update(&self, _document_ids: &Vec) { + unsafe { wr_schedule_render(self.window_id) } unsafe { gecko_profiler_end_marker(b"SceneBuilding\0".as_ptr() as *const c_char); }