From ababbe26a14f45402a18f4a10caf60cdb3ca6115 Mon Sep 17 00:00:00 2001 From: Ryan Hunt Date: Wed, 17 Aug 2016 09:11:00 -0700 Subject: [PATCH] Bug 1296021 - Forward DeallocateLayerTreeId to GPU process if there is one. r=dvander MozReview-Commit-ID: 12JtwGqLyy4 --HG-- extra : rebase_source : d4382aed4c0ce85ae1aa263cf978690d04cfb5dd --- gfx/ipc/GPUParent.cpp | 7 +++++++ gfx/ipc/GPUParent.h | 1 + gfx/ipc/GPUProcessManager.cpp | 4 ++++ gfx/ipc/PGPU.ipdl | 2 ++ gfx/layers/ipc/CompositorBridgeParent.h | 2 ++ 5 files changed, 16 insertions(+) diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp index 7e3a39aae9b5..ef4fdbc06bd1 100644 --- a/gfx/ipc/GPUParent.cpp +++ b/gfx/ipc/GPUParent.cpp @@ -144,6 +144,13 @@ GPUParent::RecvNewContentVRManager(Endpoint&& aEndpoint) return VRManagerParent::CreateForContent(Move(aEndpoint)); } +bool +GPUParent::RecvDeallocateLayerTreeId(const uint64_t& aLayersId) +{ + CompositorBridgeParent::DeallocateLayerTreeId(aLayersId); + return true; +} + void GPUParent::ActorDestroy(ActorDestroyReason aWhy) { diff --git a/gfx/ipc/GPUParent.h b/gfx/ipc/GPUParent.h index 28f5e2601912..c64a89fb2274 100644 --- a/gfx/ipc/GPUParent.h +++ b/gfx/ipc/GPUParent.h @@ -40,6 +40,7 @@ public: bool RecvNewContentCompositorBridge(Endpoint&& aEndpoint) override; bool RecvNewContentImageBridge(Endpoint&& aEndpoint) override; bool RecvNewContentVRManager(Endpoint&& aEndpoint) override; + bool RecvDeallocateLayerTreeId(const uint64_t& aLayersId) override; void ActorDestroy(ActorDestroyReason aWhy) override; diff --git a/gfx/ipc/GPUProcessManager.cpp b/gfx/ipc/GPUProcessManager.cpp index 16d5b14bcdaf..f95bc467e8e0 100644 --- a/gfx/ipc/GPUProcessManager.cpp +++ b/gfx/ipc/GPUProcessManager.cpp @@ -504,6 +504,10 @@ GPUProcessManager::AllocateLayerTreeId() void GPUProcessManager::DeallocateLayerTreeId(uint64_t aLayersId) { + if (mGPUChild) { + mGPUChild->SendDeallocateLayerTreeId(aLayersId); + return; + } CompositorBridgeParent::DeallocateLayerTreeId(aLayersId); } diff --git a/gfx/ipc/PGPU.ipdl b/gfx/ipc/PGPU.ipdl index 6027e2d79c8c..2d57e5efca6f 100644 --- a/gfx/ipc/PGPU.ipdl +++ b/gfx/ipc/PGPU.ipdl @@ -53,6 +53,8 @@ parent: async NewContentCompositorBridge(Endpoint endpoint); async NewContentImageBridge(Endpoint endpoint); async NewContentVRManager(Endpoint endpoint); + + async DeallocateLayerTreeId(uint64_t layersId); }; } // namespace gfx diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h index 2051effd2bac..b62809a7f719 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -48,6 +48,7 @@ class CancelableRunnable; namespace gfx { class DrawTarget; class GPUProcessManager; +class GPUParent; } // namespace gfx namespace ipc { @@ -210,6 +211,7 @@ class CompositorBridgeParent final : public PCompositorBridgeParent, friend class CompositorThreadHolder; friend class InProcessCompositorSession; friend class gfx::GPUProcessManager; + friend class gfx::GPUParent; public: explicit CompositorBridgeParent(CSSToLayoutDeviceScale aScale,