michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MOZILLA_GFX_TEXTUREHOST_H michael@0: #define MOZILLA_GFX_TEXTUREHOST_H michael@0: michael@0: #include // for size_t michael@0: #include // for uint64_t, uint32_t, uint8_t michael@0: #include "gfxTypes.h" michael@0: #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc michael@0: #include "mozilla/Attributes.h" // for MOZ_OVERRIDE michael@0: #include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef, etc michael@0: #include "mozilla/gfx/2D.h" // for DataSourceSurface michael@0: #include "mozilla/gfx/Point.h" // for IntSize, IntPoint michael@0: #include "mozilla/gfx/Types.h" // for SurfaceFormat, etc michael@0: #include "mozilla/layers/CompositorTypes.h" // for TextureFlags, etc michael@0: #include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc michael@0: #include "mozilla/mozalloc.h" // for operator delete michael@0: #include "nsCOMPtr.h" // for already_AddRefed michael@0: #include "nsDebug.h" // for NS_RUNTIMEABORT michael@0: #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc michael@0: #include "nsRegion.h" // for nsIntRegion michael@0: #include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc michael@0: #include "nscore.h" // for nsACString michael@0: #include "mozilla/layers/AtomicRefCountedWithFinalize.h" michael@0: michael@0: class gfxReusableSurfaceWrapper; michael@0: struct nsIntPoint; michael@0: struct nsIntSize; michael@0: struct nsIntRect; michael@0: michael@0: namespace mozilla { michael@0: namespace ipc { michael@0: class Shmem; michael@0: } michael@0: michael@0: namespace layers { michael@0: michael@0: class Compositor; michael@0: class CompositableHost; michael@0: class CompositableBackendSpecificData; michael@0: class SurfaceDescriptor; michael@0: class ISurfaceAllocator; michael@0: class TextureHostOGL; michael@0: class TextureSourceOGL; michael@0: class TextureSourceD3D9; michael@0: class TextureSourceD3D11; michael@0: class TextureSourceBasic; michael@0: class DataTextureSource; michael@0: class PTextureParent; michael@0: class TextureParent; michael@0: michael@0: /** michael@0: * A view on a TextureHost where the texture is internally represented as tiles michael@0: * (contrast with a tiled buffer, where each texture is a tile). For iteration by michael@0: * the texture's buffer host. michael@0: * This is only useful when the underlying surface is too big to fit in one michael@0: * device texture, which forces us to split it in smaller parts. michael@0: * Tiled Compositable is a different thing. michael@0: */ michael@0: class TileIterator michael@0: { michael@0: public: michael@0: virtual void BeginTileIteration() = 0; michael@0: virtual void EndTileIteration() {}; michael@0: virtual nsIntRect GetTileRect() = 0; michael@0: virtual size_t GetTileCount() = 0; michael@0: virtual bool NextTile() = 0; michael@0: }; michael@0: michael@0: /** michael@0: * TextureSource is the interface for texture objects that can be composited michael@0: * by a given compositor backend. Since the drawing APIs are different michael@0: * between backends, the TextureSource interface is split into different michael@0: * interfaces (TextureSourceOGL, etc.), and TextureSource mostly provide michael@0: * access to these interfaces. michael@0: * michael@0: * This class is used on the compositor side. michael@0: */ michael@0: class TextureSource michael@0: { michael@0: protected: michael@0: virtual ~TextureSource(); michael@0: michael@0: public: michael@0: NS_INLINE_DECL_REFCOUNTING(TextureSource) michael@0: michael@0: TextureSource(); michael@0: michael@0: /** michael@0: * Return the size of the texture in texels. michael@0: * If this is a tile iterator, GetSize must return the size of the current tile. michael@0: */ michael@0: virtual gfx::IntSize GetSize() const = 0; michael@0: michael@0: /** michael@0: * Return the pixel format of this texture michael@0: */ michael@0: virtual gfx::SurfaceFormat GetFormat() const { return gfx::SurfaceFormat::UNKNOWN; } michael@0: michael@0: /** michael@0: * Cast to a TextureSource for for each backend.. michael@0: */ michael@0: virtual TextureSourceOGL* AsSourceOGL() { return nullptr; } michael@0: virtual TextureSourceD3D9* AsSourceD3D9() { return nullptr; } michael@0: virtual TextureSourceD3D11* AsSourceD3D11() { return nullptr; } michael@0: virtual TextureSourceBasic* AsSourceBasic() { return nullptr; } michael@0: michael@0: /** michael@0: * Cast to a DataTextureSurce. michael@0: */ michael@0: virtual DataTextureSource* AsDataTextureSource() { return nullptr; } michael@0: michael@0: /** michael@0: * In some rare cases we currently need to consider a group of textures as one michael@0: * TextureSource, that can be split in sub-TextureSources. michael@0: */ michael@0: virtual TextureSource* GetSubSource(int index) { return nullptr; } michael@0: michael@0: /** michael@0: * Overload this if the TextureSource supports big textures that don't fit in michael@0: * one device texture and must be tiled internally. michael@0: */ michael@0: virtual TileIterator* AsTileIterator() { return nullptr; } michael@0: michael@0: virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData); michael@0: michael@0: protected: michael@0: RefPtr mCompositableBackendData; michael@0: }; michael@0: michael@0: /** michael@0: * XXX - merge this class with TextureSource when deprecated texture classes michael@0: * are completely removed. michael@0: */ michael@0: class NewTextureSource : public TextureSource michael@0: { michael@0: public: michael@0: NewTextureSource() michael@0: { michael@0: MOZ_COUNT_CTOR(NewTextureSource); michael@0: } michael@0: virtual ~NewTextureSource() michael@0: { michael@0: MOZ_COUNT_DTOR(NewTextureSource); michael@0: } michael@0: michael@0: /** michael@0: * Should be overridden in order to deallocate the data that is associated michael@0: * with the rendering backend, such as GL textures. michael@0: */ michael@0: virtual void DeallocateDeviceData() = 0; michael@0: michael@0: virtual void SetCompositor(Compositor* aCompositor) {} michael@0: michael@0: void SetNextSibling(NewTextureSource* aTexture) michael@0: { michael@0: mNextSibling = aTexture; michael@0: } michael@0: michael@0: NewTextureSource* GetNextSibling() const michael@0: { michael@0: return mNextSibling; michael@0: } michael@0: michael@0: // temporary adapter to use the same SubSource API as the old TextureSource michael@0: virtual TextureSource* GetSubSource(int index) MOZ_OVERRIDE michael@0: { michael@0: switch (index) { michael@0: case 0: return this; michael@0: case 1: return GetNextSibling(); michael@0: case 2: return GetNextSibling() ? GetNextSibling()->GetNextSibling() : nullptr; michael@0: } michael@0: return nullptr; michael@0: } michael@0: michael@0: protected: michael@0: RefPtr mNextSibling; michael@0: }; michael@0: michael@0: /** michael@0: * Interface for TextureSources that can be updated from a DataSourceSurface. michael@0: * michael@0: * All backend should implement at least one DataTextureSource. michael@0: */ michael@0: class DataTextureSource : public NewTextureSource michael@0: { michael@0: public: michael@0: DataTextureSource() michael@0: : mUpdateSerial(0) michael@0: {} michael@0: michael@0: virtual DataTextureSource* AsDataTextureSource() MOZ_OVERRIDE { return this; } michael@0: michael@0: /** michael@0: * Upload a (portion of) surface to the TextureSource. michael@0: * michael@0: * The DataTextureSource doesn't own aSurface, although it owns and manage michael@0: * the device texture it uploads to internally. michael@0: */ michael@0: virtual bool Update(gfx::DataSourceSurface* aSurface, michael@0: nsIntRegion* aDestRegion = nullptr, michael@0: gfx::IntPoint* aSrcOffset = nullptr) = 0; michael@0: michael@0: /** michael@0: * A facility to avoid reuploading when it is not necessary. michael@0: * The caller of Update can use GetUpdateSerial to see if the number has changed michael@0: * since last update, and call SetUpdateSerial after each successful update. michael@0: * The caller is responsible for managing the update serial except when the michael@0: * texture data is deallocated in which case the TextureSource should always michael@0: * reset the update serial to zero. michael@0: */ michael@0: uint32_t GetUpdateSerial() const { return mUpdateSerial; } michael@0: void SetUpdateSerial(uint32_t aValue) { mUpdateSerial = aValue; } michael@0: michael@0: // By default at least set the update serial to zero. michael@0: // overloaded versions should do that too. michael@0: virtual void DeallocateDeviceData() MOZ_OVERRIDE michael@0: { michael@0: SetUpdateSerial(0); michael@0: } michael@0: michael@0: #ifdef DEBUG michael@0: /** michael@0: * Provide read access to the data as a DataSourceSurface. michael@0: * michael@0: * This is expected to be very slow and should be used for mostly debugging. michael@0: * XXX - implement everywhere and make it pure virtual. michael@0: */ michael@0: virtual TemporaryRef ReadBack() { return nullptr; }; michael@0: #endif michael@0: michael@0: private: michael@0: uint32_t mUpdateSerial; michael@0: }; michael@0: michael@0: /** michael@0: * TextureHost is a thin abstraction over texture data that need to be shared michael@0: * between the content process and the compositor process. It is the michael@0: * compositor-side half of a TextureClient/TextureHost pair. A corresponding michael@0: * TextureClient lives on the content-side. michael@0: * michael@0: * TextureHost only knows how to deserialize or synchronize generic image data michael@0: * (SurfaceDescriptor) and provide access to one or more TextureSource objects michael@0: * (these provide the necessary APIs for compositor backends to composite the michael@0: * image). michael@0: * michael@0: * A TextureHost implementation corresponds to one SurfaceDescriptor type, as michael@0: * opposed to TextureSource that corresponds to device textures. michael@0: * This means that for YCbCr planes, even though they are represented as michael@0: * 3 textures internally (3 TextureSources), we use 1 TextureHost and not 3, michael@0: * because the 3 planes are stored in the same buffer of shared memory, before michael@0: * they are uploaded separately. michael@0: * michael@0: * There is always one and only one TextureHost per TextureClient, and the michael@0: * TextureClient/Host pair only owns one buffer of image data through its michael@0: * lifetime. This means that the lifetime of the underlying shared data michael@0: * matches the lifetime of the TextureClient/Host pair. It also means michael@0: * TextureClient/Host do not implement double buffering, which is the michael@0: * reponsibility of the compositable (which would use two Texture pairs). michael@0: * michael@0: * The Lock/Unlock mecanism here mirrors Lock/Unlock in TextureClient. michael@0: * michael@0: */ michael@0: class TextureHost michael@0: : public AtomicRefCountedWithFinalize michael@0: { michael@0: /** michael@0: * Called once, just before the destructor. michael@0: * michael@0: * Here goes the shut-down code that uses virtual methods. michael@0: * Must only be called by Release(). michael@0: */ michael@0: void Finalize(); michael@0: michael@0: friend class AtomicRefCountedWithFinalize; michael@0: public: michael@0: TextureHost(TextureFlags aFlags); michael@0: michael@0: virtual ~TextureHost(); michael@0: michael@0: /** michael@0: * Factory method. michael@0: */ michael@0: static TemporaryRef Create(const SurfaceDescriptor& aDesc, michael@0: ISurfaceAllocator* aDeallocator, michael@0: TextureFlags aFlags); michael@0: michael@0: /** michael@0: * Tell to TextureChild that TextureHost is recycled. michael@0: * This function should be called from TextureHost's RecycleCallback. michael@0: * If SetRecycleCallback is set to TextureHost. michael@0: * TextureHost can be recycled by calling RecycleCallback michael@0: * when reference count becomes one. michael@0: * One reference count is always added by TextureChild. michael@0: */ michael@0: void CompositorRecycle(); michael@0: michael@0: /** michael@0: * Lock the texture host for compositing. michael@0: */ michael@0: virtual bool Lock() { return true; } michael@0: michael@0: /** michael@0: * Unlock the texture host after compositing. michael@0: */ michael@0: virtual void Unlock() {} michael@0: michael@0: /** michael@0: * Note that the texture host format can be different from its corresponding michael@0: * texture source's. For example a ShmemTextureHost can have the ycbcr michael@0: * format and produce 3 "alpha" textures sources. michael@0: */ michael@0: virtual gfx::SurfaceFormat GetFormat() const = 0; michael@0: michael@0: /** michael@0: * Return a list of TextureSources for use with a Compositor. michael@0: * michael@0: * This can trigger texture uploads, so do not call it inside transactions michael@0: * so as to not upload textures while the main thread is blocked. michael@0: * Must not be called while this TextureHost is not sucessfully Locked. michael@0: */ michael@0: virtual NewTextureSource* GetTextureSources() = 0; michael@0: michael@0: /** michael@0: * Is called before compositing if the shared data has changed since last michael@0: * composition. michael@0: * This method should be overload in cases like when we need to do a texture michael@0: * upload for example. michael@0: * michael@0: * @param aRegion The region that has been changed, if nil, it means that the michael@0: * entire surface should be updated. michael@0: */ michael@0: virtual void Updated(const nsIntRegion* aRegion = nullptr) {} michael@0: michael@0: /** michael@0: * Sets this TextureHost's compositor. michael@0: * A TextureHost can change compositor on certain occasions, in particular if michael@0: * it belongs to an async Compositable. michael@0: * aCompositor can be null, in which case the TextureHost must cleanup all michael@0: * of it's device textures. michael@0: */ michael@0: virtual void SetCompositor(Compositor* aCompositor) {} michael@0: michael@0: /** michael@0: * Should be overridden in order to deallocate the data that is associated michael@0: * with the rendering backend, such as GL textures. michael@0: */ michael@0: virtual void DeallocateDeviceData() {} michael@0: michael@0: /** michael@0: * Should be overridden in order to deallocate the data that is shared with michael@0: * the content side, such as shared memory. michael@0: */ michael@0: virtual void DeallocateSharedData() {} michael@0: michael@0: /** michael@0: * Should be overridden in order to force the TextureHost to drop all references michael@0: * to it's shared data. michael@0: * michael@0: * This is important to ensure the correctness of the deallocation protocol. michael@0: */ michael@0: virtual void ForgetSharedData() {} michael@0: michael@0: virtual gfx::IntSize GetSize() const = 0; michael@0: michael@0: /** michael@0: * Debug facility. michael@0: * XXX - cool kids use Moz2D. See bug 882113. michael@0: */ michael@0: virtual TemporaryRef GetAsSurface() = 0; michael@0: michael@0: /** michael@0: * XXX - Flags should only be set at creation time, this will be removed. michael@0: */ michael@0: void SetFlags(TextureFlags aFlags) { mFlags = aFlags; } michael@0: michael@0: /** michael@0: * XXX - Flags should only be set at creation time, this will be removed. michael@0: */ michael@0: void AddFlag(TextureFlags aFlag) { mFlags |= aFlag; } michael@0: michael@0: TextureFlags GetFlags() { return mFlags; } michael@0: michael@0: /** michael@0: * Allocate and deallocate a TextureParent actor. michael@0: * michael@0: * TextureParent< is an implementation detail of TextureHost that is not michael@0: * exposed to the rest of the code base. CreateIPDLActor and DestroyIPDLActor michael@0: * are for use with the managing IPDL protocols only (so that they can michael@0: * implement AllocPTextureParent and DeallocPTextureParent). michael@0: */ michael@0: static PTextureParent* CreateIPDLActor(ISurfaceAllocator* aAllocator, michael@0: const SurfaceDescriptor& aSharedData, michael@0: TextureFlags aFlags); michael@0: static bool DestroyIPDLActor(PTextureParent* actor); michael@0: michael@0: /** michael@0: * Destroy the TextureChild/Parent pair. michael@0: */ michael@0: static bool SendDeleteIPDLActor(PTextureParent* actor); michael@0: michael@0: /** michael@0: * Get the TextureHost corresponding to the actor passed in parameter. michael@0: */ michael@0: static TextureHost* AsTextureHost(PTextureParent* actor); michael@0: michael@0: /** michael@0: * Return a pointer to the IPDLActor. michael@0: * michael@0: * This is to be used with IPDL messages only. Do not store the returned michael@0: * pointer. michael@0: */ michael@0: PTextureParent* GetIPDLActor(); michael@0: michael@0: /** michael@0: * Specific to B2G's Composer2D michael@0: * XXX - more doc here michael@0: */ michael@0: virtual LayerRenderState GetRenderState() michael@0: { michael@0: // By default we return an empty render state, this should be overridden michael@0: // by the TextureHost implementations that are used on B2G with Composer2D michael@0: return LayerRenderState(); michael@0: } michael@0: michael@0: virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData); michael@0: michael@0: // If a texture host holds a reference to shmem, it should override this method michael@0: // to forget about the shmem _without_ releasing it. michael@0: virtual void OnShutdown() {} michael@0: michael@0: // Forget buffer actor. Used only for hacky fix for bug 966446. michael@0: virtual void ForgetBufferActor() {} michael@0: michael@0: virtual const char *Name() { return "TextureHost"; } michael@0: virtual void PrintInfo(nsACString& aTo, const char* aPrefix); michael@0: michael@0: /** michael@0: * Indicates whether the TextureHost implementation is backed by an michael@0: * in-memory buffer. The consequence of this is that locking the michael@0: * TextureHost does not contend with locking the texture on the client side. michael@0: */ michael@0: virtual bool HasInternalBuffer() const { return false; } michael@0: michael@0: /** michael@0: * Cast to a TextureHost for each backend. michael@0: */ michael@0: virtual TextureHostOGL* AsHostOGL() { return nullptr; } michael@0: michael@0: protected: michael@0: PTextureParent* mActor; michael@0: TextureFlags mFlags; michael@0: RefPtr mCompositableBackendData; michael@0: michael@0: friend class TextureParent; michael@0: }; michael@0: michael@0: /** michael@0: * TextureHost that wraps a random access buffer such as a Shmem or some raw michael@0: * memory. michael@0: * michael@0: * This TextureHost is backend-independent and the backend-specific bits are michael@0: * in the TextureSource. michael@0: * This class must be inherited to implement GetBuffer and DeallocSharedData michael@0: * (see ShmemTextureHost and MemoryTextureHost) michael@0: * michael@0: * Uploads happen when Lock is called. michael@0: * michael@0: * BufferTextureHost supports YCbCr and flavours of RGBA images (RGBX, A, etc.). michael@0: */ michael@0: class BufferTextureHost : public TextureHost michael@0: { michael@0: public: michael@0: BufferTextureHost(gfx::SurfaceFormat aFormat, michael@0: TextureFlags aFlags); michael@0: michael@0: ~BufferTextureHost(); michael@0: michael@0: virtual uint8_t* GetBuffer() = 0; michael@0: michael@0: virtual size_t GetBufferSize() = 0; michael@0: michael@0: virtual void Updated(const nsIntRegion* aRegion = nullptr) MOZ_OVERRIDE; michael@0: michael@0: virtual bool Lock() MOZ_OVERRIDE; michael@0: michael@0: virtual void Unlock() MOZ_OVERRIDE; michael@0: michael@0: virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE; michael@0: michael@0: virtual void DeallocateDeviceData() MOZ_OVERRIDE; michael@0: michael@0: virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE; michael@0: michael@0: /** michael@0: * Return the format that is exposed to the compositor when calling michael@0: * GetTextureSources. michael@0: * michael@0: * If the shared format is YCbCr and the compositor does not support it, michael@0: * GetFormat will be RGB32 (even though mFormat is SurfaceFormat::YUV). michael@0: */ michael@0: virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE; michael@0: michael@0: virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; } michael@0: michael@0: virtual TemporaryRef GetAsSurface() MOZ_OVERRIDE; michael@0: michael@0: virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return true; } michael@0: michael@0: protected: michael@0: bool Upload(nsIntRegion *aRegion = nullptr); michael@0: bool MaybeUpload(nsIntRegion *aRegion = nullptr); michael@0: michael@0: Compositor* mCompositor; michael@0: RefPtr mFirstSource; michael@0: nsIntRegion mMaybeUpdatedRegion; michael@0: gfx::IntSize mSize; michael@0: // format of the data that is shared with the content process. michael@0: gfx::SurfaceFormat mFormat; michael@0: uint32_t mUpdateSerial; michael@0: bool mLocked; michael@0: bool mPartialUpdate; michael@0: }; michael@0: michael@0: /** michael@0: * TextureHost that wraps shared memory. michael@0: * the corresponding texture on the client side is ShmemTextureClient. michael@0: * This TextureHost is backend-independent. michael@0: */ michael@0: class ShmemTextureHost : public BufferTextureHost michael@0: { michael@0: public: michael@0: ShmemTextureHost(const mozilla::ipc::Shmem& aShmem, michael@0: gfx::SurfaceFormat aFormat, michael@0: ISurfaceAllocator* aDeallocator, michael@0: TextureFlags aFlags); michael@0: michael@0: ~ShmemTextureHost(); michael@0: michael@0: virtual void DeallocateSharedData() MOZ_OVERRIDE; michael@0: michael@0: virtual void ForgetSharedData() MOZ_OVERRIDE; michael@0: michael@0: virtual uint8_t* GetBuffer() MOZ_OVERRIDE; michael@0: michael@0: virtual size_t GetBufferSize() MOZ_OVERRIDE; michael@0: michael@0: virtual const char *Name() MOZ_OVERRIDE { return "ShmemTextureHost"; } michael@0: michael@0: virtual void OnShutdown() MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: mozilla::ipc::Shmem* mShmem; michael@0: RefPtr mDeallocator; michael@0: }; michael@0: michael@0: /** michael@0: * TextureHost that wraps raw memory. michael@0: * The corresponding texture on the client side is MemoryTextureClient. michael@0: * Can obviously not be used in a cross process setup. michael@0: * This TextureHost is backend-independent. michael@0: */ michael@0: class MemoryTextureHost : public BufferTextureHost michael@0: { michael@0: public: michael@0: MemoryTextureHost(uint8_t* aBuffer, michael@0: gfx::SurfaceFormat aFormat, michael@0: TextureFlags aFlags); michael@0: michael@0: ~MemoryTextureHost(); michael@0: michael@0: virtual void DeallocateSharedData() MOZ_OVERRIDE; michael@0: michael@0: virtual void ForgetSharedData() MOZ_OVERRIDE; michael@0: michael@0: virtual uint8_t* GetBuffer() MOZ_OVERRIDE; michael@0: michael@0: virtual size_t GetBufferSize() MOZ_OVERRIDE; michael@0: michael@0: virtual const char *Name() MOZ_OVERRIDE { return "MemoryTextureHost"; } michael@0: michael@0: protected: michael@0: uint8_t* mBuffer; michael@0: }; michael@0: michael@0: class MOZ_STACK_CLASS AutoLockTextureHost michael@0: { michael@0: public: michael@0: AutoLockTextureHost(TextureHost* aTexture) michael@0: : mTexture(aTexture) michael@0: { michael@0: mLocked = mTexture ? mTexture->Lock() : false; michael@0: } michael@0: michael@0: ~AutoLockTextureHost() michael@0: { michael@0: if (mTexture && mLocked) { michael@0: mTexture->Unlock(); michael@0: } michael@0: } michael@0: michael@0: bool Failed() { return mTexture && !mLocked; } michael@0: michael@0: private: michael@0: RefPtr mTexture; michael@0: bool mLocked; michael@0: }; michael@0: michael@0: /** michael@0: * This can be used as an offscreen rendering target by the compositor, and michael@0: * subsequently can be used as a source by the compositor. michael@0: */ michael@0: class CompositingRenderTarget : public TextureSource michael@0: { michael@0: public: michael@0: CompositingRenderTarget(const gfx::IntPoint& aOrigin) michael@0: : mOrigin(aOrigin) michael@0: {} michael@0: virtual ~CompositingRenderTarget() {} michael@0: michael@0: #ifdef MOZ_DUMP_PAINTING michael@0: virtual TemporaryRef Dump(Compositor* aCompositor) { return nullptr; } michael@0: #endif michael@0: michael@0: const gfx::IntPoint& GetOrigin() { return mOrigin; } michael@0: michael@0: private: michael@0: gfx::IntPoint mOrigin; michael@0: }; michael@0: michael@0: /** michael@0: * Creates a TextureHost that can be used with any of the existing backends michael@0: * Not all SurfaceDescriptor types are supported michael@0: */ michael@0: TemporaryRef michael@0: CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc, michael@0: ISurfaceAllocator* aDeallocator, michael@0: TextureFlags aFlags); michael@0: michael@0: } michael@0: } michael@0: michael@0: #endif