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_BUFFERHOST_H
|
|
|
|
#define MOZILLA_GFX_BUFFERHOST_H
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stdint.h> // for uint64_t
|
|
|
|
#include <stdio.h> // for FILE
|
|
|
|
#include "gfxPoint.h" // for gfxSize
|
|
|
|
#include "gfxRect.h" // for gfxRect
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr, RefCounted, etc
|
|
|
|
#include "mozilla/gfx/Point.h" // for Point
|
|
|
|
#include "mozilla/gfx/Rect.h" // for Rect
|
|
|
|
#include "mozilla/gfx/Types.h" // for Filter
|
|
|
|
#include "mozilla/ipc/ProtocolUtils.h"
|
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for TextureInfo, etc
|
|
|
|
#include "mozilla/layers/LayersTypes.h" // for LayerRenderState, 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
|
|
|
#include "mozilla/layers/PCompositableParent.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
|
|
|
#include "nscore.h" // for nsACString
|
2013-11-27 09:33:27 -08:00
|
|
|
#include "Units.h" // for CSSToScreenScale
|
2013-08-11 16:17:23 -07:00
|
|
|
|
|
|
|
struct nsIntPoint;
|
|
|
|
struct nsIntRect;
|
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 {
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace gfx {
|
|
|
|
class Matrix4x4;
|
2013-11-27 01:59:01 -08:00
|
|
|
class DataSourceSurface;
|
2013-08-11 16:17:23 -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
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
// Some properties of a Layer required for tiling
|
|
|
|
struct TiledLayerProperties
|
|
|
|
{
|
|
|
|
nsIntRegion mVisibleRegion;
|
|
|
|
nsIntRegion mValidRegion;
|
2013-11-27 09:33:27 -08:00
|
|
|
CSSToScreenScale mEffectiveResolution;
|
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 Layer;
|
2013-07-08 14:30:44 -07:00
|
|
|
class DeprecatedTextureHost;
|
2013-07-30 02:59:51 -07:00
|
|
|
class TextureHost;
|
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 SurfaceDescriptor;
|
2013-08-11 16:17:23 -07:00
|
|
|
class Compositor;
|
|
|
|
class ISurfaceAllocator;
|
|
|
|
class ThebesBufferData;
|
|
|
|
class TiledLayerComposer;
|
|
|
|
struct EffectChain;
|
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-09-12 19:39:26 -07:00
|
|
|
/**
|
|
|
|
* A base class for doing CompositableHost and platform dependent task on TextureHost.
|
|
|
|
*/
|
2013-09-30 05:14:38 -07:00
|
|
|
class CompositableBackendSpecificData : public RefCounted<CompositableBackendSpecificData>
|
2013-09-12 19:39:26 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-09-30 05:14:38 -07:00
|
|
|
CompositableBackendSpecificData()
|
2013-09-12 19:39:26 -07:00
|
|
|
{
|
2013-09-30 05:14:38 -07:00
|
|
|
MOZ_COUNT_CTOR(CompositableBackendSpecificData);
|
2013-09-12 19:39:26 -07:00
|
|
|
}
|
2013-09-30 05:14:38 -07:00
|
|
|
virtual ~CompositableBackendSpecificData()
|
2013-09-12 19:39:26 -07:00
|
|
|
{
|
2013-09-30 05:14:38 -07:00
|
|
|
MOZ_COUNT_DTOR(CompositableBackendSpecificData);
|
2013-09-12 19:39:26 -07:00
|
|
|
}
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) {}
|
2013-10-17 08:09:15 -07:00
|
|
|
virtual void ClearData() {}
|
2013-09-12 19:39:26 -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
|
|
|
/**
|
|
|
|
* The compositor-side counterpart to CompositableClient. Responsible for
|
|
|
|
* updating textures and data about textures from IPC and how textures are
|
|
|
|
* composited (tiling, double buffering, etc.).
|
|
|
|
*
|
|
|
|
* Update (for images/canvases) and UpdateThebes (for Thebes) are called during
|
|
|
|
* the layers transaction to update the Compositbale's textures from the
|
|
|
|
* content side. The actual update (and any syncronous upload) is done by the
|
|
|
|
* TextureHost, but it is coordinated by the CompositableHost.
|
|
|
|
*
|
|
|
|
* Composite is called by the owning layer when it is composited. CompositableHost
|
|
|
|
* will use its TextureHost(s) and call Compositor::DrawQuad to do the actual
|
|
|
|
* rendering.
|
|
|
|
*/
|
|
|
|
class CompositableHost : public RefCounted<CompositableHost>
|
|
|
|
{
|
|
|
|
public:
|
2013-07-30 02:59:51 -07:00
|
|
|
CompositableHost(const TextureInfo& aTextureInfo);
|
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-30 02:59:51 -07:00
|
|
|
virtual ~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
|
|
|
|
2013-04-16 14:36:06 -07:00
|
|
|
static TemporaryRef<CompositableHost> Create(const TextureInfo& aTextureInfo);
|
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
|
|
|
|
|
|
|
virtual CompositableType GetType() = 0;
|
|
|
|
|
2013-09-30 05:14:38 -07:00
|
|
|
virtual CompositableBackendSpecificData* GetCompositableBackendSpecificData()
|
|
|
|
{
|
|
|
|
return mBackendData;
|
|
|
|
}
|
2013-09-12 19:39:26 -07:00
|
|
|
|
2013-09-30 05:14:38 -07:00
|
|
|
virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
2013-09-12 19:39:26 -07:00
|
|
|
{
|
2013-09-30 05:14:38 -07:00
|
|
|
mBackendData = aBackendData;
|
2013-09-12 19:39:26 -07:00
|
|
|
}
|
|
|
|
|
2013-09-27 02:48:42 -07:00
|
|
|
/**
|
|
|
|
* Our IPDL actor is being destroyed, get rid of any shmem resources now and
|
|
|
|
* don't worry about compositing anymore.
|
|
|
|
*/
|
2013-12-04 09:19:50 -08:00
|
|
|
virtual void OnActorDestroy() = 0;
|
2013-09-27 02:48:42 -07:00
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
// If base class overrides, it should still call the parent implementation
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor);
|
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
|
|
|
|
|
|
|
// composite the contents of this buffer host to the compositor's surface
|
|
|
|
virtual void Composite(EffectChain& aEffectChain,
|
|
|
|
float aOpacity,
|
|
|
|
const gfx::Matrix4x4& aTransform,
|
|
|
|
const gfx::Filter& aFilter,
|
|
|
|
const gfx::Rect& aClipRect,
|
|
|
|
const nsIntRegion* aVisibleRegion = nullptr,
|
|
|
|
TiledLayerProperties* aLayerProperties = nullptr) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return true if we should schedule a composition.
|
|
|
|
*/
|
|
|
|
virtual bool Update(const SurfaceDescriptor& aImage,
|
|
|
|
SurfaceDescriptor* aResult = nullptr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the content host.
|
|
|
|
* aUpdated is the region which should be updated
|
|
|
|
* aUpdatedRegionBack is the region in aNewBackResult which has been updated
|
|
|
|
*/
|
|
|
|
virtual void UpdateThebes(const ThebesBufferData& aData,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(false, "should be implemented or not used");
|
|
|
|
}
|
|
|
|
|
2013-05-15 20:45:43 -07:00
|
|
|
/**
|
|
|
|
* Update the content host using a surface that only contains the updated
|
|
|
|
* region.
|
|
|
|
*
|
|
|
|
* Takes ownership of aSurface, and is responsible for freeing it.
|
|
|
|
*
|
|
|
|
* @param aTextureId Texture to update.
|
|
|
|
* @param aSurface Surface containing the update area. Its contents are relative
|
|
|
|
* to aUpdated.TopLeft()
|
|
|
|
* @param aUpdated Area of the content host to update.
|
|
|
|
* @param aBufferRect New area covered by the content host.
|
|
|
|
* @param aBufferRotation New buffer rotation.
|
|
|
|
*/
|
|
|
|
virtual void UpdateIncremental(TextureIdentifier aTextureId,
|
|
|
|
SurfaceDescriptor& aSurface,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRect& aBufferRect,
|
|
|
|
const nsIntPoint& aBufferRotation)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(false, "should be implemented or not used");
|
|
|
|
}
|
|
|
|
|
2013-04-12 00:28:55 -07:00
|
|
|
/**
|
|
|
|
* Ensure that a suitable texture host exists in this compositable. The
|
|
|
|
* compositable host may or may not create a new texture host. If a texture
|
|
|
|
* host is replaced, then the compositable is responsible for enusring it is
|
|
|
|
* destroyed correctly (without leaking resources).
|
|
|
|
* aTextureId - identifies the texture within the compositable, how the
|
|
|
|
* compositable chooses to use this is between the compositable client and
|
|
|
|
* host and will vary between types of compositable.
|
|
|
|
* aSurface - the new or existing texture host should support surface
|
|
|
|
* descriptors of the same type and, if necessary, this specific surface
|
|
|
|
* descriptor. Whether it is necessary or not depends on the protocol between
|
|
|
|
* the compositable client and host.
|
|
|
|
* aAllocator - the allocator used to allocate and de-allocate resources.
|
|
|
|
* aTextureInfo - contains flags for the texture.
|
|
|
|
*/
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual void EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
|
2013-04-12 00:28:55 -07:00
|
|
|
const SurfaceDescriptor& aSurface,
|
|
|
|
ISurfaceAllocator* aAllocator,
|
2013-07-30 02:59:51 -07:00
|
|
|
const TextureInfo& aTextureInfo)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(false, "should be implemented or not used");
|
|
|
|
}
|
2013-04-12 00:28:55 -07:00
|
|
|
|
2013-05-15 20:45:43 -07:00
|
|
|
/**
|
|
|
|
* Ensure that a suitable texture host exists in this compsitable.
|
|
|
|
*
|
|
|
|
* Only used with ContentHostIncremental.
|
|
|
|
*
|
|
|
|
* No SurfaceDescriptor or TextureIdentifier is provider as we
|
|
|
|
* don't have a single surface for the texture contents, and we
|
|
|
|
* need to allocate our own one to be updated later.
|
|
|
|
*/
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual void EnsureDeprecatedTextureHostIncremental(ISurfaceAllocator* aAllocator,
|
2013-05-30 21:36:19 -07:00
|
|
|
const TextureInfo& aTextureInfo,
|
|
|
|
const nsIntRect& aBufferRect)
|
2013-05-15 20:45:43 -07:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(false, "should be implemented or not used");
|
|
|
|
}
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual DeprecatedTextureHost* GetDeprecatedTextureHost() { return nullptr; }
|
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-30 02:59:51 -07:00
|
|
|
/**
|
|
|
|
* Returns the front buffer.
|
|
|
|
*/
|
2013-12-04 09:19:50 -08:00
|
|
|
virtual TextureHost* GetTextureHost() { return nullptr; }
|
2013-07-30 02:59:51 -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
|
|
|
virtual LayerRenderState GetRenderState() = 0;
|
|
|
|
|
|
|
|
virtual void SetPictureRect(const nsIntRect& aPictureRect)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(false, "Should have been overridden");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a mask effect using this texture as the mask, if possible.
|
|
|
|
* @return true if the effect was added, false otherwise.
|
|
|
|
*/
|
|
|
|
bool AddMaskEffect(EffectChain& aEffects,
|
|
|
|
const gfx::Matrix4x4& aTransform,
|
|
|
|
bool aIs3D = false);
|
|
|
|
|
2013-08-01 18:12:16 -07:00
|
|
|
void RemoveMaskEffect();
|
|
|
|
|
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
|
|
|
Compositor* GetCompositor() const
|
|
|
|
{
|
|
|
|
return mCompositor;
|
|
|
|
}
|
|
|
|
|
|
|
|
Layer* GetLayer() const { return mLayer; }
|
|
|
|
void SetLayer(Layer* aLayer) { mLayer = aLayer; }
|
|
|
|
|
2013-04-16 14:36:06 -07:00
|
|
|
virtual TiledLayerComposer* AsTiledLayerComposer() { return nullptr; }
|
|
|
|
|
2013-08-20 18:28:53 -07:00
|
|
|
typedef uint32_t AttachFlags;
|
|
|
|
static const AttachFlags NO_FLAGS = 0;
|
|
|
|
static const AttachFlags ALLOW_REATTACH = 1;
|
|
|
|
static const AttachFlags KEEP_ATTACHED = 2;
|
2013-09-27 02:48:42 -07:00
|
|
|
static const AttachFlags FORCE_DETACH = 2;
|
2013-08-20 18:28:53 -07:00
|
|
|
|
|
|
|
virtual void Attach(Layer* aLayer,
|
|
|
|
Compositor* aCompositor,
|
|
|
|
AttachFlags aFlags = NO_FLAGS)
|
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-06-13 13:19:39 -07:00
|
|
|
MOZ_ASSERT(aCompositor, "Compositor is required");
|
2013-08-20 18:28:53 -07:00
|
|
|
NS_ASSERTION(aFlags & ALLOW_REATTACH || !mAttached,
|
|
|
|
"Re-attaching compositables must be explicitly authorised");
|
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
|
|
|
SetCompositor(aCompositor);
|
|
|
|
SetLayer(aLayer);
|
2013-08-04 00:46:17 -07:00
|
|
|
mAttached = true;
|
2013-08-20 18:28:53 -07:00
|
|
|
mKeepAttached = aFlags & KEEP_ATTACHED;
|
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-08-20 18:28:53 -07:00
|
|
|
// Detach this compositable host from its layer.
|
|
|
|
// If we are used for async video, then it is not safe to blindly detach since
|
|
|
|
// we might be re-attached to a different layer. aLayer is the layer which the
|
|
|
|
// caller expects us to be attached to, we will only detach if we are in fact
|
|
|
|
// attached to that layer. If we are part of a normal layer, then we will be
|
|
|
|
// detached in any case. if aLayer is null, then we will only detach if we are
|
|
|
|
// not async.
|
2013-09-27 02:48:42 -07:00
|
|
|
// Only force detach if the IPDL tree is being shutdown.
|
|
|
|
void Detach(Layer* aLayer = nullptr, AttachFlags aFlags = NO_FLAGS)
|
2013-08-04 00:46:17 -07:00
|
|
|
{
|
2013-08-20 18:28:53 -07:00
|
|
|
if (!mKeepAttached ||
|
2013-09-27 02:48:42 -07:00
|
|
|
aLayer == mLayer ||
|
|
|
|
aFlags & FORCE_DETACH) {
|
2013-08-20 18:28:53 -07:00
|
|
|
SetLayer(nullptr);
|
|
|
|
SetCompositor(nullptr);
|
|
|
|
mAttached = false;
|
|
|
|
mKeepAttached = false;
|
2013-11-06 05:44:57 -08:00
|
|
|
if (mBackendData) {
|
|
|
|
mBackendData->ClearData();
|
|
|
|
}
|
2013-08-20 18:28:53 -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
|
|
|
}
|
2013-08-04 00:46:17 -07:00
|
|
|
bool IsAttached() { return mAttached; }
|
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-08-08 05:53:12 -07:00
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
2013-07-20 01:48:55 -07:00
|
|
|
virtual void Dump(FILE* aFile=nullptr,
|
2013-05-25 19:44:24 -07:00
|
|
|
const char* aPrefix="",
|
|
|
|
bool aDumpHtml=false) { }
|
2013-07-08 14:30:44 -07:00
|
|
|
static void DumpDeprecatedTextureHost(FILE* aFile, DeprecatedTextureHost* aTexture);
|
2013-07-30 02:59:51 -07:00
|
|
|
static void DumpTextureHost(FILE* aFile, TextureHost* aTexture);
|
2013-05-25 19:44:24 -07:00
|
|
|
|
2013-11-27 01:59:01 -08:00
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() { return nullptr; }
|
2013-05-25 19:43:43 -07:00
|
|
|
#endif
|
|
|
|
|
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
|
|
|
virtual void PrintInfo(nsACString& aTo, const char* aPrefix) { }
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
void AddTextureHost(TextureHost* aTexture);
|
|
|
|
virtual void UseTextureHost(TextureHost* aTexture) {}
|
2013-12-04 09:19:50 -08:00
|
|
|
virtual void RemoveTextureHost(uint64_t aTextureID);
|
2013-07-30 02:59:51 -07:00
|
|
|
TextureHost* GetTextureHost(uint64_t aTextureID);
|
|
|
|
|
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:
|
2013-04-12 00:28:55 -07:00
|
|
|
TextureInfo mTextureInfo;
|
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
|
|
|
Compositor* mCompositor;
|
|
|
|
Layer* mLayer;
|
2013-09-30 05:14:38 -07:00
|
|
|
RefPtr<CompositableBackendSpecificData> mBackendData;
|
2013-07-30 02:59:51 -07:00
|
|
|
RefPtr<TextureHost> mFirstTexture;
|
2013-08-04 00:46:17 -07:00
|
|
|
bool mAttached;
|
2013-08-20 18:28:53 -07:00
|
|
|
bool mKeepAttached;
|
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 CompositableParentManager;
|
|
|
|
|
2013-09-30 05:42:47 -07:00
|
|
|
/**
|
|
|
|
* IPDL actor used by CompositableHost to match with its corresponding
|
|
|
|
* CompositableClient on the content side.
|
|
|
|
*
|
|
|
|
* CompositableParent is owned by the IPDL system. It's deletion is triggered
|
|
|
|
* by either the CompositableChild's deletion, or by the IPDL communication
|
|
|
|
* goind down.
|
|
|
|
*/
|
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 CompositableParent : public PCompositableParent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CompositableParent(CompositableParentManager* aMgr,
|
2013-04-12 00:28:55 -07:00
|
|
|
const TextureInfo& aTextureInfo,
|
|
|
|
uint64_t aID = 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
|
|
|
~CompositableParent();
|
|
|
|
|
2013-04-11 03:14:29 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) 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
|
|
|
CompositableHost* GetCompositableHost() const
|
|
|
|
{
|
|
|
|
return mHost;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetCompositableHost(CompositableHost* aHost)
|
|
|
|
{
|
|
|
|
mHost = aHost;
|
|
|
|
}
|
|
|
|
|
|
|
|
CompositableType GetType() const
|
|
|
|
{
|
|
|
|
return mType;
|
|
|
|
}
|
|
|
|
|
|
|
|
CompositableParentManager* GetCompositableManager() const
|
|
|
|
{
|
|
|
|
return mManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetCompositorID(uint64_t aCompositorID)
|
|
|
|
{
|
|
|
|
mCompositorID = aCompositorID;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t GetCompositorID() const
|
|
|
|
{
|
|
|
|
return mCompositorID;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
RefPtr<CompositableHost> mHost;
|
|
|
|
CompositableParentManager* mManager;
|
|
|
|
CompositableType mType;
|
|
|
|
uint64_t mID;
|
|
|
|
uint64_t mCompositorID;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Global CompositableMap, to use in the compositor thread only.
|
|
|
|
*
|
|
|
|
* PCompositable and PLayer can, in the case of async textures, be managed by
|
|
|
|
* different top level protocols. In this case they don't share the same
|
|
|
|
* communication channel and we can't send an OpAttachCompositable (PCompositable,
|
|
|
|
* PLayer) message.
|
|
|
|
*
|
|
|
|
* In order to attach a layer and the right compositable if the the compositable
|
|
|
|
* is async, we store references to the async compositables in a CompositableMap
|
|
|
|
* that is accessed only on the compositor thread. During a layer transaction we
|
|
|
|
* send the message OpAttachAsyncCompositable(ID, PLayer), and on the compositor
|
|
|
|
* side we lookup the ID in the map and attach the correspondig compositable to
|
|
|
|
* the layer.
|
|
|
|
*
|
|
|
|
* CompositableMap must be global because the image bridge doesn't have any
|
2013-04-24 11:42:40 -07:00
|
|
|
* reference to whatever we have created with PLayerTransaction. So, the only way to
|
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
|
|
|
* actually connect these two worlds is to have something global that they can
|
|
|
|
* both query (in the same thread). The map is not allocated the map on the
|
|
|
|
* stack to avoid the badness of static initialization.
|
|
|
|
*
|
2013-04-24 11:42:40 -07:00
|
|
|
* Also, we have a compositor/PLayerTransaction protocol/etc. per layer manager, and the
|
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
|
|
|
* ImageBridge is used by all the existing compositors that have a video, so
|
|
|
|
* there isn't an instance or "something" that lives outside the boudaries of a
|
|
|
|
* given layer manager on the compositor thread except the image bridge and the
|
|
|
|
* thread itself.
|
|
|
|
*/
|
|
|
|
namespace CompositableMap {
|
|
|
|
void Create();
|
|
|
|
void Destroy();
|
|
|
|
CompositableParent* Get(uint64_t aID);
|
|
|
|
void Set(uint64_t aID, CompositableParent* aParent);
|
|
|
|
void Erase(uint64_t aID);
|
|
|
|
void Clear();
|
|
|
|
} // CompositableMap
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|