2010-07-22 01:17:33 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
2012-05-21 15:12:37 +04: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-22 01:17:33 +04:00
|
|
|
|
2013-04-24 22:42:40 +04:00
|
|
|
#ifndef MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H
|
|
|
|
#define MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H
|
2010-07-22 01:17:33 +04:00
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
#include <stdint.h> // for uint32_t
|
2015-03-21 19:28:04 +03:00
|
|
|
#include "mozilla/Attributes.h" // for override
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/ipc/ProtocolUtils.h"
|
2013-04-24 22:42:40 +04:00
|
|
|
#include "mozilla/layers/PLayerTransactionChild.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2010-07-22 01:17:33 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2013-11-27 19:18:38 +04:00
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
class RenderFrameChild;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layout
|
2013-11-27 19:18:38 +04:00
|
|
|
|
2010-07-22 01:17:33 +04:00
|
|
|
namespace layers {
|
|
|
|
|
2016-03-06 03:23:06 +03:00
|
|
|
class ShadowLayerForwarder;
|
|
|
|
|
2013-04-24 22:42:40 +04:00
|
|
|
class LayerTransactionChild : public PLayerTransactionChild
|
2010-07-22 01:17:33 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-04-14 23:04:25 +04:00
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(LayerTransactionChild)
|
2010-08-21 03:24:41 +04:00
|
|
|
/**
|
2014-10-13 12:43:59 +04:00
|
|
|
* Clean this up, finishing with SendShutDown() which will cause __delete__
|
|
|
|
* to be sent from the parent side.
|
2010-08-21 03:24:41 +04:00
|
|
|
*
|
|
|
|
* 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-22 01:17:33 +04:00
|
|
|
|
2014-11-14 14:32:47 +03:00
|
|
|
bool IPCOpen() const { return mIPCOpen && !mDestroyed; }
|
2016-09-01 23:27:08 +03:00
|
|
|
bool IsDestroyed() const { return mDestroyed; }
|
2013-11-27 19:18:38 +04:00
|
|
|
|
2014-05-06 05:56:40 +04:00
|
|
|
void SetForwarder(ShadowLayerForwarder* aForwarder)
|
|
|
|
{
|
|
|
|
mForwarder = aForwarder;
|
|
|
|
}
|
|
|
|
|
2015-03-06 14:25:33 +03:00
|
|
|
uint64_t GetId() const { return mId; }
|
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
protected:
|
2015-03-06 14:25:33 +03:00
|
|
|
explicit LayerTransactionChild(const uint64_t& aId)
|
2014-05-29 01:42:16 +04:00
|
|
|
: mForwarder(nullptr)
|
|
|
|
, mIPCOpen(false)
|
2014-05-07 17:23:14 +04:00
|
|
|
, mDestroyed(false)
|
2015-03-06 14:25:33 +03:00
|
|
|
, mId(aId)
|
2013-11-27 19:18:38 +04:00
|
|
|
{}
|
|
|
|
~LayerTransactionChild() { }
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual PLayerChild* AllocPLayerChild() override;
|
|
|
|
virtual bool DeallocPLayerChild(PLayerChild* actor) 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 13:20:52 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) override;
|
|
|
|
virtual bool DeallocPCompositableChild(PCompositableChild* actor) override;
|
2013-12-12 05:44:44 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) override;
|
2013-11-27 19:18:38 +04:00
|
|
|
|
|
|
|
void AddIPDLReference() {
|
|
|
|
MOZ_ASSERT(mIPCOpen == false);
|
|
|
|
mIPCOpen = true;
|
|
|
|
AddRef();
|
|
|
|
}
|
|
|
|
void ReleaseIPDLReference() {
|
|
|
|
MOZ_ASSERT(mIPCOpen == true);
|
|
|
|
mIPCOpen = false;
|
|
|
|
Release();
|
|
|
|
}
|
2016-03-22 21:08:38 +03:00
|
|
|
friend class CompositorBridgeChild;
|
2013-11-27 19:18:38 +04:00
|
|
|
friend class layout::RenderFrameChild;
|
|
|
|
|
2014-05-29 01:42:16 +04:00
|
|
|
ShadowLayerForwarder* mForwarder;
|
2013-11-27 19:18:38 +04:00
|
|
|
bool mIPCOpen;
|
2014-05-07 17:23:14 +04:00
|
|
|
bool mDestroyed;
|
2015-03-06 14:25:33 +03:00
|
|
|
uint64_t mId;
|
2010-07-22 01:17:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-04-24 22:42:40 +04:00
|
|
|
#endif // MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H
|