diff --git a/gfx/layers/client/CompositableChild.cpp b/gfx/layers/client/CompositableChild.cpp deleted file mode 100644 index a1752e6a6ce0..000000000000 --- a/gfx/layers/client/CompositableChild.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "CompositableChild.h" -#include "CompositableClient.h" - -namespace mozilla { -namespace layers { - -/* static */ PCompositableChild* -CompositableChild::CreateActor() -{ - CompositableChild* child = new CompositableChild(); - child->AddRef(); - return child; -} - -/* static */ void -CompositableChild::DestroyActor(PCompositableChild* aChild) -{ - static_cast(aChild)->Release(); -} - -CompositableChild::CompositableChild() - : mCompositableClient(nullptr), - mCanSend(true) -{ -} - -CompositableChild::~CompositableChild() -{ -} - -bool -CompositableChild::IsConnected() const -{ - return mCompositableClient && mCanSend; -} - -void -CompositableChild::Init(CompositableClient* aCompositable) -{ - mCompositableClient = aCompositable; -} - -void -CompositableChild::RevokeCompositableClient() -{ - mCompositableClient = nullptr; -} - -RefPtr -CompositableChild::GetCompositableClient() -{ - return mCompositableClient; -} - -void -CompositableChild::ActorDestroy(ActorDestroyReason) -{ - MOZ_ASSERT(NS_IsMainThread()); - - mCanSend = false; - - if (mCompositableClient) { - mCompositableClient = nullptr; - } -} - -/* static */ PCompositableChild* -AsyncCompositableChild::CreateActor(uint64_t aAsyncID) -{ - AsyncCompositableChild* child = new AsyncCompositableChild(aAsyncID); - child->AddRef(); - return child; -} - -AsyncCompositableChild::AsyncCompositableChild(uint64_t aAsyncID) - : mLock("AsyncCompositableChild.mLock"), - mAsyncID(aAsyncID) -{ -} - -AsyncCompositableChild::~AsyncCompositableChild() -{ -} - -void -AsyncCompositableChild::ActorDestroy(ActorDestroyReason) -{ - mCanSend = false; - - // We do not revoke CompositableClient::mCompositableChild here, since that - // could race with the main thread. - RevokeCompositableClient(); -} - -void -AsyncCompositableChild::RevokeCompositableClient() -{ - MutexAutoLock lock(mLock); - mCompositableClient = nullptr; -} - -RefPtr -AsyncCompositableChild::GetCompositableClient() -{ - MutexAutoLock lock(mLock); - return CompositableChild::GetCompositableClient(); -} - -} // namespace layers -} // namespace mozilla diff --git a/gfx/layers/client/CompositableChild.h b/gfx/layers/client/CompositableChild.h deleted file mode 100644 index 9635b997bae6..000000000000 --- a/gfx/layers/client/CompositableChild.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_gfx_layers_client_CompositableChild_h -#define mozilla_gfx_layers_client_CompositableChild_h - -#include -#include "IPDLActor.h" -#include "mozilla/Mutex.h" -#include "mozilla/layers/PCompositableChild.h" - -namespace mozilla { -namespace layers { - -class CompositableClient; -class AsyncCompositableChild; - -/** - * IPDL actor used by CompositableClient to match with its corresponding - * CompositableHost on the compositor side. - * - * CompositableChild is owned by a CompositableClient. - */ -class CompositableChild : public PCompositableChild -{ -public: - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositableChild) - - static PCompositableChild* CreateActor(); - static void DestroyActor(PCompositableChild* aChild); - - void Init(CompositableClient* aCompositable); - virtual void RevokeCompositableClient(); - - virtual void ActorDestroy(ActorDestroyReason) override; - - virtual RefPtr GetCompositableClient(); - - virtual AsyncCompositableChild* AsAsyncCompositableChild() { - return nullptr; - } - - // These should only be called on the IPDL thread. - bool IsConnected() const; - bool CanSend() const { - return mCanSend; - } - -protected: - CompositableChild(); - virtual ~CompositableChild(); - -protected: - CompositableClient* mCompositableClient; - bool mCanSend; -}; - -// This CompositableChild can be used off the main thread. -class AsyncCompositableChild final : public CompositableChild -{ -public: - static PCompositableChild* CreateActor(uint64_t aAsyncID); - - void RevokeCompositableClient() override; - RefPtr GetCompositableClient() override; - - void ActorDestroy(ActorDestroyReason) override; - - AsyncCompositableChild* AsAsyncCompositableChild() override { - return this; - } - - uint64_t GetAsyncID() const { - return mAsyncID; - } - -protected: - explicit AsyncCompositableChild(uint64_t aAsyncID); - ~AsyncCompositableChild() override; - -private: - Mutex mLock; - uint64_t mAsyncID; -}; - -} // namespace layers -} // namespace mozilla - -#endif // mozilla_gfx_layers_client_CompositableChild_h diff --git a/gfx/layers/client/CompositableClient.cpp b/gfx/layers/client/CompositableClient.cpp index 70c1b75c5f24..6be6ab738d0f 100644 --- a/gfx/layers/client/CompositableClient.cpp +++ b/gfx/layers/client/CompositableClient.cpp @@ -6,13 +6,11 @@ #include "mozilla/layers/CompositableClient.h" #include // for uint64_t, uint32_t #include "gfxPlatform.h" // for gfxPlatform -#include "mozilla/layers/CompositableChild.h" #include "mozilla/layers/CompositableForwarder.h" #include "mozilla/layers/ImageBridgeChild.h" #include "mozilla/layers/TextureClient.h" // for TextureClient, etc #include "mozilla/layers/TextureClientOGL.h" #include "mozilla/mozalloc.h" // for operator delete, etc -#include "mozilla/layers/PCompositableChild.h" #include "mozilla/layers/TextureClientRecycleAllocator.h" #ifdef XP_WIN #include "gfxWindowsPlatform.h" // for gfxWindowsPlatform @@ -38,20 +36,6 @@ CompositableClient::InitIPDL(const CompositableHandle& aHandle) mIsAsync = !NS_IsMainThread(); } -/* static */ RefPtr -CompositableClient::FromIPDLActor(PCompositableChild* aActor) -{ - MOZ_ASSERT(aActor); - - RefPtr client = static_cast(aActor)->GetCompositableClient(); - if (!client) { - return nullptr; - } - - client->mForwarder->AssertInForwarderThread(); - return client; -} - CompositableClient::CompositableClient(CompositableForwarder* aForwarder, TextureFlags aTextureFlags) : mForwarder(aForwarder) diff --git a/gfx/layers/client/CompositableClient.h b/gfx/layers/client/CompositableClient.h index 4aee7d29324d..16463cb69a79 100644 --- a/gfx/layers/client/CompositableClient.h +++ b/gfx/layers/client/CompositableClient.h @@ -168,8 +168,6 @@ public: virtual ContentClientRemote* AsContentClientRemote() { return nullptr; } - static RefPtr FromIPDLActor(PCompositableChild* aActor); - void InitIPDL(const CompositableHandle& aHandle); TextureFlags GetTextureFlags() const { return mTextureFlags; } diff --git a/gfx/layers/composite/CompositableHost.cpp b/gfx/layers/composite/CompositableHost.cpp index bed9e319942e..7a28d16b6bb9 100644 --- a/gfx/layers/composite/CompositableHost.cpp +++ b/gfx/layers/composite/CompositableHost.cpp @@ -17,7 +17,6 @@ #include "nsDebug.h" // for NS_WARNING #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "gfxPlatform.h" // for gfxPlatform -#include "mozilla/layers/PCompositableParent.h" #include "IPDLActor.h" namespace mozilla { @@ -45,13 +44,6 @@ CompositableHost::~CompositableHost() MOZ_COUNT_DTOR(CompositableHost); } -bool -CompositableHost::DestroyIPDLActor(PCompositableParent* aActor) -{ - delete aActor; - return true; -} - void CompositableHost::UseTextureHost(const nsTArray& aTextures) { diff --git a/gfx/layers/composite/CompositableHost.h b/gfx/layers/composite/CompositableHost.h index 1edf6793acaf..10df6c8435e6 100644 --- a/gfx/layers/composite/CompositableHost.h +++ b/gfx/layers/composite/CompositableHost.h @@ -43,7 +43,6 @@ class Compositor; class ThebesBufferData; class TiledContentHost; class CompositableParentManager; -class PCompositableParent; struct EffectChain; struct AsyncCompositableRef @@ -217,8 +216,6 @@ public: ? DIAGNOSTIC_FLASH_COUNTER_MAX : mFlashCounter + 1; } - static bool DestroyIPDLActor(PCompositableParent* actor); - uint64_t GetCompositorID() const { return mCompositorID; } const AsyncCompositableRef& GetAsyncRef() const { return mAsyncRef; } diff --git a/gfx/layers/ipc/CompositableForwarder.cpp b/gfx/layers/ipc/CompositableForwarder.cpp deleted file mode 100644 index 8a19be38cbd5..000000000000 --- a/gfx/layers/ipc/CompositableForwarder.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "CompositableForwarder.h" -#include "mozilla/layers/CompositableChild.h" - -namespace mozilla { -namespace layers { - -} // namespace layers -} // namespace mozilla diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index 587ef24cff02..8b8ff296834f 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -23,13 +23,11 @@ #include "mozilla/layers/AsyncCanvasRenderer.h" #include "mozilla/media/MediaSystemResourceManager.h" // for MediaSystemResourceManager #include "mozilla/media/MediaSystemResourceManagerChild.h" // for MediaSystemResourceManagerChild -#include "mozilla/layers/CompositableChild.h" #include "mozilla/layers/CompositableClient.h" // for CompositableChild, etc #include "mozilla/layers/CompositorThread.h" #include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator #include "mozilla/layers/ImageClient.h" // for ImageClient #include "mozilla/layers/LayersMessages.h" // for CompositableOperation -#include "mozilla/layers/PCompositableChild.h" // for PCompositableChild #include "mozilla/layers/TextureClient.h" // for TextureClient #include "mozilla/dom/ContentChild.h" #include "mozilla/mozalloc.h" // for operator new, etc diff --git a/gfx/layers/ipc/ImageBridgeParent.cpp b/gfx/layers/ipc/ImageBridgeParent.cpp index a6e16f521dcb..50fb1ce49235 100644 --- a/gfx/layers/ipc/ImageBridgeParent.cpp +++ b/gfx/layers/ipc/ImageBridgeParent.cpp @@ -20,7 +20,6 @@ #include "mozilla/layers/CompositableTransactionParent.h" #include "mozilla/layers/LayerManagerComposite.h" #include "mozilla/layers/LayersMessages.h" // for EditReply -#include "mozilla/layers/PCompositableParent.h" #include "mozilla/layers/PImageBridgeParent.h" #include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL #include "mozilla/layers/Compositor.h" diff --git a/gfx/layers/ipc/LayerTransactionChild.cpp b/gfx/layers/ipc/LayerTransactionChild.cpp index 9ab2f9356f95..378bfb651bab 100644 --- a/gfx/layers/ipc/LayerTransactionChild.cpp +++ b/gfx/layers/ipc/LayerTransactionChild.cpp @@ -7,8 +7,6 @@ #include "LayerTransactionChild.h" #include "mozilla/gfx/Logging.h" -#include "mozilla/layers/CompositableChild.h" -#include "mozilla/layers/PCompositableChild.h" // for PCompositableChild #include "mozilla/layers/ShadowLayers.h" // for ShadowLayerForwarder #include "mozilla/mozalloc.h" // for operator delete, etc #include "nsDebug.h" // for NS_RUNTIMEABORT, etc diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index e3feba5a98bb..5e97c5326017 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -24,7 +24,6 @@ #include "mozilla/layers/LayerManagerComposite.h" #include "mozilla/layers/LayersMessages.h" // for EditReply, etc #include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG -#include "mozilla/layers/PCompositableParent.h" #include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL #include "mozilla/layers/PaintedLayerComposite.h" #include "mozilla/mozalloc.h" // for operator delete, etc diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index 73d5e5fc95d9..088bfda2e6aa 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -6,7 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ include LayersSurfaces; -include protocol PCompositable; include protocol PCompositorBridge; include protocol PRenderFrame; include protocol PTexture; diff --git a/gfx/layers/ipc/PCompositable.ipdl b/gfx/layers/ipc/PCompositable.ipdl deleted file mode 100644 index bd347cbbd25c..000000000000 --- a/gfx/layers/ipc/PCompositable.ipdl +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * vim: sw=2 ts=8 et : - */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -include protocol PLayerTransaction; -include protocol PImageBridge; -include protocol PCompositorBridge; - -namespace mozilla { -namespace layers { - -async protocol PCompositable -{ -child: - async __delete__(); -parent: - /** - * Asynchronously tell the compositor side to remove the texture. - */ - async Destroy(); -}; - -} // namespace -} // namespace diff --git a/gfx/layers/ipc/PCompositorBridge.ipdl b/gfx/layers/ipc/PCompositorBridge.ipdl index 0e9d2e842bd7..5a410613a291 100644 --- a/gfx/layers/ipc/PCompositorBridge.ipdl +++ b/gfx/layers/ipc/PCompositorBridge.ipdl @@ -11,7 +11,6 @@ include PlatformWidgetTypes; include protocol PAPZ; include protocol PAPZCTreeManager; include protocol PBrowser; -include protocol PCompositable; include protocol PCompositorWidget; include protocol PLayerTransaction; include protocol PTexture; diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index d970dc8dbc46..704e5f023954 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -29,7 +29,6 @@ #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc #include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG #include "mozilla/layers/LayerTransactionChild.h" -#include "mozilla/layers/PCompositableChild.h" #include "mozilla/layers/PTextureChild.h" #include "ShadowLayerUtils.h" #include "mozilla/layers/TextureClient.h" // for TextureClient diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index de12fba5e315..be6bed36f8c2 100644 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -129,7 +129,6 @@ EXPORTS.mozilla.layers += [ 'BSPTree.h', 'BufferTexture.h', 'client/CanvasClient.h', - 'client/CompositableChild.h', 'client/CompositableClient.h', 'client/ContentClient.h', 'client/GPUVideoTextureClient.h', @@ -294,7 +293,6 @@ UNIFIED_SOURCES += [ 'client/ClientPaintedLayer.cpp', 'client/ClientTextLayer.cpp', 'client/ClientTiledPaintedLayer.cpp', - 'client/CompositableChild.cpp', 'client/CompositableClient.cpp', 'client/ContentClient.cpp', 'client/GPUVideoTextureClient.cpp', @@ -331,7 +329,6 @@ UNIFIED_SOURCES += [ 'ipc/APZChild.cpp', 'ipc/APZCTreeManagerChild.cpp', 'ipc/APZCTreeManagerParent.cpp', - 'ipc/CompositableForwarder.cpp', 'ipc/CompositableTransactionParent.cpp', 'ipc/CompositorBench.cpp', 'ipc/CompositorBridgeChild.cpp', @@ -402,7 +399,6 @@ IPDL_SOURCES = [ 'ipc/LayersSurfaces.ipdlh', 'ipc/PAPZ.ipdl', 'ipc/PAPZCTreeManager.ipdl', - 'ipc/PCompositable.ipdl', 'ipc/PCompositorBridge.ipdl', 'ipc/PImageBridge.ipdl', 'ipc/PLayerTransaction.ipdl',