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
|
|
|
/* -*- 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_TEXTUREHOST_H
|
|
|
|
#define MOZILLA_GFX_TEXTUREHOST_H
|
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
#include <stdint.h> // for uint64_t, uint32_t, uint8_t
|
|
|
|
#include "gfxASurface.h" // for gfxASurface, etc
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef, etc
|
|
|
|
#include "mozilla/gfx/2D.h" // for DataSourceSurface
|
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize, IntPoint
|
|
|
|
#include "mozilla/gfx/Types.h" // for SurfaceFormat, etc
|
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for TextureFlags, etc
|
|
|
|
#include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
|
|
|
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
|
|
|
|
#include "nscore.h" // for nsACString
|
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
|
|
|
|
2013-08-12 06:21:17 +04:00
|
|
|
class gfxImageSurface;
|
2013-08-12 03:17:23 +04:00
|
|
|
class gfxReusableSurfaceWrapper;
|
|
|
|
struct nsIntPoint;
|
|
|
|
struct nsIntSize;
|
2013-09-07 06:15:49 +04:00
|
|
|
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 13:20:52 +04:00
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
namespace mozilla {
|
2013-08-12 03:17:23 +04:00
|
|
|
namespace ipc {
|
|
|
|
class Shmem;
|
2013-07-30 13:59:51 +04: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 13:20:52 +04:00
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
class Compositor;
|
2013-09-13 06:39:26 +04:00
|
|
|
class CompositableHost;
|
|
|
|
class CompositableQuirks;
|
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
|
|
|
class SurfaceDescriptor;
|
|
|
|
class ISurfaceAllocator;
|
|
|
|
class TextureSourceOGL;
|
2013-08-04 11:46:17 +04:00
|
|
|
class TextureSourceD3D9;
|
2013-05-03 21:34:29 +04:00
|
|
|
class TextureSourceD3D11;
|
2013-05-01 04:42:05 +04:00
|
|
|
class TextureSourceBasic;
|
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
|
|
|
class TextureParent;
|
2013-07-30 13:59:51 +04:00
|
|
|
class DataTextureSource;
|
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
|
|
|
|
|
|
|
/**
|
2013-07-30 13:59:51 +04:00
|
|
|
* A view on a TextureHost where the texture is internally represented as tiles
|
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
|
|
|
* (contrast with a tiled buffer, where each texture is a tile). For iteration by
|
|
|
|
* the texture's buffer host.
|
|
|
|
* This is only useful when the underlying surface is too big to fit in one
|
|
|
|
* device texture, which forces us to split it in smaller parts.
|
|
|
|
* Tiled Compositable is a different thing.
|
|
|
|
*/
|
|
|
|
class TileIterator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void BeginTileIteration() = 0;
|
|
|
|
virtual void EndTileIteration() {};
|
|
|
|
virtual nsIntRect GetTileRect() = 0;
|
|
|
|
virtual size_t GetTileCount() = 0;
|
|
|
|
virtual bool NextTile() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureSource is the interface for texture objects that can be composited
|
|
|
|
* by a given compositor backend. Since the drawing APIs are different
|
|
|
|
* between backends, the TextureSource interface is split into different
|
|
|
|
* interfaces (TextureSourceOGL, etc.), and TextureSource mostly provide
|
|
|
|
* access to these interfaces.
|
|
|
|
*
|
|
|
|
* This class is used on the compositor side.
|
|
|
|
*/
|
|
|
|
class TextureSource : public RefCounted<TextureSource>
|
|
|
|
{
|
|
|
|
public:
|
2013-09-13 06:39:26 +04:00
|
|
|
TextureSource();
|
|
|
|
virtual ~TextureSource();
|
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
|
|
|
|
|
|
|
/**
|
2013-07-30 13:59:51 +04:00
|
|
|
* Return the size of the texture in texels.
|
|
|
|
* If this is a tile iterator, GetSize must return the size of the current tile.
|
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
|
|
|
*/
|
|
|
|
virtual gfx::IntSize GetSize() const = 0;
|
2013-07-24 19:34:09 +04:00
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
|
|
|
* Return the pixel format of this texture
|
|
|
|
*/
|
2013-07-24 19:34:09 +04:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const { return gfx::FORMAT_UNKNOWN; }
|
|
|
|
|
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
|
|
|
/**
|
2013-08-04 11:46:17 +04:00
|
|
|
* Cast to a TextureSource for for each backend..
|
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
|
|
|
*/
|
|
|
|
virtual TextureSourceOGL* AsSourceOGL() { return nullptr; }
|
2013-08-04 11:46:17 +04:00
|
|
|
virtual TextureSourceD3D9* AsSourceD3D9() { return nullptr; }
|
2013-05-03 21:34:29 +04:00
|
|
|
virtual TextureSourceD3D11* AsSourceD3D11() { return nullptr; }
|
2013-05-01 04:42:05 +04:00
|
|
|
virtual TextureSourceBasic* AsSourceBasic() { return nullptr; }
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
|
|
|
* Cast to a DataTextureSurce.
|
|
|
|
*/
|
|
|
|
virtual DataTextureSource* AsDataTextureSource() { 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 13:20:52 +04:00
|
|
|
/**
|
|
|
|
* In some rare cases we currently need to consider a group of textures as one
|
|
|
|
* TextureSource, that can be split in sub-TextureSources.
|
|
|
|
*/
|
|
|
|
virtual TextureSource* GetSubSource(int index) { return nullptr; }
|
2013-07-30 13:59:51 +04: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 13:20:52 +04:00
|
|
|
/**
|
|
|
|
* Overload this if the TextureSource supports big textures that don't fit in
|
|
|
|
* one device texture and must be tiled internally.
|
|
|
|
*/
|
|
|
|
virtual TileIterator* AsTileIterator() { return nullptr; }
|
|
|
|
|
2013-09-13 06:39:26 +04:00
|
|
|
virtual void SetCompositableQuirks(CompositableQuirks* aQuirks);
|
|
|
|
|
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
|
|
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
|
|
|
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
|
|
|
#endif
|
2013-09-13 06:39:26 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
RefPtr<CompositableQuirks> mQuirks;
|
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
|
|
|
};
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* XXX - merge this class with TextureSource when deprecated texture classes
|
|
|
|
* are completely removed.
|
|
|
|
*/
|
|
|
|
class NewTextureSource : public TextureSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NewTextureSource()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(NewTextureSource);
|
|
|
|
}
|
|
|
|
virtual ~NewTextureSource()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(NewTextureSource);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-08-08 16:53:12 +04:00
|
|
|
* Should be overridden in order to deallocate the data that is associated
|
2013-07-30 13:59:51 +04:00
|
|
|
* with the rendering backend, such as GL textures.
|
|
|
|
*/
|
|
|
|
virtual void DeallocateDeviceData() = 0;
|
|
|
|
|
|
|
|
void SetNextSibling(NewTextureSource* aTexture)
|
|
|
|
{
|
|
|
|
mNextSibling = aTexture;
|
|
|
|
}
|
|
|
|
|
|
|
|
NewTextureSource* GetNextSibling() const
|
|
|
|
{
|
|
|
|
return mNextSibling;
|
|
|
|
}
|
|
|
|
|
|
|
|
// temporary adapter to use the same SubSource API as the old TextureSource
|
|
|
|
virtual TextureSource* GetSubSource(int index) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
switch (index) {
|
|
|
|
case 0: return this;
|
|
|
|
case 1: return GetNextSibling();
|
|
|
|
case 2: return GetNextSibling() ? GetNextSibling()->GetNextSibling() : nullptr;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
RefPtr<NewTextureSource> mNextSibling;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface for TextureSources that can be updated from a DataSourceSurface.
|
|
|
|
*
|
|
|
|
* All backend should implement at least one DataTextureSource.
|
|
|
|
*/
|
|
|
|
class DataTextureSource : public NewTextureSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DataTextureSource()
|
|
|
|
: mUpdateSerial(0)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual DataTextureSource* AsDataTextureSource() MOZ_OVERRIDE { return this; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Upload a (portion of) surface to the TextureSource.
|
|
|
|
*
|
|
|
|
* The DataTextureSource doesn't own aSurface, although it owns and manage
|
|
|
|
* the device texture it uploads to internally.
|
|
|
|
*/
|
|
|
|
virtual bool Update(gfx::DataSourceSurface* aSurface,
|
|
|
|
TextureFlags aFlags,
|
|
|
|
nsIntRegion* aDestRegion = nullptr,
|
|
|
|
gfx::IntPoint* aSrcOffset = nullptr) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A facility to avoid reuploading when it is not necessary.
|
|
|
|
* The caller of Update can use GetUpdateSerial to see if the number has changed
|
|
|
|
* since last update, and call SetUpdateSerial after each successful update.
|
|
|
|
* The caller is responsible for managing the update serial except when the
|
|
|
|
* texture data is deallocated in which case the TextureSource should always
|
|
|
|
* reset the update serial to zero.
|
|
|
|
*/
|
|
|
|
uint32_t GetUpdateSerial() const { return mUpdateSerial; }
|
|
|
|
void SetUpdateSerial(uint32_t aValue) { mUpdateSerial = aValue; }
|
|
|
|
|
|
|
|
// By default at least set the update serial to zero.
|
|
|
|
// overloaded versions should do that too.
|
|
|
|
virtual void DeallocateDeviceData() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
SetUpdateSerial(0);
|
|
|
|
}
|
|
|
|
|
2013-08-08 16:53:12 +04:00
|
|
|
#ifdef DEBUG
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
|
|
|
* Provide read access to the data as a DataSourceSurface.
|
|
|
|
*
|
|
|
|
* This is expected to be very slow and should be used for mostly debugging.
|
|
|
|
* XXX - implement everywhere and make it pure virtual.
|
|
|
|
*/
|
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> ReadBack() { return nullptr; };
|
2013-08-08 16:53:12 +04:00
|
|
|
#endif
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
private:
|
|
|
|
uint32_t mUpdateSerial;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureHost is a thin abstraction over texture data that need to be shared
|
|
|
|
* between the content process and the compositor process. It is the
|
|
|
|
* compositor-side half of a TextureClient/TextureHost pair. A corresponding
|
|
|
|
* TextureClient lives on the content-side.
|
|
|
|
*
|
|
|
|
* TextureHost only knows how to deserialize or synchronize generic image data
|
|
|
|
* (SurfaceDescriptor) and provide access to one or more TextureSource objects
|
|
|
|
* (these provide the necessary APIs for compositor backends to composite the
|
|
|
|
* image).
|
|
|
|
*
|
|
|
|
* A TextureHost implementation corresponds to one SurfaceDescriptor type, as
|
|
|
|
* opposed to TextureSource that corresponds to device textures.
|
|
|
|
* This means that for YCbCr planes, even though they are represented as
|
|
|
|
* 3 textures internally (3 TextureSources), we use 1 TextureHost and not 3,
|
|
|
|
* because the 3 planes are stored in the same buffer of shared memory, before
|
|
|
|
* they are uploaded separately.
|
|
|
|
*
|
|
|
|
* There is always one and only one TextureHost per TextureClient, and the
|
|
|
|
* TextureClient/Host pair only owns one buffer of image data through its
|
|
|
|
* lifetime. This means that the lifetime of the underlying shared data
|
|
|
|
* matches the lifetime of the TextureClient/Host pair. It also means
|
|
|
|
* TextureClient/Host do not implement double buffering, which is the
|
|
|
|
* reponsibility of the compositable (which would use two Texture pairs).
|
|
|
|
*
|
|
|
|
* The Lock/Unlock mecanism here mirrors Lock/Unlock in TextureClient.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class TextureHost : public RefCounted<TextureHost>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextureHost(uint64_t aID,
|
2013-09-13 06:39:26 +04:00
|
|
|
TextureFlags aFlags);
|
2013-07-30 13:59:51 +04:00
|
|
|
|
2013-09-13 06:39:26 +04:00
|
|
|
virtual ~TextureHost();
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Factory method.
|
|
|
|
*/
|
|
|
|
static TemporaryRef<TextureHost> Create(uint64_t aID,
|
|
|
|
const SurfaceDescriptor& aDesc,
|
|
|
|
ISurfaceAllocator* aDeallocator,
|
|
|
|
TextureFlags aFlags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lock the texture host for compositing.
|
|
|
|
*/
|
|
|
|
virtual bool Lock() { return true; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock the texture host after compositing.
|
|
|
|
*/
|
|
|
|
virtual void Unlock() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Note that the texture host format can be different from its corresponding
|
|
|
|
* texture source's. For example a ShmemTextureHost can have the ycbcr
|
|
|
|
* format and produce 3 "alpha" textures sources.
|
|
|
|
*/
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a list of TextureSources for use with a Compositor.
|
|
|
|
*
|
|
|
|
* This can trigger texture uploads, so do not call it inside transactions
|
|
|
|
* so as to not upload textures while the main thread is blocked.
|
|
|
|
* Must not be called while this TextureHost is not sucessfully Locked.
|
|
|
|
*/
|
|
|
|
virtual NewTextureSource* GetTextureSources() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is called before compositing if the shared data has changed since last
|
|
|
|
* composition.
|
|
|
|
* This method should be overload in cases like when we need to do a texture
|
|
|
|
* upload for example.
|
|
|
|
*
|
|
|
|
* @param aRegion The region that has been changed, if nil, it means that the
|
|
|
|
* entire surface should be updated.
|
|
|
|
*/
|
|
|
|
virtual void Updated(const nsIntRegion* aRegion) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets this TextureHost's compositor.
|
|
|
|
* A TextureHost can change compositor on certain occasions, in particular if
|
|
|
|
* it belongs to an async Compositable.
|
|
|
|
* aCompositor can be null, in which case the TextureHost must cleanup all
|
|
|
|
* of it's device textures.
|
|
|
|
*/
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) {}
|
|
|
|
|
|
|
|
/**
|
2013-08-08 16:53:12 +04:00
|
|
|
* Should be overridden in order to deallocate the data that is associated
|
2013-07-30 13:59:51 +04:00
|
|
|
* with the rendering backend, such as GL textures.
|
|
|
|
*/
|
|
|
|
virtual void DeallocateDeviceData() {}
|
|
|
|
|
|
|
|
/**
|
2013-08-08 16:53:12 +04:00
|
|
|
* Should be overridden in order to deallocate the data that is shared with
|
2013-07-30 13:59:51 +04:00
|
|
|
* the content side, such as shared memory.
|
|
|
|
*/
|
|
|
|
virtual void DeallocateSharedData() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An ID to differentiate TextureHosts of a given CompositableHost.
|
|
|
|
*
|
|
|
|
* A TextureHost and its corresponding TextureClient always have the same ID.
|
|
|
|
* TextureHosts of a given CompositableHost always have different IDs.
|
|
|
|
* TextureHosts of different CompositableHosts, may have the same ID.
|
|
|
|
* Zero is always an invalid ID.
|
|
|
|
*/
|
|
|
|
uint64_t GetID() const { return mID; }
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureHosts are kept as a linked list in their compositable
|
|
|
|
* XXX - This is just a poor man's PTexture. The purpose of this list is
|
|
|
|
* to keep TextureHost alive which should be independent from compositables.
|
|
|
|
* It will be removed when we add the PTetxure protocol (which will more
|
|
|
|
* gracefully handle the lifetime of textures). See bug 897452
|
|
|
|
*/
|
|
|
|
TextureHost* GetNextSibling() const { return mNextTexture; }
|
|
|
|
void SetNextSibling(TextureHost* aNext) { mNextTexture = aNext; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Debug facility.
|
2013-08-08 16:53:12 +04:00
|
|
|
* XXX - cool kids use Moz2D. See bug 882113.
|
2013-07-30 13:59:51 +04:00
|
|
|
*/
|
|
|
|
virtual already_AddRefed<gfxImageSurface> GetAsSurface() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XXX - Flags should only be set at creation time, this will be removed.
|
|
|
|
*/
|
|
|
|
void SetFlags(TextureFlags aFlags) { mFlags = aFlags; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XXX - Flags should only be set at creation time, this will be removed.
|
|
|
|
*/
|
|
|
|
void AddFlag(TextureFlags aFlag) { mFlags |= aFlag; }
|
|
|
|
|
|
|
|
TextureFlags GetFlags() { return mFlags; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specific to B2G's Composer2D
|
|
|
|
* XXX - more doc here
|
|
|
|
*/
|
|
|
|
virtual LayerRenderState GetRenderState()
|
|
|
|
{
|
2013-08-08 16:53:12 +04:00
|
|
|
// By default we return an empty render state, this should be overridden
|
2013-07-30 13:59:51 +04:00
|
|
|
// by the TextureHost implementations that are used on B2G with Composer2D
|
|
|
|
return LayerRenderState();
|
|
|
|
}
|
|
|
|
|
2013-09-13 06:39:26 +04:00
|
|
|
virtual void SetCompositableQuirks(CompositableQuirks* aQuirks);
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
|
|
|
virtual void PrintInfo(nsACString& aTo, const char* aPrefix)
|
|
|
|
{
|
|
|
|
RefPtr<TextureSource> source = GetTextureSources();
|
|
|
|
if (source) {
|
|
|
|
source->PrintInfo(aTo, aPrefix);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
uint64_t mID;
|
|
|
|
RefPtr<TextureHost> mNextTexture;
|
|
|
|
TextureFlags mFlags;
|
2013-09-13 06:39:26 +04:00
|
|
|
RefPtr<CompositableQuirks> mQuirks;
|
2013-07-30 13:59:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureHost that wraps a random access buffer such as a Shmem or some raw
|
|
|
|
* memory.
|
|
|
|
*
|
|
|
|
* This TextureHost is backend-independent and the backend-specific bits are
|
|
|
|
* in the TextureSource.
|
|
|
|
* This class must be inherited to implement GetBuffer and DeallocSharedData
|
|
|
|
* (see ShmemTextureHost and MemoryTextureHost)
|
|
|
|
*
|
|
|
|
* Uploads happen when Lock is called.
|
|
|
|
*
|
|
|
|
* BufferTextureHost supports YCbCr and flavours of RGBA images (RGBX, A, etc.).
|
|
|
|
*/
|
|
|
|
class BufferTextureHost : public TextureHost
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BufferTextureHost(uint64_t aID,
|
|
|
|
gfx::SurfaceFormat aFormat,
|
|
|
|
TextureFlags aFlags);
|
|
|
|
|
|
|
|
~BufferTextureHost();
|
|
|
|
|
|
|
|
virtual uint8_t* GetBuffer() = 0;
|
|
|
|
|
|
|
|
virtual void Updated(const nsIntRegion* aRegion) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool Lock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void DeallocateDeviceData() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the format that is exposed to the compositor when calling
|
|
|
|
* GetTextureSources.
|
|
|
|
*
|
|
|
|
* If the shared format is YCbCr and the compositor does not support it,
|
|
|
|
* GetFormat will be RGB32 (even though mFormat is FORMAT_YUV).
|
|
|
|
*/
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
|
|
|
|
|
2013-08-08 16:53:12 +04:00
|
|
|
virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE;
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
protected:
|
|
|
|
bool Upload(nsIntRegion *aRegion = nullptr);
|
2013-08-03 21:30:28 +04:00
|
|
|
bool MaybeUpload(nsIntRegion *aRegion = nullptr);
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
Compositor* mCompositor;
|
|
|
|
RefPtr<DataTextureSource> mFirstSource;
|
|
|
|
nsIntRegion mMaybeUpdatedRegion;
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
// format of the data that is shared with the content process.
|
|
|
|
gfx::SurfaceFormat mFormat;
|
|
|
|
uint32_t mUpdateSerial;
|
|
|
|
bool mLocked;
|
|
|
|
bool mPartialUpdate;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureHost that wraps shared memory.
|
|
|
|
* the corresponding texture on the client side is ShmemTextureClient.
|
|
|
|
* This TextureHost is backend-independent.
|
|
|
|
*/
|
|
|
|
class ShmemTextureHost : public BufferTextureHost
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ShmemTextureHost(uint64_t aID,
|
|
|
|
const ipc::Shmem& aShmem,
|
|
|
|
gfx::SurfaceFormat aFormat,
|
|
|
|
ISurfaceAllocator* aDeallocator,
|
|
|
|
TextureFlags aFlags);
|
|
|
|
|
|
|
|
~ShmemTextureHost();
|
|
|
|
|
|
|
|
virtual void DeallocateSharedData() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
ipc::Shmem* mShmem;
|
|
|
|
ISurfaceAllocator* mDeallocator;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureHost that wraps raw memory.
|
|
|
|
* The corresponding texture on the client side is MemoryTextureClient.
|
|
|
|
* Can obviously not be used in a cross process setup.
|
|
|
|
* This TextureHost is backend-independent.
|
|
|
|
*/
|
|
|
|
class MemoryTextureHost : public BufferTextureHost
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MemoryTextureHost(uint64_t aID,
|
|
|
|
uint8_t* aBuffer,
|
|
|
|
gfx::SurfaceFormat aFormat,
|
|
|
|
TextureFlags aFlags);
|
|
|
|
|
|
|
|
~MemoryTextureHost();
|
|
|
|
|
|
|
|
virtual void DeallocateSharedData() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
uint8_t* mBuffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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
|
|
|
/**
|
2013-07-09 01:30:44 +04:00
|
|
|
* XXX - This class is deprectaed, will be removed soon.
|
|
|
|
*
|
|
|
|
* DeprecatedTextureHost is a thin abstraction over texture data that need to be shared
|
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
|
|
|
* or transfered from the content process to the compositor process. It is the
|
2013-07-09 01:30:44 +04:00
|
|
|
* compositor-side half of a DeprecatedTextureClient/DeprecatedTextureHost pair. A corresponding
|
|
|
|
* DeprecatedTextureClient lives on the client-side.
|
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
|
|
|
*
|
2013-07-09 01:30:44 +04:00
|
|
|
* DeprecatedTextureHost only knows how to deserialize or synchronize generic image data
|
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
|
|
|
* (SurfaceDescriptor) and provide access to one or more TextureSource objects
|
|
|
|
* (these provide the necessary APIs for compositor backends to composite the
|
|
|
|
* image).
|
|
|
|
*
|
2013-07-09 01:30:44 +04:00
|
|
|
* A DeprecatedTextureHost should mostly correspond to one or several SurfaceDescriptor
|
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
|
|
|
* types. This means that for YCbCr planes, even though they are represented as
|
2013-07-09 01:30:44 +04:00
|
|
|
* 3 textures internally, use 1 DeprecatedTextureHost and not 3, because the 3 planes
|
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
|
|
|
* arrive in the same IPC message.
|
|
|
|
*
|
2013-07-30 13:59:51 +04:00
|
|
|
* The Lock/Unlock mechanism here mirrors Lock/Unlock in DeprecatedTextureClient. These two
|
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
|
|
|
* methods don't always have to use blocking locks, unless a resource is shared
|
|
|
|
* between the two sides (like shared texture handles). For instance, in some
|
|
|
|
* cases the data received in Update(...) is a copy in shared memory of the data
|
|
|
|
* owned by the content process, in which case no blocking lock is required.
|
|
|
|
*
|
2013-07-09 01:30:44 +04:00
|
|
|
* DeprecatedTextureHosts can be changed at any time, for example if we receive a
|
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
|
|
|
* SurfaceDescriptor type that was not expected. This should be an incentive
|
|
|
|
* to keep the ownership model simple (especially on the OpenGL case, where
|
|
|
|
* we have additionnal constraints).
|
|
|
|
*
|
|
|
|
* There are two fundamental operations carried out on texture hosts - update
|
|
|
|
* from the content thread and composition. Texture upload can occur in either
|
|
|
|
* phase. Update happens in response to an IPDL message from content and
|
|
|
|
* composition when the compositor 'ticks'. We may composite many times before
|
|
|
|
* update.
|
|
|
|
*
|
2013-07-09 01:30:44 +04:00
|
|
|
* Update ends up at DeprecatedTextureHost::UpdateImpl. It always occurs in a layers
|
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
|
|
|
* transacton. (TextureParent should call EnsureTexture before updating to
|
2013-07-09 01:30:44 +04:00
|
|
|
* ensure the DeprecatedTextureHost exists and is of the correct type).
|
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
|
|
|
*
|
|
|
|
* CompositableHost::Composite does compositing. It should check the texture
|
|
|
|
* host exists (and give up otherwise), then lock the texture host
|
2013-07-09 01:30:44 +04:00
|
|
|
* (DeprecatedTextureHost::Lock). Then it passes the texture host to the Compositor in an
|
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
|
|
|
* effect as a texture source, which does the actual composition. Finally the
|
2013-07-09 01:30:44 +04:00
|
|
|
* compositable calls Unlock on the DeprecatedTextureHost.
|
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
|
|
|
*
|
2013-07-09 01:30:44 +04:00
|
|
|
* The class TextureImageDeprecatedTextureHostOGL is a good example of a DeprecatedTextureHost
|
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
|
|
|
* implementation.
|
|
|
|
*
|
|
|
|
* This class is used only on the compositor side.
|
|
|
|
*/
|
2013-07-09 01:30:44 +04:00
|
|
|
class DeprecatedTextureHost : public TextureSource
|
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
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Create a new texture host to handle surfaces of aDescriptorType
|
|
|
|
*
|
|
|
|
* @param aDescriptorType The SurfaceDescriptor type being passed
|
2013-07-09 01:30:44 +04:00
|
|
|
* @param aDeprecatedTextureHostFlags Modifier flags that specify changes in
|
|
|
|
* the usage of a aDescriptorType, see DeprecatedTextureHostFlags
|
|
|
|
* @param aTextureFlags Flags to pass to the new DeprecatedTextureHost
|
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
|
|
|
*/
|
2013-07-09 01:30:44 +04:00
|
|
|
static TemporaryRef<DeprecatedTextureHost> CreateDeprecatedTextureHost(SurfaceDescriptorType aDescriptorType,
|
|
|
|
uint32_t aDeprecatedTextureHostFlags,
|
2013-09-13 06:39:26 +04:00
|
|
|
uint32_t aTextureFlags,
|
|
|
|
CompositableHost* aCompositableHost);
|
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
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureHost();
|
|
|
|
virtual ~DeprecatedTextureHost();
|
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
|
|
|
|
2013-07-24 19:34:09 +04:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE { return mFormat; }
|
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
|
|
|
|
|
|
|
virtual bool IsValid() const { return true; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the texture host using the data from aSurfaceDescriptor.
|
2013-05-16 07:45:43 +04:00
|
|
|
*
|
|
|
|
* @param aImage Source image to update with.
|
|
|
|
* @param aRegion Region of the texture host to update.
|
|
|
|
* @param aOffset Offset in the source to update from
|
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
|
|
|
*/
|
|
|
|
void Update(const SurfaceDescriptor& aImage,
|
2013-05-16 07:45:43 +04:00
|
|
|
nsIntRegion *aRegion = nullptr,
|
|
|
|
nsIntPoint* aOffset = 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 13:20:52 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the current surface of the texture host to aImage. aResult will return
|
|
|
|
* the previous surface.
|
|
|
|
*/
|
|
|
|
void SwapTextures(const SurfaceDescriptor& aImage,
|
|
|
|
SurfaceDescriptor* aResult = nullptr,
|
|
|
|
nsIntRegion *aRegion = nullptr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update for tiled texture hosts could probably have a better signature, but we
|
|
|
|
* will replace it with PTexture stuff anyway, so nm.
|
|
|
|
*/
|
|
|
|
virtual void Update(gfxReusableSurfaceWrapper* aReusableSurface,
|
|
|
|
TextureFlags aFlags,
|
|
|
|
const gfx::IntSize& aSize) {}
|
|
|
|
|
|
|
|
/**
|
2013-07-09 01:30:44 +04:00
|
|
|
* Lock the texture host for compositing, returns true if the DeprecatedTextureHost is
|
2013-05-08 00:19:15 +04:00
|
|
|
* valid for composition.
|
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
|
|
|
*/
|
2013-05-08 00:19:15 +04:00
|
|
|
virtual bool Lock() { return IsValid(); }
|
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
|
|
|
|
|
|
|
/**
|
2013-05-08 00:19:15 +04:00
|
|
|
* Unlock the texture host after compositing.
|
|
|
|
* Should handle the case where Lock failed without crashing.
|
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
|
|
|
*/
|
|
|
|
virtual void Unlock() {}
|
|
|
|
|
|
|
|
void SetFlags(TextureFlags aFlags) { mFlags = aFlags; }
|
|
|
|
void AddFlag(TextureFlags aFlag) { mFlags |= aFlag; }
|
|
|
|
TextureFlags GetFlags() { return mFlags; }
|
|
|
|
|
|
|
|
/**
|
2013-07-09 01:30:44 +04:00
|
|
|
* Sets ths DeprecatedTextureHost's compositor.
|
|
|
|
* A DeprecatedTextureHost can change compositor on certain occasions, in particular if
|
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
|
|
|
* it belongs to an async Compositable.
|
2013-07-09 01:30:44 +04:00
|
|
|
* aCompositor can be null, in which case the DeprecatedTextureHost must cleanup all
|
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
|
|
|
* of it's device textures.
|
|
|
|
*/
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) {}
|
|
|
|
|
|
|
|
ISurfaceAllocator* GetDeAllocator()
|
|
|
|
{
|
|
|
|
return mDeAllocator;
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
bool operator== (const DeprecatedTextureHost& o) 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 13:20:52 +04:00
|
|
|
{
|
|
|
|
return GetIdentifier() == o.GetIdentifier();
|
|
|
|
}
|
2013-07-09 01:30:44 +04:00
|
|
|
bool operator!= (const DeprecatedTextureHost& o) 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 13:20:52 +04:00
|
|
|
{
|
|
|
|
return GetIdentifier() != o.GetIdentifier();
|
|
|
|
}
|
|
|
|
|
2013-06-06 02:14:51 +04:00
|
|
|
virtual LayerRenderState GetRenderState()
|
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
|
|
|
{
|
2013-06-06 02:14:51 +04:00
|
|
|
return LayerRenderState();
|
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
|
|
|
}
|
|
|
|
|
2013-05-26 06:43:43 +04:00
|
|
|
virtual already_AddRefed<gfxImageSurface> GetAsSurface() = 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 13:20:52 +04:00
|
|
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
|
|
|
virtual const char *Name() = 0;
|
|
|
|
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
|
|
|
#endif
|
|
|
|
|
2013-05-16 07:45:43 +04:00
|
|
|
/**
|
|
|
|
* TEMPORARY.
|
|
|
|
*
|
|
|
|
* Ensure that a buffer of the given size/type has been allocated so that
|
|
|
|
* we can update it using Update and/or CopyTo.
|
|
|
|
*/
|
|
|
|
virtual void EnsureBuffer(const nsIntSize& aSize, gfxASurface::gfxContentType aType)
|
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
NS_RUNTIMEABORT("DeprecatedTextureHost doesn't support EnsureBuffer");
|
2013-05-16 07:45:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-07-09 01:30:44 +04:00
|
|
|
* Copy the contents of this DeprecatedTextureHost to aDest. aDest must already
|
2013-05-16 07:45:43 +04:00
|
|
|
* have a suitable buffer allocated using EnsureBuffer.
|
|
|
|
*
|
|
|
|
* @param aSourceRect Area of this texture host to copy.
|
|
|
|
* @param aDest Destination texture host.
|
|
|
|
* @param aDestRect Destination rect.
|
|
|
|
*/
|
|
|
|
virtual void CopyTo(const nsIntRect& aSourceRect,
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureHost *aDest,
|
2013-05-16 07:45:43 +04:00
|
|
|
const nsIntRect& aDestRect)
|
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
NS_RUNTIMEABORT("DeprecatedTextureHost doesn't support CopyTo");
|
2013-05-16 07:45:43 +04: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 13:20:52 +04:00
|
|
|
|
|
|
|
SurfaceDescriptor* GetBuffer() const { return mBuffer; }
|
2013-05-16 07:45:43 +04: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 13:20:52 +04:00
|
|
|
/**
|
|
|
|
* Set a SurfaceDescriptor for this texture host. By setting a buffer and
|
2013-07-09 01:30:44 +04:00
|
|
|
* allocator/de-allocator for the DeprecatedTextureHost, you cause the DeprecatedTextureHost 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 13:20:52 +04:00
|
|
|
* retain a SurfaceDescriptor.
|
|
|
|
* Ownership of the SurfaceDescriptor passes to this.
|
|
|
|
*/
|
2013-07-09 01:30:44 +04:00
|
|
|
// only made virtual to allow overriding in GrallocDeprecatedTextureHostOGL, for hacky fix in gecko 23 for bug 862324.
|
2013-04-27 07:31:53 +04:00
|
|
|
// see bug 865908 about fixing this.
|
|
|
|
virtual void SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator)
|
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
|
|
|
{
|
|
|
|
MOZ_ASSERT(!mBuffer, "Will leak the old mBuffer");
|
|
|
|
mBuffer = aBuffer;
|
|
|
|
mDeAllocator = aAllocator;
|
|
|
|
}
|
|
|
|
|
2013-04-27 07:31:53 +04:00
|
|
|
// used only for hacky fix in gecko 23 for bug 862324
|
|
|
|
// see bug 865908 about fixing this.
|
|
|
|
virtual void ForgetBuffer() {}
|
|
|
|
|
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
|
|
|
protected:
|
|
|
|
/**
|
2013-07-09 01:30:44 +04:00
|
|
|
* Should be implemented by the backend-specific DeprecatedTextureHost classes
|
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
|
|
|
*
|
|
|
|
* It should not take a reference to aImage, unless it knows the data
|
|
|
|
* to be thread-safe.
|
|
|
|
*/
|
|
|
|
virtual void UpdateImpl(const SurfaceDescriptor& aImage,
|
2013-05-16 07:45:43 +04:00
|
|
|
nsIntRegion *aRegion,
|
|
|
|
nsIntPoint *aOffset = 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 13:20:52 +04:00
|
|
|
{
|
|
|
|
NS_RUNTIMEABORT("Should not be reached");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-07-09 01:30:44 +04:00
|
|
|
* Should be implemented by the backend-specific DeprecatedTextureHost classes.
|
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
|
|
|
*
|
|
|
|
* Doesn't need to do the actual surface descriptor swap, just
|
|
|
|
* any preparation work required to use the new descriptor.
|
|
|
|
*
|
|
|
|
* If the implementation doesn't define anything in particular
|
|
|
|
* for handling swaps, then we can just do an update instead.
|
|
|
|
*/
|
|
|
|
virtual void SwapTexturesImpl(const SurfaceDescriptor& aImage,
|
|
|
|
nsIntRegion *aRegion)
|
|
|
|
{
|
2013-05-16 07:45:43 +04:00
|
|
|
UpdateImpl(aImage, aRegion, 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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// An internal identifier for this texture host. Two texture hosts
|
|
|
|
// should be considered equal iff their identifiers match. Should
|
|
|
|
// not be exposed publicly.
|
|
|
|
virtual uint64_t GetIdentifier() const
|
|
|
|
{
|
|
|
|
return reinterpret_cast<uint64_t>(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Texture info
|
|
|
|
TextureFlags mFlags;
|
2013-04-27 07:31:53 +04:00
|
|
|
SurfaceDescriptor* mBuffer; // FIXME [bjacob] it's terrible to have a SurfaceDescriptor here,
|
|
|
|
// because SurfaceDescriptor's may have raw pointers to IPDL actors,
|
|
|
|
// which can go away under our feet at any time. This is the cause
|
|
|
|
// of bug 862324 among others. Our current understanding is that
|
|
|
|
// this will be gone in Gecko 24. See bug 858914.
|
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
|
|
|
ISurfaceAllocator* mDeAllocator;
|
2013-07-30 13:59:51 +04:00
|
|
|
gfx::SurfaceFormat mFormat;
|
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
|
|
|
};
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
class AutoLockDeprecatedTextureHost
|
2013-04-22 06:40:52 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-07-09 01:30:44 +04:00
|
|
|
AutoLockDeprecatedTextureHost(DeprecatedTextureHost* aHost)
|
|
|
|
: mDeprecatedTextureHost(aHost)
|
2013-04-22 06:40:52 +04:00
|
|
|
, mIsValid(true)
|
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHost) {
|
|
|
|
mIsValid = mDeprecatedTextureHost->Lock();
|
2013-04-22 06:40:52 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
~AutoLockDeprecatedTextureHost()
|
2013-04-22 06:40:52 +04:00
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHost && mIsValid) {
|
|
|
|
mDeprecatedTextureHost->Unlock();
|
2013-04-22 06:40:52 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsValid() { return mIsValid; }
|
|
|
|
|
|
|
|
private:
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureHost *mDeprecatedTextureHost;
|
2013-04-22 06:40:52 +04:00
|
|
|
bool mIsValid;
|
|
|
|
};
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* This can be used as an offscreen rendering target by the compositor, and
|
|
|
|
* subsequently can be used as a source by the compositor.
|
|
|
|
*/
|
|
|
|
class CompositingRenderTarget : public TextureSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~CompositingRenderTarget() {}
|
|
|
|
|
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
|
|
|
virtual already_AddRefed<gfxImageSurface> Dump(Compositor* aCompositor) { return nullptr; }
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
|
|
|
* Creates a TextureHost that can be used with any of the existing backends
|
|
|
|
* Not all SurfaceDescriptor types are supported
|
|
|
|
*/
|
|
|
|
TemporaryRef<TextureHost>
|
|
|
|
CreateBackendIndependentTextureHost(uint64_t aID,
|
|
|
|
const SurfaceDescriptor& aDesc,
|
|
|
|
ISurfaceAllocator* aDeallocator,
|
|
|
|
TextureFlags aFlags);
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
2013-07-30 13:59:51 +04: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 13:20:52 +04:00
|
|
|
#endif
|