2012-07-13 19:38:09 +00: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-08-11 23:17:23 +00: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 09:20:52 +00:00
|
|
|
#include "CompositableTransactionParent.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "gfxPoint.h" // for gfxIntSize
|
|
|
|
#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 19:38:09 +00:00
|
|
|
|
|
|
|
class MessageLoop;
|
|
|
|
|
|
|
|
namespace mozilla {
|
2013-08-11 23:17:23 +00:00
|
|
|
namespace ipc {
|
|
|
|
class Shmem;
|
|
|
|
}
|
|
|
|
|
2012-07-13 19:38:09 +00: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 09:20:52 +00:00
|
|
|
class ImageBridgeParent : public PImageBridgeParent,
|
|
|
|
public CompositableParentManager
|
2012-07-13 19:38:09 +00:00
|
|
|
{
|
2013-02-19 19:27:49 +00:00
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageBridgeParent)
|
2012-07-13 19:38:09 +00:00
|
|
|
|
2013-02-19 19:27:49 +00: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 09:20:52 +00:00
|
|
|
typedef InfallibleTArray<CompositableOperation> EditArray;
|
|
|
|
typedef InfallibleTArray<EditReply> EditReplyArray;
|
|
|
|
|
2013-02-19 19:27:49 +00:00
|
|
|
ImageBridgeParent(MessageLoop* aLoop, Transport* aTransport);
|
2012-07-13 19:38:09 +00:00
|
|
|
~ImageBridgeParent();
|
|
|
|
|
2013-02-19 19:27:49 +00:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
|
|
|
|
2013-09-23 21:54:25 +00:00
|
|
|
static bool
|
2012-08-29 12:24:48 +00:00
|
|
|
Create(Transport* aTransport, ProcessId aOtherProcess);
|
2012-08-17 10:56:55 +00:00
|
|
|
|
|
|
|
virtual PGrallocBufferParent*
|
2013-07-08 15:48:39 +00:00
|
|
|
AllocPGrallocBufferParent(const gfxIntSize&, const uint32_t&, const uint32_t&,
|
|
|
|
MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
|
2012-08-17 10:56:55 +00:00
|
|
|
|
|
|
|
virtual bool
|
2013-07-08 15:48:39 +00:00
|
|
|
DeallocPGrallocBufferParent(PGrallocBufferParent* actor) MOZ_OVERRIDE;
|
2012-08-17 10:56:55 +00: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 09:20:52 +00:00
|
|
|
// PImageBridge
|
|
|
|
virtual bool RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply);
|
|
|
|
virtual bool RecvUpdateNoSwap(const EditArray& aEdits);
|
|
|
|
|
2013-07-08 15:48:39 +00: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 09:20:52 +00:00
|
|
|
|
2012-07-13 19:38:09 +00: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 09:20:52 +00: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);
|
|
|
|
}
|
|
|
|
|
2012-07-13 19:38:09 +00:00
|
|
|
private:
|
2013-02-19 19:27:49 +00: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 19:38:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // layers
|
|
|
|
} // mozilla
|
|
|
|
|