2012-07-13 12:38:09 -07:00
|
|
|
/* -*- 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/. */
|
|
|
|
|
2013-11-17 18:07:08 -08:00
|
|
|
#ifndef gfx_layers_ipc_ImageBridgeParent_h_
|
|
|
|
#define gfx_layers_ipc_ImageBridgeParent_h_
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
#include <stdint.h> // for uint32_t, uint64_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 "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/ipc/ProtocolUtils.h"
|
|
|
|
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
|
|
|
|
#include "mozilla/layers/PImageBridgeParent.h"
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
|
|
#include "nsISupportsImpl.h"
|
|
|
|
#include "nsTArrayForwardDeclare.h" // for InfallibleTArray
|
2012-07-13 12:38:09 -07:00
|
|
|
|
|
|
|
class MessageLoop;
|
|
|
|
|
2014-04-30 18:52:00 -07:00
|
|
|
namespace base {
|
|
|
|
class Thread;
|
|
|
|
}
|
|
|
|
|
2012-07-13 12:38:09 -07:00
|
|
|
namespace mozilla {
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace ipc {
|
|
|
|
class Shmem;
|
|
|
|
}
|
|
|
|
|
2012-07-13 12:38:09 -07:00
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ImageBridgeParent is the manager Protocol of ImageContainerParent.
|
|
|
|
* It's purpose is mainly to setup the IPDL connection. Most of the
|
|
|
|
* interesting stuff is in ImageContainerParent.
|
|
|
|
*/
|
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 ImageBridgeParent : public PImageBridgeParent,
|
|
|
|
public CompositableParentManager
|
2012-07-13 12:38:09 -07:00
|
|
|
{
|
2013-02-19 11:27:49 -08:00
|
|
|
public:
|
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
|
|
|
typedef InfallibleTArray<CompositableOperation> EditArray;
|
|
|
|
typedef InfallibleTArray<EditReply> EditReplyArray;
|
2014-05-05 18:56:40 -07:00
|
|
|
typedef InfallibleTArray<AsyncChildMessageData> AsyncChildMessageArray;
|
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-02-19 11:27:49 -08:00
|
|
|
ImageBridgeParent(MessageLoop* aLoop, Transport* aTransport);
|
2012-07-13 12:38:09 -07:00
|
|
|
~ImageBridgeParent();
|
|
|
|
|
2014-03-07 13:34:04 -08:00
|
|
|
virtual LayersBackend GetCompositorBackendType() const MOZ_OVERRIDE;
|
|
|
|
|
2013-02-19 11:27:49 -08:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
|
|
|
|
2013-09-25 21:19:09 -07:00
|
|
|
static PImageBridgeParent*
|
2012-08-29 05:24:48 -07:00
|
|
|
Create(Transport* aTransport, ProcessId aOtherProcess);
|
2012-08-17 03:56:55 -07:00
|
|
|
|
2014-05-05 18:56:40 -07:00
|
|
|
// CompositableParentManager
|
|
|
|
virtual void SendFenceHandle(AsyncTransactionTracker* aTracker,
|
|
|
|
PTextureParent* aTexture,
|
|
|
|
const FenceHandle& aFence) 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
|
|
|
// PImageBridge
|
2014-01-17 11:49:39 -08:00
|
|
|
virtual bool RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvUpdateNoSwap(const EditArray& aEdits) 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-11-13 04:25:50 -08:00
|
|
|
virtual bool IsAsync() const MOZ_OVERRIDE { return true; }
|
|
|
|
|
2013-07-08 08:48:39 -07:00
|
|
|
PCompositableParent* AllocPCompositableParent(const TextureInfo& aInfo,
|
|
|
|
uint64_t*) MOZ_OVERRIDE;
|
|
|
|
bool DeallocPCompositableParent(PCompositableParent* aActor) 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
|
|
|
|
2014-01-21 14:06:18 -08:00
|
|
|
virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
|
|
|
const TextureFlags& aFlags) MOZ_OVERRIDE;
|
2013-12-11 17:44:44 -08:00
|
|
|
virtual bool DeallocPTextureParent(PTextureParent* actor) MOZ_OVERRIDE;
|
|
|
|
|
2014-05-05 18:56:40 -07:00
|
|
|
virtual bool
|
|
|
|
RecvChildAsyncMessages(const InfallibleTArray<AsyncChildMessageData>& aMessages) MOZ_OVERRIDE;
|
|
|
|
|
2012-07-13 12:38:09 -07:00
|
|
|
bool RecvStop() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
MessageLoop * GetMessageLoop();
|
|
|
|
|
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
|
|
|
|
|
|
|
|
bool AllocShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return AllocShmem(aSize, aType, aShmem);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool AllocUnsafeShmem(size_t aSize,
|
|
|
|
ipc::SharedMemory::SharedMemoryType aType,
|
|
|
|
ipc::Shmem* aShmem) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return AllocUnsafeShmem(aSize, aType, aShmem);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DeallocShmem(ipc::Shmem& aShmem) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
PImageBridgeParent::DeallocShmem(aShmem);
|
|
|
|
}
|
|
|
|
|
2014-02-25 05:12:49 -08:00
|
|
|
virtual bool IsSameProcess() const MOZ_OVERRIDE;
|
|
|
|
|
2014-05-12 07:39:25 -07:00
|
|
|
virtual void ReplyRemoveTexture(const OpReplyRemoveTexture& aReply) MOZ_OVERRIDE;
|
|
|
|
|
2013-06-03 03:14:37 -07:00
|
|
|
// Overriden from IToplevelProtocol
|
|
|
|
IToplevelProtocol*
|
|
|
|
CloneToplevel(const InfallibleTArray<ProtocolFdMapping>& aFds,
|
|
|
|
base::ProcessHandle aPeerProcess,
|
|
|
|
mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
|
|
|
|
|
2012-07-13 12:38:09 -07:00
|
|
|
private:
|
2013-02-19 11:27:49 -08:00
|
|
|
void DeferredDestroy();
|
|
|
|
|
|
|
|
MessageLoop* mMessageLoop;
|
|
|
|
Transport* mTransport;
|
|
|
|
// This keeps us alive until ActorDestroy(), at which point we do a
|
|
|
|
// deferred destruction of ourselves.
|
|
|
|
nsRefPtr<ImageBridgeParent> mSelfRef;
|
2012-07-13 12:38:09 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // layers
|
|
|
|
} // mozilla
|
|
|
|
|
2013-11-17 18:07:08 -08:00
|
|
|
#endif // gfx_layers_ipc_ImageBridgeParent_h_
|