mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Backed out changesets 7caa8e80b06a, 1509f8be5df3, a249bd79e71a, and 9cc4a77561e8 (bug 933082) for mochitest asserts on a CLOSED TREE.
This commit is contained in:
parent
fe5d12c0e2
commit
1c086f8129
@ -4,7 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/layers/CompositorParent.h"
|
||||
#include "mozilla/layers/LayerTransactionChild.h"
|
||||
#include "mozilla/layers/PLayerTransactionChild.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsError.h"
|
||||
|
@ -43,7 +43,7 @@ SurfaceFactory_Gralloc::SurfaceFactory_Gralloc(GLContext* prodGL,
|
||||
|
||||
MOZ_ASSERT(allocator);
|
||||
|
||||
mAllocator = allocator;
|
||||
mAllocator = allocator->asWeakPtr();
|
||||
}
|
||||
|
||||
SharedSurface_Gralloc*
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
|
||||
protected:
|
||||
GLLibraryEGL* const mEGL;
|
||||
RefPtr<layers::ISurfaceAllocator> mAllocator;
|
||||
WeakPtr<layers::ISurfaceAllocator> mAllocator;
|
||||
// We keep the SurfaceDescriptor around, because we'll end up
|
||||
// using it often and it's handy to do so. The actual
|
||||
// GraphicBuffer is kept alive by the sp<GraphicBuffer> in
|
||||
@ -64,7 +64,7 @@ protected:
|
||||
size,
|
||||
hasAlpha)
|
||||
, mEGL(egl)
|
||||
, mAllocator(allocator)
|
||||
, mAllocator(allocator->asWeakPtr())
|
||||
, mDesc(desc)
|
||||
, mProdTex(prodTex)
|
||||
{}
|
||||
@ -93,7 +93,7 @@ class SurfaceFactory_Gralloc
|
||||
: public SurfaceFactory_GL
|
||||
{
|
||||
protected:
|
||||
RefPtr<layers::ISurfaceAllocator> mAllocator;
|
||||
WeakPtr<layers::ISurfaceAllocator> mAllocator;
|
||||
|
||||
public:
|
||||
SurfaceFactory_Gralloc(GLContext* prodGL,
|
||||
|
@ -45,7 +45,7 @@ ClientCanvasLayer::Initialize(const Data& aData)
|
||||
screen->PreserveBuffer());
|
||||
SurfaceFactory_GL* factory = nullptr;
|
||||
if (!mForceReadback) {
|
||||
if (ClientManager()->AsShadowForwarder()->GetCompositorBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
if (ClientManager()->GetCompositorBackendType() == mozilla::layers::LAYERS_OPENGL) {
|
||||
if (mGLContext->GetEGLContext()) {
|
||||
bool isCrossProcess = !(XRE_GetProcessType() == GeckoProcessType_Default);
|
||||
|
||||
@ -55,7 +55,7 @@ ClientCanvasLayer::Initialize(const Data& aData)
|
||||
} else {
|
||||
// [Basic/OGL Layers, OOPC] WebGL layer init. (Out Of Process Compositing)
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
factory = new SurfaceFactory_Gralloc(mGLContext, screen->Caps(), ClientManager()->AsShadowForwarder());
|
||||
factory = new SurfaceFactory_Gralloc(mGLContext, screen->Caps(), ClientManager());
|
||||
#else
|
||||
// we could do readback here maybe
|
||||
NS_NOTREACHED("isCrossProcess but not on native B2G!");
|
||||
@ -106,13 +106,13 @@ ClientCanvasLayer::RenderLayer()
|
||||
flags |= TEXTURE_DEALLOCATE_CLIENT;
|
||||
}
|
||||
mCanvasClient = CanvasClient::CreateCanvasClient(GetCanvasClientType(),
|
||||
ClientManager()->AsShadowForwarder(), flags);
|
||||
ClientManager(), flags);
|
||||
if (!mCanvasClient) {
|
||||
return;
|
||||
}
|
||||
if (HasShadow()) {
|
||||
mCanvasClient->Connect();
|
||||
ClientManager()->AsShadowForwarder()->Attach(mCanvasClient, this);
|
||||
ClientManager()->Attach(mCanvasClient, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,9 +92,9 @@ public:
|
||||
{
|
||||
NS_ASSERTION(ClientManager()->InConstruction(),
|
||||
"Can only set properties in construction phase");
|
||||
ClientManager()->AsShadowForwarder()->InsertAfter(ClientManager()->Hold(this),
|
||||
ClientManager()->Hold(aChild),
|
||||
aAfter ? ClientManager()->Hold(aAfter) : nullptr);
|
||||
ClientManager()->InsertAfter(ClientManager()->Hold(this),
|
||||
ClientManager()->Hold(aChild),
|
||||
aAfter ? ClientManager()->Hold(aAfter) : nullptr);
|
||||
ContainerLayer::InsertAfter(aChild, aAfter);
|
||||
}
|
||||
|
||||
@ -102,8 +102,8 @@ public:
|
||||
{
|
||||
NS_ASSERTION(ClientManager()->InConstruction(),
|
||||
"Can only set properties in construction phase");
|
||||
ClientManager()->AsShadowForwarder()->RemoveChild(ClientManager()->Hold(this),
|
||||
ClientManager()->Hold(aChild));
|
||||
ClientManager()->RemoveChild(ClientManager()->Hold(this),
|
||||
ClientManager()->Hold(aChild));
|
||||
ContainerLayer::RemoveChild(aChild);
|
||||
}
|
||||
|
||||
@ -111,9 +111,9 @@ public:
|
||||
{
|
||||
NS_ASSERTION(ClientManager()->InConstruction(),
|
||||
"Can only set properties in construction phase");
|
||||
ClientManager()->AsShadowForwarder()->RepositionChild(ClientManager()->Hold(this),
|
||||
ClientManager()->Hold(aChild),
|
||||
aAfter ? ClientManager()->Hold(aAfter) : nullptr);
|
||||
ClientManager()->RepositionChild(ClientManager()->Hold(this),
|
||||
ClientManager()->Hold(aChild),
|
||||
aAfter ? ClientManager()->Hold(aAfter) : nullptr);
|
||||
ContainerLayer::RepositionChild(aChild, aAfter);
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ ClientImageLayer::RenderLayer()
|
||||
flags |= TEXTURE_DISALLOW_BIGIMAGE;
|
||||
}
|
||||
mImageClient = ImageClient::CreateImageClient(type,
|
||||
ClientManager()->AsShadowForwarder(),
|
||||
ClientManager(),
|
||||
flags);
|
||||
if (type == BUFFER_BRIDGE) {
|
||||
static_cast<ImageClientBridge*>(mImageClient.get())->SetLayer(this);
|
||||
@ -154,7 +154,7 @@ ClientImageLayer::RenderLayer()
|
||||
}
|
||||
if (HasShadow() && !mContainer->IsAsync()) {
|
||||
mImageClient->Connect();
|
||||
ClientManager()->AsShadowForwarder()->Attach(mImageClient, this);
|
||||
ClientManager()->Attach(mImageClient, this);
|
||||
}
|
||||
if (!mImageClient->UpdateImage(mContainer, GetContentFlags())) {
|
||||
return;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "mozilla/layers/LayersMessages.h" // for EditReply, etc
|
||||
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
||||
#include "mozilla/layers/PLayerChild.h" // for PLayerChild
|
||||
#include "mozilla/layers/LayerTransactionChild.h"
|
||||
#include "mozilla/layers/PLayerTransactionChild.h"
|
||||
#include "nsAString.h"
|
||||
#include "nsIWidget.h" // for nsIWidget
|
||||
#include "nsTArray.h" // for AutoInfallibleTArray
|
||||
@ -44,7 +44,6 @@ ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)
|
||||
, mTransactionIncomplete(false)
|
||||
, mCompositorMightResample(false)
|
||||
, mNeedsComposite(false)
|
||||
, mForwarder(new ShadowLayerForwarder)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ClientLayerManager);
|
||||
}
|
||||
@ -59,7 +58,7 @@ ClientLayerManager::~ClientLayerManager()
|
||||
int32_t
|
||||
ClientLayerManager::GetMaxTextureSize() const
|
||||
{
|
||||
return mForwarder->GetMaxTextureSize();
|
||||
return ShadowLayerForwarder::GetMaxTextureSize();
|
||||
}
|
||||
|
||||
void
|
||||
@ -83,7 +82,7 @@ ClientLayerManager::SetRoot(Layer* aLayer)
|
||||
if (mRoot) {
|
||||
Hold(mRoot);
|
||||
}
|
||||
mForwarder->SetRoot(Hold(aLayer));
|
||||
ShadowLayerForwarder::SetRoot(Hold(aLayer));
|
||||
NS_ASSERTION(aLayer, "Root can't be null");
|
||||
NS_ASSERTION(aLayer->Manager() == this, "Wrong manager");
|
||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
||||
@ -97,7 +96,7 @@ ClientLayerManager::Mutated(Layer* aLayer)
|
||||
LayerManager::Mutated(aLayer);
|
||||
|
||||
NS_ASSERTION(InConstruction() || InDrawing(), "wrong phase");
|
||||
mForwarder->Mutated(Hold(aLayer));
|
||||
ShadowLayerForwarder::Mutated(Hold(aLayer));
|
||||
}
|
||||
|
||||
void
|
||||
@ -130,7 +129,7 @@ ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget)
|
||||
nsIntRect clientBounds;
|
||||
mWidget->GetClientBounds(clientBounds);
|
||||
clientBounds.x = clientBounds.y = 0;
|
||||
mForwarder->BeginTransaction(mTargetBounds, mTargetRotation, clientBounds, orientation);
|
||||
ShadowLayerForwarder::BeginTransaction(mTargetBounds, mTargetRotation, clientBounds, orientation);
|
||||
|
||||
// If we're drawing on behalf of a context with async pan/zoom
|
||||
// enabled, then the entire buffer of thebes layers might be
|
||||
@ -265,9 +264,9 @@ ClientLayerManager::MakeSnapshotIfRequired()
|
||||
nsIntRect bounds;
|
||||
mWidget->GetBounds(bounds);
|
||||
SurfaceDescriptor inSnapshot, snapshot;
|
||||
if (mForwarder->AllocSurfaceDescriptor(bounds.Size(),
|
||||
GFX_CONTENT_COLOR_ALPHA,
|
||||
&inSnapshot) &&
|
||||
if (AllocSurfaceDescriptor(bounds.Size(),
|
||||
GFX_CONTENT_COLOR_ALPHA,
|
||||
&inSnapshot) &&
|
||||
// The compositor will usually reuse |snapshot| and return
|
||||
// it through |outSnapshot|, but if it doesn't, it's
|
||||
// responsible for freeing |snapshot|.
|
||||
@ -278,7 +277,7 @@ ClientLayerManager::MakeSnapshotIfRequired()
|
||||
mShadowTarget->DrawSurface(source, source->GetSize());
|
||||
}
|
||||
if (IsSurfaceDescriptorValid(snapshot)) {
|
||||
mForwarder->DestroySharedSurface(&snapshot);
|
||||
ShadowLayerForwarder::DestroySharedSurface(&snapshot);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -313,7 +312,7 @@ ClientLayerManager::ForwardTransaction()
|
||||
// forward this transaction's changeset to our LayerManagerComposite
|
||||
bool sent;
|
||||
AutoInfallibleTArray<EditReply, 10> replies;
|
||||
if (HasShadowManager() && mForwarder->EndTransaction(&replies, &sent)) {
|
||||
if (HasShadowManager() && ShadowLayerForwarder::EndTransaction(&replies, &sent)) {
|
||||
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
|
||||
const EditReply& reply = replies[i];
|
||||
|
||||
@ -394,21 +393,21 @@ bool
|
||||
ClientLayerManager::IsCompositingCheap()
|
||||
{
|
||||
// Whether compositing is cheap depends on the parent backend.
|
||||
return mForwarder->mShadowManager &&
|
||||
LayerManager::IsCompositingCheap(mForwarder->GetCompositorBackendType());
|
||||
return mShadowManager &&
|
||||
LayerManager::IsCompositingCheap(GetCompositorBackendType());
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::SetIsFirstPaint()
|
||||
{
|
||||
mForwarder->SetIsFirstPaint();
|
||||
ShadowLayerForwarder::SetIsFirstPaint();
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::ClearCachedResources(Layer* aSubtree)
|
||||
{
|
||||
MOZ_ASSERT(!HasShadowManager() || !aSubtree);
|
||||
if (LayerTransactionChild* manager = mForwarder->GetShadowManager()) {
|
||||
if (PLayerTransactionChild* manager = GetShadowManager()) {
|
||||
manager->SendClearCachedResources();
|
||||
}
|
||||
if (aSubtree) {
|
||||
@ -431,7 +430,7 @@ ClientLayerManager::ClearLayer(Layer* aLayer)
|
||||
void
|
||||
ClientLayerManager::GetBackendName(nsAString& aName)
|
||||
{
|
||||
switch (mForwarder->GetCompositorBackendType()) {
|
||||
switch (GetCompositorBackendType()) {
|
||||
case LAYERS_BASIC: aName.AssignLiteral("Basic"); return;
|
||||
case LAYERS_OPENGL: aName.AssignLiteral("OpenGL"); return;
|
||||
case LAYERS_D3D9: aName.AssignLiteral("Direct3D 9"); return;
|
||||
|
@ -34,7 +34,8 @@ class CompositorChild;
|
||||
class ImageLayer;
|
||||
class PLayerChild;
|
||||
|
||||
class ClientLayerManager : public LayerManager
|
||||
class ClientLayerManager : public LayerManager,
|
||||
public ShadowLayerForwarder
|
||||
{
|
||||
typedef nsTArray<nsRefPtr<Layer> > LayerRefArray;
|
||||
|
||||
@ -44,7 +45,7 @@ public:
|
||||
|
||||
virtual ShadowLayerForwarder* AsShadowForwarder()
|
||||
{
|
||||
return mForwarder;
|
||||
return this;
|
||||
}
|
||||
|
||||
virtual int32_t GetMaxTextureSize() const;
|
||||
@ -74,7 +75,7 @@ public:
|
||||
|
||||
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE
|
||||
{
|
||||
return mForwarder->GetTextureFactoryIdentifier();
|
||||
return mTextureFactoryIdentifier;
|
||||
}
|
||||
|
||||
virtual void FlushRendering() MOZ_OVERRIDE;
|
||||
@ -84,7 +85,7 @@ public:
|
||||
|
||||
ShadowableLayer* Hold(Layer* aLayer);
|
||||
|
||||
bool HasShadowManager() const { return mForwarder->HasShadowManager(); }
|
||||
bool HasShadowManager() const { return ShadowLayerForwarder::HasShadowManager(); }
|
||||
|
||||
virtual bool IsCompositingCheap();
|
||||
virtual bool HasShadowManagerInternal() const { return HasShadowManager(); }
|
||||
@ -205,8 +206,6 @@ private:
|
||||
bool mTransactionIncomplete;
|
||||
bool mCompositorMightResample;
|
||||
bool mNeedsComposite;
|
||||
|
||||
RefPtr<ShadowLayerForwarder> mForwarder;
|
||||
};
|
||||
|
||||
class ClientLayer : public ShadowableLayer
|
||||
@ -256,12 +255,12 @@ CreateShadowFor(ClientLayer* aLayer,
|
||||
ClientLayerManager* aMgr,
|
||||
CreatedMethod aMethod)
|
||||
{
|
||||
PLayerChild* shadow = aMgr->AsShadowForwarder()->ConstructShadowFor(aLayer);
|
||||
PLayerChild* shadow = aMgr->ConstructShadowFor(aLayer);
|
||||
// XXX error handling
|
||||
NS_ABORT_IF_FALSE(shadow, "failed to create shadow");
|
||||
|
||||
aLayer->SetShadow(shadow);
|
||||
(aMgr->AsShadowForwarder()->*aMethod)(aLayer);
|
||||
(aMgr->*aMethod)(aLayer);
|
||||
aMgr->Hold(aLayer->AsLayer());
|
||||
}
|
||||
|
||||
|
@ -94,12 +94,12 @@ ClientThebesLayer::RenderLayer()
|
||||
}
|
||||
|
||||
if (!mContentClient) {
|
||||
mContentClient = ContentClient::CreateContentClient(ClientManager()->AsShadowForwarder());
|
||||
mContentClient = ContentClient::CreateContentClient(ClientManager());
|
||||
if (!mContentClient) {
|
||||
return;
|
||||
}
|
||||
mContentClient->Connect();
|
||||
ClientManager()->AsShadowForwarder()->Attach(mContentClient, this);
|
||||
ClientManager()->Attach(mContentClient, this);
|
||||
MOZ_ASSERT(mContentClient->GetForwarder());
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ already_AddRefed<ThebesLayer>
|
||||
ClientLayerManager::CreateThebesLayer()
|
||||
{
|
||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
||||
if (Preferences::GetBool("layers.force-tiles") && AsShadowForwarder()->GetCompositorBackendType() == LAYERS_OPENGL) {
|
||||
if (Preferences::GetBool("layers.force-tiles") && GetCompositorBackendType() == LAYERS_OPENGL) {
|
||||
nsRefPtr<ClientTiledThebesLayer> layer =
|
||||
new ClientTiledThebesLayer(this);
|
||||
CREATE_SHADOW(Thebes);
|
||||
|
@ -134,7 +134,7 @@ ClientTiledThebesLayer::RenderLayer()
|
||||
mContentClient = new TiledContentClient(this, ClientManager());
|
||||
|
||||
mContentClient->Connect();
|
||||
ClientManager()->AsShadowForwarder()->Attach(mContentClient, this);
|
||||
ClientManager()->Attach(mContentClient, this);
|
||||
MOZ_ASSERT(mContentClient->GetForwarder());
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ BasicTiledLayerBuffer::ValidateTileInternal(BasicTiledLayerTile aTile,
|
||||
{
|
||||
if (aTile.IsPlaceholderTile()) {
|
||||
RefPtr<DeprecatedTextureClient> textureClient =
|
||||
new DeprecatedTextureClientTile(mManager->AsShadowForwarder(), TextureInfo(BUFFER_TILED));
|
||||
new DeprecatedTextureClientTile(mManager, TextureInfo(BUFFER_TILED));
|
||||
aTile.mDeprecatedTextureClient = static_cast<DeprecatedTextureClientTile*>(textureClient.get());
|
||||
}
|
||||
aTile.mDeprecatedTextureClient->EnsureAllocated(gfx::IntSize(GetTileLength(), GetTileLength()), GetContentType());
|
||||
|
@ -219,11 +219,6 @@ public:
|
||||
return mMultiProcess;
|
||||
}
|
||||
|
||||
const TextureFactoryIdentifier& GetTextureFactoryIdentifier() const
|
||||
{
|
||||
return mTextureFactoryIdentifier;
|
||||
}
|
||||
|
||||
protected:
|
||||
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
||||
bool mMultiProcess;
|
||||
|
@ -87,15 +87,13 @@ CompositorChild::AllocPLayerTransactionChild(const nsTArray<LayersBackend>& aBac
|
||||
TextureFactoryIdentifier*,
|
||||
bool*)
|
||||
{
|
||||
LayerTransactionChild* c = new LayerTransactionChild();
|
||||
c->AddIPDLReference();
|
||||
return c;
|
||||
return new LayerTransactionChild();
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorChild::DeallocPLayerTransactionChild(PLayerTransactionChild* actor)
|
||||
{
|
||||
static_cast<LayerTransactionChild*>(actor)->ReleaseIPDLReference();
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -127,9 +127,6 @@ ISurfaceAllocator::DestroySharedSurface(SurfaceDescriptor* aSurface)
|
||||
if (!aSurface) {
|
||||
return;
|
||||
}
|
||||
if (!IPCOpen()) {
|
||||
return;
|
||||
}
|
||||
if (PlatformDestroySharedSurface(aSurface)) {
|
||||
return;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "gfxTypes.h"
|
||||
#include "gfxPoint.h" // for gfxIntSize
|
||||
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
#include "nsIMemoryReporter.h" // for MemoryUniReporter
|
||||
#include "mozilla/Atomics.h" // for Atomic
|
||||
|
||||
@ -73,10 +73,10 @@ bool ReleaseOwnedSurfaceDescriptor(const SurfaceDescriptor& aDescriptor);
|
||||
* These methods should be only called in the ipdl implementor's thread, unless
|
||||
* specified otherwise in the implementing class.
|
||||
*/
|
||||
class ISurfaceAllocator : public AtomicRefCounted<ISurfaceAllocator>
|
||||
class ISurfaceAllocator : public SupportsWeakPtr<ISurfaceAllocator>
|
||||
{
|
||||
public:
|
||||
ISurfaceAllocator() {}
|
||||
ISurfaceAllocator() {}
|
||||
|
||||
/**
|
||||
* Allocate shared memory that can be accessed by only one process at a time.
|
||||
@ -124,8 +124,6 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual bool IPCOpen() const { return true; }
|
||||
|
||||
// Returns true if aSurface wraps a Shmem.
|
||||
static bool IsShmem(SurfaceDescriptor* aSurface);
|
||||
|
||||
@ -140,10 +138,7 @@ protected:
|
||||
SurfaceDescriptor* aBuffer);
|
||||
|
||||
|
||||
virtual ~ISurfaceAllocator() {}
|
||||
|
||||
friend class detail::RefCounted<ISurfaceAllocator, detail::AtomicRefCount>;
|
||||
//friend class detail::RefCounted<ISurfaceAllocator, detail::AtomicRefCount>;
|
||||
~ISurfaceAllocator() {}
|
||||
};
|
||||
|
||||
class GfxMemoryImageReporter MOZ_FINAL : public mozilla::MemoryUniReporter
|
||||
|
@ -199,7 +199,7 @@ ImageBridgeChild::UpdatePictureRect(CompositableClient* aCompositable,
|
||||
}
|
||||
|
||||
// Singleton
|
||||
static StaticRefPtr<ImageBridgeChild> sImageBridgeChildSingleton;
|
||||
static ImageBridgeChild *sImageBridgeChildSingleton = nullptr;
|
||||
static StaticRefPtr<ImageBridgeParent> sImageBridgeParentSingleton;
|
||||
static Thread *sImageBridgeChildThread = nullptr;
|
||||
|
||||
@ -225,6 +225,7 @@ static void DeleteImageBridgeSync(ReentrantMonitor *aBarrier, bool *aDone)
|
||||
|
||||
NS_ABORT_IF_FALSE(InImageBridgeChildThread(),
|
||||
"Should be in ImageBridgeChild thread.");
|
||||
delete sImageBridgeChildSingleton;
|
||||
sImageBridgeChildSingleton = nullptr;
|
||||
sImageBridgeParentSingleton = nullptr;
|
||||
*aDone = true;
|
||||
|
@ -13,20 +13,16 @@
|
||||
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
||||
#include "mozilla/ipc/ProtocolUtils.h"
|
||||
#include "mozilla/layers/PLayerTransactionChild.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace layout {
|
||||
class RenderFrameChild;
|
||||
}
|
||||
|
||||
namespace layers {
|
||||
|
||||
class LayerTransactionChild : public PLayerTransactionChild
|
||||
, public AtomicRefCounted<LayerTransactionChild>
|
||||
{
|
||||
public:
|
||||
LayerTransactionChild() { }
|
||||
~LayerTransactionChild() { }
|
||||
|
||||
/**
|
||||
* Clean this up, finishing with Send__delete__().
|
||||
*
|
||||
@ -36,16 +32,7 @@ public:
|
||||
*/
|
||||
void Destroy();
|
||||
|
||||
bool IPCOpen() const { return mIPCOpen; }
|
||||
|
||||
protected:
|
||||
LayerTransactionChild()
|
||||
: mIPCOpen(false)
|
||||
{}
|
||||
~LayerTransactionChild() { }
|
||||
friend class AtomicRefCounted<LayerTransactionChild>;
|
||||
friend class detail::RefCounted<LayerTransactionChild, detail::AtomicRefCount>;
|
||||
|
||||
virtual PGrallocBufferChild*
|
||||
AllocPGrallocBufferChild(const gfxIntSize&,
|
||||
const uint32_t&, const uint32_t&,
|
||||
@ -59,21 +46,6 @@ protected:
|
||||
virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE;
|
||||
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||
|
||||
void AddIPDLReference() {
|
||||
MOZ_ASSERT(mIPCOpen == false);
|
||||
mIPCOpen = true;
|
||||
AddRef();
|
||||
}
|
||||
void ReleaseIPDLReference() {
|
||||
MOZ_ASSERT(mIPCOpen == true);
|
||||
mIPCOpen = false;
|
||||
Release();
|
||||
}
|
||||
friend class CompositorChild;
|
||||
friend class layout::RenderFrameChild;
|
||||
|
||||
bool mIPCOpen;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "mozilla/layers/PGrallocBufferChild.h"
|
||||
#include "mozilla/layers/PGrallocBufferParent.h"
|
||||
#include "mozilla/layers/LayerTransactionChild.h"
|
||||
#include "mozilla/layers/PLayerTransactionChild.h"
|
||||
#include "mozilla/layers/ShadowLayers.h"
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "mozilla/layers/CompositorTypes.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "mozilla/layers/LayersMessages.h" // for Edit, etc
|
||||
#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/PLayerTransactionChild.h"
|
||||
#include "ShadowLayerUtils.h"
|
||||
#include "mozilla/layers/TextureClient.h" // for TextureClient
|
||||
#include "mozilla/mozalloc.h" // for operator new, etc
|
||||
@ -179,7 +179,8 @@ CompositableForwarder::IdentifyTextureHost(const TextureFactoryIdentifier& aIden
|
||||
}
|
||||
|
||||
ShadowLayerForwarder::ShadowLayerForwarder()
|
||||
: mDiagnosticTypes(DIAGNOSTIC_NONE)
|
||||
: mShadowManager(nullptr)
|
||||
, mDiagnosticTypes(DIAGNOSTIC_NONE)
|
||||
, mIsFirstPaint(false)
|
||||
, mWindowOverlayChanged(false)
|
||||
{
|
||||
@ -616,12 +617,6 @@ ShadowLayerForwarder::DeallocShmem(ipc::Shmem& aShmem)
|
||||
mShadowManager->DeallocShmem(aShmem);
|
||||
}
|
||||
|
||||
bool
|
||||
ShadowLayerForwarder::IPCOpen() const
|
||||
{
|
||||
return mShadowManager->IPCOpen();
|
||||
}
|
||||
|
||||
/*static*/ already_AddRefed<gfxASurface>
|
||||
ShadowLayerForwarder::OpenDescriptor(OpenMode aMode,
|
||||
const SurfaceDescriptor& aSurface)
|
||||
@ -984,11 +979,5 @@ void ShadowLayerForwarder::AttachAsyncCompositable(uint64_t aCompositableID,
|
||||
aCompositableID));
|
||||
}
|
||||
|
||||
void ShadowLayerForwarder::SetShadowManager(PLayerTransactionChild* aShadowManager)
|
||||
{
|
||||
mShadowManager = static_cast<LayerTransactionChild*>(aShadowManager);
|
||||
}
|
||||
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
@ -46,7 +46,6 @@ class OptionalThebesBuffer;
|
||||
class PLayerChild;
|
||||
class PLayerTransactionChild;
|
||||
class PLayerTransactionParent;
|
||||
class LayerTransactionChild;
|
||||
class RefLayerComposite;
|
||||
class ShadowableLayer;
|
||||
class Shmem;
|
||||
@ -138,7 +137,6 @@ class ShadowLayerForwarder : public CompositableForwarder
|
||||
friend class AutoOpenSurface;
|
||||
friend class DeprecatedTextureClientShmem;
|
||||
friend class ContentClientIncremental;
|
||||
friend class ClientLayerManager;
|
||||
|
||||
public:
|
||||
virtual ~ShadowLayerForwarder();
|
||||
@ -341,13 +339,16 @@ public:
|
||||
/**
|
||||
* Set an actor through which layer updates will be pushed.
|
||||
*/
|
||||
void SetShadowManager(PLayerTransactionChild* aShadowManager);
|
||||
void SetShadowManager(PLayerTransactionChild* aShadowManager)
|
||||
{
|
||||
mShadowManager = aShadowManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if this is forwarding to a LayerManagerComposite.
|
||||
*/
|
||||
bool HasShadowManager() const { return !!mShadowManager; }
|
||||
LayerTransactionChild* GetShadowManager() const { return mShadowManager.get(); }
|
||||
PLayerTransactionChild* GetShadowManager() const { return mShadowManager; }
|
||||
|
||||
virtual void WindowOverlayChanged() { mWindowOverlayChanged = true; }
|
||||
|
||||
@ -393,8 +394,6 @@ public:
|
||||
mozilla::ipc::Shmem* aShmem) MOZ_OVERRIDE;
|
||||
virtual void DeallocShmem(mozilla::ipc::Shmem& aShmem) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IPCOpen() const MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Construct a shadow of |aLayer| on the "other side", at the
|
||||
* LayerManagerComposite.
|
||||
@ -420,7 +419,7 @@ protected:
|
||||
void CheckSurfaceDescriptor(const SurfaceDescriptor* aDescriptor) const {}
|
||||
#endif
|
||||
|
||||
RefPtr<LayerTransactionChild> mShadowManager;
|
||||
PLayerTransactionChild* mShadowManager;
|
||||
|
||||
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
|
||||
// from ISurfaceAllocator
|
||||
|
@ -35,15 +35,13 @@ RenderFrameChild::Destroy()
|
||||
PLayerTransactionChild*
|
||||
RenderFrameChild::AllocPLayerTransactionChild()
|
||||
{
|
||||
LayerTransactionChild* c = new LayerTransactionChild();
|
||||
c->AddIPDLReference();
|
||||
return c;
|
||||
return new LayerTransactionChild();
|
||||
}
|
||||
|
||||
bool
|
||||
RenderFrameChild::DeallocPLayerTransactionChild(PLayerTransactionChild* aLayers)
|
||||
{
|
||||
static_cast<LayerTransactionChild*>(aLayers)->ReleaseIPDLReference();
|
||||
delete aLayers;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -3694,7 +3694,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
|
||||
if (mGeckoChild->GetLayerManager()->GetBackendType() == LAYERS_CLIENT) {
|
||||
ClientLayerManager *manager = static_cast<ClientLayerManager*>(mGeckoChild->GetLayerManager());
|
||||
manager->AsShadowForwarder()->WindowOverlayChanged();
|
||||
manager->WindowOverlayChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user