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_LAYERTRANSACTIONCHILD_H
|
|
|
|
#define MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stdint.h> // for uint32_t
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/ipc/ProtocolUtils.h"
|
2013-04-24 11:42:40 -07:00
|
|
|
#include "mozilla/layers/PLayerTransactionChild.h"
|
2013-11-27 07:18:38 -08:00
|
|
|
#include "mozilla/RefPtr.h"
|
2010-07-21 14:17:33 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
2013-11-27 07:18:38 -08:00
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
class RenderFrameChild;
|
2014-05-05 18:56:40 -07:00
|
|
|
class ShadowLayerForwarder;
|
2013-11-27 07:18:38 -08:00
|
|
|
}
|
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
namespace layers {
|
|
|
|
|
2013-04-24 11:42:40 -07:00
|
|
|
class LayerTransactionChild : public PLayerTransactionChild
|
2010-07-21 14:17:33 -07:00
|
|
|
{
|
2014-05-14 15:40:15 -07:00
|
|
|
typedef InfallibleTArray<AsyncParentMessageData> AsyncParentMessageArray;
|
2010-07-21 14:17:33 -07:00
|
|
|
public:
|
2014-04-14 12:04:25 -07:00
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(LayerTransactionChild)
|
2010-08-20 16:24:41 -07:00
|
|
|
/**
|
|
|
|
* Clean this up, finishing with Send__delete__().
|
|
|
|
*
|
|
|
|
* It is expected (checked with an assert) that all shadow layers
|
|
|
|
* created by this have already been destroyed and
|
|
|
|
* Send__delete__()d by the time this method is called.
|
|
|
|
*/
|
|
|
|
void Destroy();
|
2010-07-21 14:17:33 -07:00
|
|
|
|
2013-11-27 07:18:38 -08:00
|
|
|
bool IPCOpen() const { return mIPCOpen; }
|
|
|
|
|
2014-05-28 14:42:16 -07:00
|
|
|
void SetHasNoCompositor() { mHasNoCompositor = true; }
|
|
|
|
bool HasNoCompositor() { return mHasNoCompositor; }
|
|
|
|
|
2014-05-05 18:56:40 -07:00
|
|
|
void SetForwarder(ShadowLayerForwarder* aForwarder)
|
|
|
|
{
|
|
|
|
mForwarder = aForwarder;
|
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
protected:
|
2013-11-27 07:18:38 -08:00
|
|
|
LayerTransactionChild()
|
2014-05-28 14:42:16 -07:00
|
|
|
: mForwarder(nullptr)
|
|
|
|
, mIPCOpen(false)
|
2014-05-07 06:23:14 -07:00
|
|
|
, mDestroyed(false)
|
2014-05-28 14:42:16 -07:00
|
|
|
, mHasNoCompositor(false)
|
2013-11-27 07:18:38 -08:00
|
|
|
{}
|
|
|
|
~LayerTransactionChild() { }
|
|
|
|
|
2013-07-08 08:48:39 -07:00
|
|
|
virtual PLayerChild* AllocPLayerChild() MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPLayerChild(PLayerChild* actor) MOZ_OVERRIDE;
|
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-07-08 08:48:39 -07:00
|
|
|
virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE;
|
2013-12-11 17:44:44 -08:00
|
|
|
|
2014-01-21 14:06:18 -08:00
|
|
|
virtual PTextureChild* AllocPTextureChild(const SurfaceDescriptor& aSharedData,
|
|
|
|
const TextureFlags& aFlags) MOZ_OVERRIDE;
|
2013-12-11 17:44:44 -08:00
|
|
|
virtual bool DeallocPTextureChild(PTextureChild* actor) MOZ_OVERRIDE;
|
|
|
|
|
2014-05-05 18:56:40 -07:00
|
|
|
virtual bool
|
2014-05-14 15:40:15 -07:00
|
|
|
RecvParentAsyncMessage(const InfallibleTArray<AsyncParentMessageData>& aMessages) MOZ_OVERRIDE;
|
2014-05-05 18:56:40 -07:00
|
|
|
|
2013-04-12 13:25:04 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
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 CompositorChild;
|
|
|
|
friend class layout::RenderFrameChild;
|
|
|
|
|
2014-05-28 14:42:16 -07:00
|
|
|
ShadowLayerForwarder* mForwarder;
|
2013-11-27 07:18:38 -08:00
|
|
|
bool mIPCOpen;
|
2014-05-07 06:23:14 -07:00
|
|
|
bool mDestroyed;
|
2014-05-28 14:42:16 -07:00
|
|
|
bool mHasNoCompositor;
|
2010-07-21 14:17:33 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-04-24 11:42:40 -07:00
|
|
|
#endif // MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H
|