2010-07-21 14:17:33 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2013-04-24 11:42:40 -07:00
|
|
|
#ifndef MOZILLA_LAYERS_LAYERTRANSACTIONPARENT_H
|
|
|
|
#define MOZILLA_LAYERS_LAYERTRANSACTIONPARENT_H
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
#include <stdint.h> // for uint64_t, uint32_t
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
#include "CompositableTransactionParent.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "gfxPoint.h" // for gfxIntSize
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
|
|
|
|
#include "mozilla/layers/PLayerTransactionParent.h"
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
|
|
#include "nsTArrayForwardDeclare.h" // for InfallibleTArray
|
|
|
|
|
|
|
|
class gfx3DMatrix;
|
2010-07-21 14:17:33 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace ipc {
|
|
|
|
class Shmem;
|
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
namespace layout {
|
|
|
|
class RenderFrameParent;
|
|
|
|
}
|
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
namespace layers {
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
class Layer;
|
2013-04-25 15:25:33 -07:00
|
|
|
class LayerManagerComposite;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
class ShadowLayerParent;
|
|
|
|
class CompositableParent;
|
2013-08-11 16:17:23 -07:00
|
|
|
class ShadowLayersManager;
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2013-04-24 11:42:40 -07:00
|
|
|
class LayerTransactionParent : public PLayerTransactionParent,
|
2013-11-27 07:19:34 -08:00
|
|
|
public CompositableParentManager
|
2010-07-21 14:17:33 -07:00
|
|
|
{
|
2010-08-20 16:24:41 -07:00
|
|
|
typedef mozilla::layout::RenderFrameParent RenderFrameParent;
|
2010-11-08 18:49:00 -08:00
|
|
|
typedef InfallibleTArray<Edit> EditArray;
|
|
|
|
typedef InfallibleTArray<EditReply> EditReplyArray;
|
2010-07-21 14:17:33 -07:00
|
|
|
|
|
|
|
public:
|
2013-04-25 15:25:33 -07:00
|
|
|
LayerTransactionParent(LayerManagerComposite* aManager,
|
2013-04-24 11:42:40 -07:00
|
|
|
ShadowLayersManager* aLayersManager,
|
|
|
|
uint64_t aId);
|
|
|
|
~LayerTransactionParent();
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2011-01-05 20:54:47 -08:00
|
|
|
void Destroy();
|
|
|
|
|
2013-04-25 15:25:33 -07:00
|
|
|
LayerManagerComposite* layer_manager() const { return mLayerManager; }
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
uint64_t GetId() const { return mId; }
|
2013-07-01 21:17:23 -07:00
|
|
|
Layer* GetRoot() const { return mRoot; }
|
2010-08-20 16:24:41 -07:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
// ISurfaceAllocator
|
|
|
|
virtual bool AllocShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem) {
|
2013-04-24 11:42:40 -07:00
|
|
|
return PLayerTransactionParent::AllocShmem(aSize, aType, aShmem);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool AllocUnsafeShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem) {
|
2013-04-24 11:42:40 -07:00
|
|
|
return PLayerTransactionParent::AllocUnsafeShmem(aSize, aType, aShmem);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void DeallocShmem(ipc::Shmem& aShmem) MOZ_OVERRIDE
|
|
|
|
{
|
2013-04-24 11:42:40 -07:00
|
|
|
PLayerTransactionParent::DeallocShmem(aShmem);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
2011-09-27 15:19:26 -07:00
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
protected:
|
2012-07-12 05:51:58 -07:00
|
|
|
virtual bool RecvUpdate(const EditArray& cset,
|
2012-07-24 12:01:09 -07:00
|
|
|
const TargetConfig& targetConfig,
|
2012-07-12 05:51:58 -07:00
|
|
|
const bool& isFirstPaint,
|
|
|
|
EditReplyArray* reply) MOZ_OVERRIDE;
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2012-07-12 05:51:58 -07:00
|
|
|
virtual bool RecvUpdateNoSwap(const EditArray& cset,
|
2012-07-24 12:01:09 -07:00
|
|
|
const TargetConfig& targetConfig,
|
2012-07-12 05:51:58 -07:00
|
|
|
const bool& isFirstPaint) MOZ_OVERRIDE;
|
2012-05-01 12:23:39 -07:00
|
|
|
|
2012-11-07 19:51:55 -08:00
|
|
|
virtual bool RecvClearCachedResources() MOZ_OVERRIDE;
|
2013-05-29 17:38:27 -07:00
|
|
|
virtual bool RecvGetOpacity(PLayerParent* aParent,
|
|
|
|
float* aOpacity) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvGetTransform(PLayerParent* aParent,
|
|
|
|
gfx3DMatrix* aTransform) MOZ_OVERRIDE;
|
2012-11-07 19:51:55 -08:00
|
|
|
|
2012-07-12 05:51:58 -07:00
|
|
|
virtual PGrallocBufferParent*
|
2013-07-08 08:48:39 -07:00
|
|
|
AllocPGrallocBufferParent(const gfxIntSize& aSize,
|
2013-05-27 07:12:13 -07:00
|
|
|
const uint32_t& aFormat, const uint32_t& aUsage,
|
2012-07-12 05:51:58 -07:00
|
|
|
MaybeMagicGrallocBufferHandle* aOutHandle) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
2013-07-08 08:48:39 -07:00
|
|
|
DeallocPGrallocBufferParent(PGrallocBufferParent* actor) MOZ_OVERRIDE;
|
2012-07-12 05:51:58 -07:00
|
|
|
|
2013-07-08 08:48:39 -07:00
|
|
|
virtual PLayerParent* AllocPLayerParent() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPLayerParent(PLayerParent* actor) MOZ_OVERRIDE;
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2013-07-08 08:48:39 -07:00
|
|
|
virtual PCompositableParent* AllocPCompositableParent(const TextureInfo& aInfo) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPCompositableParent(PCompositableParent* actor) MOZ_OVERRIDE;
|
2013-04-25 15:25:33 -07:00
|
|
|
|
2013-08-20 18:28:53 -07:00
|
|
|
void Attach(ShadowLayerParent* aLayerParent,
|
|
|
|
CompositableParent* aCompositable,
|
|
|
|
bool aIsAsyncVideo);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-11-27 07:18:38 -08:00
|
|
|
void AddIPDLReference() {
|
|
|
|
MOZ_ASSERT(mIPCOpen == false);
|
|
|
|
mIPCOpen = true;
|
|
|
|
AddRef();
|
|
|
|
}
|
|
|
|
void ReleaseIPDLReference() {
|
|
|
|
MOZ_ASSERT(mIPCOpen == true);
|
|
|
|
mIPCOpen = false;
|
|
|
|
Release();
|
|
|
|
}
|
|
|
|
friend class CompositorParent;
|
|
|
|
friend class CrossProcessCompositorParent;
|
|
|
|
friend class layout::RenderFrameParent;
|
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
private:
|
2013-04-25 15:25:33 -07:00
|
|
|
nsRefPtr<LayerManagerComposite> mLayerManager;
|
2012-01-19 06:45:37 -08:00
|
|
|
ShadowLayersManager* mShadowLayersManager;
|
2010-08-20 16:24:41 -07:00
|
|
|
// Hold the root because it might be grafted under various
|
|
|
|
// containers in the "real" layer tree
|
2013-07-01 21:17:23 -07:00
|
|
|
nsRefPtr<Layer> mRoot;
|
2012-07-17 16:59:45 -07:00
|
|
|
// When this is nonzero, it refers to a layer tree owned by the
|
|
|
|
// compositor thread. It is always true that
|
|
|
|
// mId != 0 => mRoot == null
|
|
|
|
// because the "real tree" is owned by the compositor.
|
|
|
|
uint64_t mId;
|
2011-01-12 12:13:41 -08:00
|
|
|
// When the widget/frame/browser stuff in this process begins its
|
|
|
|
// destruction process, we need to Disconnect() all the currently
|
|
|
|
// live shadow layers, because some of them might be orphaned from
|
|
|
|
// the layer tree. This happens in Destroy() above. After we
|
|
|
|
// Destroy() ourself, there's a window in which that information
|
|
|
|
// hasn't yet propagated back to the child side and it might still
|
|
|
|
// send us layer transactions. We want to ignore those transactions
|
|
|
|
// because they refer to "zombie layers" on this side. So, we track
|
|
|
|
// that state with |mDestroyed|. This is similar to, but separate
|
|
|
|
// from, |mLayerManager->IsDestroyed()|; we might have had Destroy()
|
|
|
|
// called on us but the mLayerManager might not be destroyed, or
|
|
|
|
// vice versa. In both cases though, we want to ignore shadow-layer
|
|
|
|
// transactions posted by the child.
|
|
|
|
bool mDestroyed;
|
2013-11-27 07:18:38 -08:00
|
|
|
|
|
|
|
bool mIPCOpen;
|
2010-07-21 14:17:33 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-04-24 11:42:40 -07:00
|
|
|
#endif // MOZILLA_LAYERS_LAYERTRANSACTIONPARENT_H
|