зеркало из https://github.com/mozilla/gecko-dev.git
Remove PCompositable. (bug 1323957 part 5, r=mattwoodrow)
--HG-- extra : rebase_source : 8b2a3826a08b14065d8ef3474eddc38d592a4f82
This commit is contained in:
Родитель
065c15518d
Коммит
3d7a9b6ee1
|
@ -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<CompositableChild*>(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<CompositableClient>
|
||||
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<CompositableClient>
|
||||
AsyncCompositableChild::GetCompositableClient()
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
return CompositableChild::GetCompositableClient();
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
|
@ -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 <stdint.h>
|
||||
#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<CompositableClient> 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<CompositableClient> 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
|
|
@ -6,13 +6,11 @@
|
|||
#include "mozilla/layers/CompositableClient.h"
|
||||
#include <stdint.h> // 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>
|
||||
CompositableClient::FromIPDLActor(PCompositableChild* aActor)
|
||||
{
|
||||
MOZ_ASSERT(aActor);
|
||||
|
||||
RefPtr<CompositableClient> client = static_cast<CompositableChild*>(aActor)->GetCompositableClient();
|
||||
if (!client) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
client->mForwarder->AssertInForwarderThread();
|
||||
return client;
|
||||
}
|
||||
|
||||
CompositableClient::CompositableClient(CompositableForwarder* aForwarder,
|
||||
TextureFlags aTextureFlags)
|
||||
: mForwarder(aForwarder)
|
||||
|
|
|
@ -168,8 +168,6 @@ public:
|
|||
|
||||
virtual ContentClientRemote* AsContentClientRemote() { return nullptr; }
|
||||
|
||||
static RefPtr<CompositableClient> FromIPDLActor(PCompositableChild* aActor);
|
||||
|
||||
void InitIPDL(const CompositableHandle& aHandle);
|
||||
|
||||
TextureFlags GetTextureFlags() const { return mTextureFlags; }
|
||||
|
|
|
@ -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<TimedTexture>& aTextures)
|
||||
{
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
Загрузка…
Ссылка в новой задаче