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
|
|
|
/* -*- 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/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_BUFFERCLIENT_H
|
|
|
|
#define MOZILLA_GFX_BUFFERCLIENT_H
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stdint.h> // for uint64_t
|
|
|
|
#include <vector> // for vector
|
2013-09-12 07:50:28 -07:00
|
|
|
#include <map> // for map
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/Assertions.h" // for MOZ_CRASH
|
|
|
|
#include "mozilla/RefPtr.h" // for TemporaryRef, RefCounted
|
|
|
|
#include "mozilla/gfx/Types.h" // for SurfaceFormat
|
2014-05-24 09:14:45 -07:00
|
|
|
#include "mozilla/layers/AsyncTransactionTracker.h" // for AsyncTransactionTracker
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
|
|
|
#include "mozilla/layers/LayersTypes.h" // for LayersBackend
|
2014-05-24 09:14:45 -07:00
|
|
|
#include "mozilla/layers/TextureClient.h" // for TextureClient
|
2014-02-26 13:36:35 -08:00
|
|
|
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
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
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
class CompositableClient;
|
2013-07-30 02:59:51 -07:00
|
|
|
class BufferTextureClient;
|
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 ImageBridgeChild;
|
|
|
|
class CompositableForwarder;
|
|
|
|
class CompositableChild;
|
2013-06-05 15:14:51 -07:00
|
|
|
class SurfaceDescriptor;
|
2014-04-28 04:29:13 -07:00
|
|
|
class PCompositableChild;
|
2014-05-24 09:14:45 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle RemoveTextureFromCompositableAsync() transaction.
|
|
|
|
*/
|
|
|
|
class RemoveTextureFromCompositableTracker : public AsyncTransactionTracker {
|
|
|
|
public:
|
2014-06-05 07:24:05 -07:00
|
|
|
RemoveTextureFromCompositableTracker()
|
2014-05-24 09:14:45 -07:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(RemoveTextureFromCompositableTracker);
|
|
|
|
}
|
|
|
|
|
|
|
|
~RemoveTextureFromCompositableTracker()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(RemoveTextureFromCompositableTracker);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Complete() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
// The TextureClient's recycling is postponed until the transaction
|
|
|
|
// complete.
|
|
|
|
mTextureClient = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Cancel() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mTextureClient = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SetTextureClient(TextureClient* aTextureClient) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mTextureClient = aTextureClient;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SetReleaseFenceHandle(FenceHandle& aReleaseFenceHandle) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
if (mTextureClient) {
|
|
|
|
mTextureClient->SetReleaseFenceHandle(aReleaseFenceHandle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
RefPtr<TextureClient> mTextureClient;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* CompositableClient manages the texture-specific logic for composite layers,
|
2013-07-08 21:21:06 -07:00
|
|
|
* independently of the layer. It is the content side of a CompositableClient/
|
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
|
|
|
* CompositableHost pair.
|
|
|
|
*
|
|
|
|
* CompositableClient's purpose is to send texture data to the compositor side
|
|
|
|
* along with any extra information about how the texture is to be composited.
|
|
|
|
* Things like opacity or transformation belong to layer and not compositable.
|
|
|
|
*
|
|
|
|
* Since Compositables are independent of layers it is possible to create one,
|
|
|
|
* connect it to the compositor side, and start sending images to it. This alone
|
|
|
|
* is arguably not very useful, but it means that as long as a shadow layer can
|
|
|
|
* do the proper magic to find a reference to the right CompositableHost on the
|
|
|
|
* Compositor side, a Compositable client can be used outside of the main
|
|
|
|
* shadow layer forwarder machinery that is used on the main thread.
|
|
|
|
*
|
|
|
|
* The first step is to create a Compositable client and call Connect().
|
|
|
|
* Connect() creates the underlying IPDL actor (see CompositableChild) and the
|
|
|
|
* corresponding CompositableHost on the other side.
|
|
|
|
*
|
|
|
|
* To do in-transaction texture transfer (the default), call
|
|
|
|
* ShadowLayerForwarder::Attach(CompositableClient*, ShadowableLayer*). This
|
2013-04-25 15:25:33 -07:00
|
|
|
* will let the LayerComposite on the compositor side know which CompositableHost
|
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
|
|
|
* to use for compositing.
|
|
|
|
*
|
|
|
|
* To do async texture transfer (like async-video), the CompositableClient
|
|
|
|
* should be created with a different CompositableForwarder (like
|
|
|
|
* ImageBridgeChild) and attachment is done with
|
|
|
|
* CompositableForwarder::AttachAsyncCompositable that takes an identifier
|
|
|
|
* instead of a CompositableChild, since the CompositableClient is not managed
|
|
|
|
* by this layer forwarder (the matching uses a global map on the compositor side,
|
|
|
|
* see CompositableMap in ImageBridgeParent.cpp)
|
|
|
|
*
|
|
|
|
* Subclasses: Thebes layers use ContentClients, ImageLayers use ImageClients,
|
|
|
|
* Canvas layers use CanvasClients (but ImageHosts). We have a different subclass
|
|
|
|
* where we have a different way of interfacing with the textures - in terms of
|
|
|
|
* drawing into the compositable and/or passing its contents to the compostior.
|
|
|
|
*/
|
2014-04-14 12:04:25 -07:00
|
|
|
class CompositableClient
|
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-04-14 12:04:25 -07:00
|
|
|
protected:
|
|
|
|
virtual ~CompositableClient();
|
|
|
|
|
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
|
|
|
public:
|
2014-04-14 12:04:25 -07:00
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositableClient)
|
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-04-25 19:34:05 -07:00
|
|
|
CompositableClient(CompositableForwarder* aForwarder, TextureFlags aFlags = TextureFlags::NO_FLAGS);
|
2014-04-14 13:16:18 -07:00
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
virtual TextureInfo GetTextureInfo() const = 0;
|
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
|
|
|
|
|
|
|
LayersBackend GetCompositorBackendType() const;
|
|
|
|
|
2014-03-07 13:34:04 -08:00
|
|
|
TemporaryRef<BufferTextureClient>
|
2013-10-13 17:24:12 -07:00
|
|
|
CreateBufferTextureClient(gfx::SurfaceFormat aFormat,
|
2014-04-25 19:34:05 -07:00
|
|
|
TextureFlags aFlags = TextureFlags::DEFAULT,
|
2014-03-17 14:35:20 -07:00
|
|
|
gfx::BackendType aMoz2dBackend = gfx::BackendType::NONE);
|
2013-07-30 02:59:51 -07:00
|
|
|
|
2013-12-05 10:39:22 -08:00
|
|
|
TemporaryRef<TextureClient>
|
|
|
|
CreateTextureClientForDrawing(gfx::SurfaceFormat aFormat,
|
2014-03-12 05:16:37 -07:00
|
|
|
TextureFlags aTextureFlags,
|
2014-03-17 14:35:20 -07:00
|
|
|
gfx::BackendType aMoz2dBackend,
|
2014-03-12 05:16:37 -07:00
|
|
|
const gfx::IntSize& aSizeHint);
|
2013-12-05 10:39:22 -08:00
|
|
|
|
2013-04-12 00:28:55 -07:00
|
|
|
virtual void SetDescriptorFromReply(TextureIdentifier aTextureId,
|
|
|
|
const SurfaceDescriptor& aDescriptor)
|
|
|
|
{
|
2013-06-28 18:38:30 -07:00
|
|
|
MOZ_CRASH("If you want to call this, you should have implemented it");
|
2013-04-12 00:28:55 -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
|
|
|
|
|
|
|
/**
|
|
|
|
* Establishes the connection with compositor side through IPDL
|
|
|
|
*/
|
|
|
|
virtual bool Connect();
|
|
|
|
|
|
|
|
void Destroy();
|
|
|
|
|
2014-04-24 11:13:59 -07:00
|
|
|
PCompositableChild* GetIPDLActor() const;
|
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
|
|
|
|
|
|
|
// should only be called by a CompositableForwarder
|
2013-08-20 18:27:05 -07:00
|
|
|
virtual void SetIPDLActor(CompositableChild* aChild);
|
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
|
|
|
|
|
|
|
CompositableForwarder* GetForwarder() const
|
|
|
|
{
|
|
|
|
return mForwarder;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This identifier is what lets us attach async compositables with a shadow
|
2013-09-30 05:42:47 -07:00
|
|
|
* layer. It is not used if the compositable is used with the regular shadow
|
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
|
|
|
* layer forwarder.
|
2013-09-30 05:42:47 -07:00
|
|
|
*
|
|
|
|
* If this returns zero, it means the compositable is not async (it is used
|
|
|
|
* on the main thread).
|
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
|
|
|
*/
|
|
|
|
uint64_t GetAsyncID() const;
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
/**
|
|
|
|
* Tells the Compositor to create a TextureHost for this TextureClient.
|
|
|
|
*/
|
2013-10-09 16:18:29 -07:00
|
|
|
virtual bool AddTextureClient(TextureClient* aClient);
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
/**
|
2013-08-08 05:53:12 -07:00
|
|
|
* A hook for the Compositable to execute whatever it held off for next transaction.
|
2013-07-30 02:59:51 -07:00
|
|
|
*/
|
|
|
|
virtual void OnTransaction();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A hook for the when the Compositable is detached from it's layer.
|
|
|
|
*/
|
2013-08-08 05:53:12 -07:00
|
|
|
virtual void OnDetach() {}
|
2013-07-30 02:59:51 -07:00
|
|
|
|
2014-03-07 13:34:04 -08:00
|
|
|
/**
|
|
|
|
* Clear any resources that are not immediately necessary. This may be called
|
|
|
|
* in low-memory conditions.
|
|
|
|
*/
|
|
|
|
virtual void ClearCachedResources() {}
|
|
|
|
|
2014-06-08 06:18:53 -07:00
|
|
|
virtual void UseTexture(TextureClient* aTexture);
|
|
|
|
|
2014-05-16 08:25:23 -07:00
|
|
|
/**
|
|
|
|
* Should be called when deataching a TextureClient from a Compositable, because
|
|
|
|
* some platforms need to do some extra book keeping when this happens (for
|
|
|
|
* example to properly keep track of fences on Gonk).
|
|
|
|
*
|
|
|
|
* See AutoRemoveTexture to automatically invoke this at the end of a scope.
|
|
|
|
*/
|
|
|
|
virtual void RemoveTexture(TextureClient* aTexture);
|
|
|
|
|
2014-04-24 11:13:59 -07:00
|
|
|
static CompositableClient* FromIPDLActor(PCompositableChild* aActor);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocate and deallocate a CompositableChild actor.
|
|
|
|
*
|
|
|
|
* CompositableChild is an implementation detail of CompositableClient that is not
|
|
|
|
* exposed to the rest of the code base. CreateIPDLActor and DestroyIPDLActor
|
|
|
|
* are for use with the managing IPDL protocols only (so that they can
|
|
|
|
* implement AllocCompositableChild and DeallocPCompositableChild).
|
|
|
|
*/
|
|
|
|
static PCompositableChild* CreateIPDLActor();
|
|
|
|
|
|
|
|
static bool DestroyIPDLActor(PCompositableChild* actor);
|
|
|
|
|
|
|
|
void InitIPDLActor(PCompositableChild* aActor, uint64_t aAsyncID = 0);
|
|
|
|
|
2014-05-12 07:39:25 -07:00
|
|
|
static void TransactionCompleteted(PCompositableChild* aActor, uint64_t aTransactionId);
|
|
|
|
|
|
|
|
static void HoldUntilComplete(PCompositableChild* aActor, AsyncTransactionTracker* aTracker);
|
|
|
|
|
2014-05-24 09:14:45 -07:00
|
|
|
static uint64_t GetTrackersHolderId(PCompositableChild* aActor);
|
|
|
|
|
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
|
|
|
protected:
|
|
|
|
CompositableChild* mCompositableChild;
|
|
|
|
CompositableForwarder* mForwarder;
|
2014-03-07 13:34:04 -08:00
|
|
|
// Some layers may want to enforce some flags to all their textures
|
|
|
|
// (like disallowing tiling)
|
|
|
|
TextureFlags mTextureFlags;
|
2013-12-11 17:45:09 -08:00
|
|
|
|
|
|
|
friend class CompositableChild;
|
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-05-16 08:25:23 -07:00
|
|
|
/**
|
|
|
|
* Helper to call RemoveTexture at the end of a scope.
|
|
|
|
*/
|
|
|
|
struct AutoRemoveTexture
|
|
|
|
{
|
|
|
|
AutoRemoveTexture(CompositableClient* aCompositable,
|
|
|
|
TextureClient* aTexture = nullptr)
|
|
|
|
: mTexture(aTexture)
|
|
|
|
, mCompositable(aCompositable)
|
|
|
|
{}
|
|
|
|
|
|
|
|
~AutoRemoveTexture()
|
|
|
|
{
|
|
|
|
if (mCompositable && mTexture) {
|
|
|
|
mCompositable->RemoveTexture(mTexture);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<TextureClient> mTexture;
|
|
|
|
private:
|
|
|
|
CompositableClient* mCompositable;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
} // namespace
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|