2012-12-17 17:58:44 -08:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
|
|
|
|
/* 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 GLTEXTUREIMAGE_H_
|
|
|
|
#define GLTEXTUREIMAGE_H_
|
|
|
|
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsRegion.h"
|
2013-03-17 00:55:16 -07:00
|
|
|
#include "nsTArray.h"
|
2013-09-24 13:45:14 -07:00
|
|
|
#include "gfxTypes.h"
|
2012-12-17 17:58:44 -08:00
|
|
|
#include "GLContextTypes.h"
|
2013-10-01 14:01:19 -07:00
|
|
|
#include "GraphicsFilter.h"
|
2013-07-30 02:59:51 -07:00
|
|
|
#include "mozilla/gfx/Rect.h"
|
|
|
|
|
2013-09-24 13:45:14 -07:00
|
|
|
class gfxASurface;
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
class DataSourceSurface;
|
|
|
|
}
|
|
|
|
}
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
class GLContext;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A TextureImage encapsulates a surface that can be drawn to by a
|
|
|
|
* Thebes gfxContext and (hopefully efficiently!) synchronized to a
|
|
|
|
* texture in the server. TextureImages are associated with one and
|
|
|
|
* only one GLContext.
|
|
|
|
*
|
|
|
|
* Implementation note: TextureImages attempt to unify two categories
|
|
|
|
* of backends
|
|
|
|
*
|
|
|
|
* (1) proxy to server-side object that can be bound to a texture;
|
|
|
|
* e.g. Pixmap on X11.
|
|
|
|
*
|
|
|
|
* (2) efficient manager of texture memory; e.g. by having clients draw
|
|
|
|
* into a scratch buffer which is then uploaded with
|
|
|
|
* glTexSubImage2D().
|
|
|
|
*/
|
|
|
|
class TextureImage
|
|
|
|
{
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(TextureImage)
|
|
|
|
public:
|
|
|
|
enum TextureState
|
|
|
|
{
|
|
|
|
Created, // Texture created, but has not had glTexImage called to initialize it.
|
|
|
|
Allocated, // Texture memory exists, but contents are invalid.
|
|
|
|
Valid // Texture fully ready to use.
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Flags {
|
|
|
|
NoFlags = 0x0,
|
|
|
|
UseNearestFilter = 0x1,
|
|
|
|
NeedsYFlip = 0x2,
|
2013-08-01 16:02:06 -07:00
|
|
|
DisallowBigImage = 0x4
|
2012-12-17 17:58:44 -08:00
|
|
|
};
|
|
|
|
|
2013-09-24 13:45:13 -07:00
|
|
|
typedef gfxContentType ContentType;
|
|
|
|
typedef gfxImageFormat ImageFormat;
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
static already_AddRefed<TextureImage> Create(
|
|
|
|
GLContext* gl,
|
|
|
|
const nsIntSize& aSize,
|
|
|
|
TextureImage::ContentType aContentType,
|
|
|
|
GLenum aWrapMode,
|
|
|
|
TextureImage::Flags aFlags = TextureImage::NoFlags);
|
2013-08-13 06:44:53 -07:00
|
|
|
// Moz2D equivalent...
|
|
|
|
static already_AddRefed<TextureImage> Create(
|
|
|
|
GLContext* gl,
|
|
|
|
const gfx::IntSize& aSize,
|
|
|
|
TextureImage::ContentType aContentType,
|
|
|
|
GLenum aWrapMode,
|
|
|
|
TextureImage::Flags aFlags = TextureImage::NoFlags);
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
virtual ~TextureImage() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a gfxASurface for updating |aRegion| of the client's
|
2013-07-20 01:48:55 -07:00
|
|
|
* image if successul, nullptr if not. |aRegion|'s bounds must fit
|
2012-12-17 17:58:44 -08:00
|
|
|
* within Size(); its coordinate space (if any) is ignored. If
|
|
|
|
* the update begins successfully, the returned gfxASurface is
|
2013-07-20 01:48:55 -07:00
|
|
|
* owned by this. Otherwise, nullptr is returned.
|
2012-12-17 17:58:44 -08:00
|
|
|
*
|
|
|
|
* |aRegion| is an inout param: the returned region is what the
|
|
|
|
* client must repaint. Category (1) regions above can
|
|
|
|
* efficiently handle repaints to "scattered" regions, while (2)
|
|
|
|
* can only efficiently handle repaints to rects.
|
|
|
|
*
|
|
|
|
* Painting the returned surface outside of |aRegion| results
|
|
|
|
* in undefined behavior.
|
|
|
|
*
|
|
|
|
* BeginUpdate() calls cannot be "nested", and each successful
|
|
|
|
* BeginUpdate() must be followed by exactly one EndUpdate() (see
|
|
|
|
* below). Failure to do so can leave this in a possibly
|
|
|
|
* inconsistent state. Unsuccessful BeginUpdate()s must not be
|
|
|
|
* followed by EndUpdate().
|
|
|
|
*/
|
|
|
|
virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion) = 0;
|
|
|
|
/**
|
|
|
|
* Retrieves the region that will require updating, given a
|
|
|
|
* region that needs to be updated. This can be used for
|
|
|
|
* making decisions about updating before calling BeginUpdate().
|
|
|
|
*
|
|
|
|
* |aRegion| is an inout param.
|
|
|
|
*/
|
|
|
|
virtual void GetUpdateRegion(nsIntRegion& aForRegion) {
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Finish the active update and synchronize with the server, if
|
|
|
|
* necessary.
|
|
|
|
*
|
|
|
|
* BeginUpdate() must have been called exactly once before
|
|
|
|
* EndUpdate().
|
|
|
|
*/
|
|
|
|
virtual void EndUpdate() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Image may contain several textures for different regions (tiles).
|
|
|
|
* These functions iterate over each sub texture image tile.
|
|
|
|
*/
|
|
|
|
virtual void BeginTileIteration() {
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool NextTile() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Function prototype for a tile iteration callback. Returning false will
|
|
|
|
// cause iteration to be interrupted (i.e. the corresponding NextTile call
|
|
|
|
// will return false).
|
|
|
|
typedef bool (* TileIterationCallback)(TextureImage* aImage,
|
|
|
|
int aTileNumber,
|
|
|
|
void* aCallbackData);
|
|
|
|
|
|
|
|
// Sets a callback to be called every time NextTile is called.
|
|
|
|
virtual void SetIterationCallback(TileIterationCallback aCallback,
|
|
|
|
void* aCallbackData) {
|
|
|
|
}
|
|
|
|
|
2013-08-13 06:44:53 -07:00
|
|
|
virtual gfx::IntRect GetTileRect();
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
virtual GLuint GetTextureID() = 0;
|
|
|
|
|
|
|
|
virtual uint32_t GetTileCount() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set this TextureImage's size, and ensure a texture has been
|
|
|
|
* allocated. Must not be called between BeginUpdate and EndUpdate.
|
|
|
|
* After a resize, the contents are undefined.
|
|
|
|
*
|
|
|
|
* If this isn't implemented by a subclass, it will just perform
|
|
|
|
* a dummy BeginUpdate/EndUpdate pair.
|
|
|
|
*/
|
2013-12-13 09:32:06 -08:00
|
|
|
virtual void Resize(const gfx::IntSize& aSize) {
|
2012-12-17 17:58:44 -08:00
|
|
|
mSize = aSize;
|
|
|
|
nsIntRegion r(nsIntRect(0, 0, aSize.width, aSize.height));
|
|
|
|
BeginUpdate(r);
|
|
|
|
EndUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mark this texture as having valid contents. Call this after modifying
|
|
|
|
* the texture contents externally.
|
|
|
|
*/
|
|
|
|
virtual void MarkValid() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* aSurf - the source surface to update from
|
|
|
|
* aRegion - the region in this image to update
|
|
|
|
* aFrom - offset in the source to update from
|
|
|
|
*/
|
|
|
|
virtual bool DirectUpdate(gfxASurface *aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0)) = 0;
|
2013-07-30 02:59:51 -07:00
|
|
|
// Moz2D equivalent
|
|
|
|
bool UpdateFromDataSource(gfx::DataSourceSurface *aSurf,
|
|
|
|
const nsIntRegion* aDstRegion = nullptr,
|
|
|
|
const gfx::IntPoint* aSrcOffset = nullptr);
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
virtual void BindTexture(GLenum aTextureUnit) = 0;
|
|
|
|
|
|
|
|
/**
|
2013-07-04 10:25:50 -07:00
|
|
|
* Returns the image format of the texture. Only valid after a matching
|
|
|
|
* BeginUpdate/EndUpdate pair have been called.
|
2012-12-17 17:58:44 -08:00
|
|
|
*/
|
2013-07-04 10:25:50 -07:00
|
|
|
virtual gfx::SurfaceFormat GetTextureFormat() {
|
|
|
|
return mTextureFormat;
|
2012-12-17 17:58:44 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Can be called safely at any time. */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If this TextureImage has a permanent gfxASurface backing,
|
2013-04-28 04:52:10 -07:00
|
|
|
* return it. Otherwise return nullptr.
|
2012-12-17 17:58:44 -08:00
|
|
|
*/
|
|
|
|
virtual already_AddRefed<gfxASurface> GetBackingSurface()
|
2013-04-28 04:52:10 -07:00
|
|
|
{ return nullptr; }
|
2012-12-17 17:58:44 -08:00
|
|
|
|
2013-08-13 06:44:53 -07:00
|
|
|
|
|
|
|
gfx::IntSize GetSize() const;
|
2012-12-17 17:58:44 -08:00
|
|
|
ContentType GetContentType() const { return mContentType; }
|
2013-08-07 15:38:21 -07:00
|
|
|
ImageFormat GetImageFormat() const { return mImageFormat; }
|
2012-12-17 17:58:44 -08:00
|
|
|
virtual bool InUpdate() const = 0;
|
|
|
|
GLenum GetWrapMode() const { return mWrapMode; }
|
|
|
|
|
2013-10-01 14:01:19 -07:00
|
|
|
void SetFilter(GraphicsFilter aFilter) { mFilter = aFilter; }
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
friend class GLContext;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* After the ctor, the TextureImage is invalid. Implementations
|
|
|
|
* must allocate resources successfully before returning the new
|
|
|
|
* TextureImage from GLContext::CreateTextureImage(). That is,
|
|
|
|
* clients must not be given partially-constructed TextureImages.
|
|
|
|
*/
|
|
|
|
TextureImage(const nsIntSize& aSize,
|
|
|
|
GLenum aWrapMode, ContentType aContentType,
|
2013-08-07 15:38:21 -07:00
|
|
|
Flags aFlags = NoFlags,
|
2013-09-24 13:45:13 -07:00
|
|
|
ImageFormat aImageFormat = gfxImageFormatUnknown)
|
2013-12-31 01:06:12 -08:00
|
|
|
: mSize(aSize.ToIntSize())
|
2012-12-17 17:58:44 -08:00
|
|
|
, mWrapMode(aWrapMode)
|
|
|
|
, mContentType(aContentType)
|
2013-08-07 15:38:21 -07:00
|
|
|
, mImageFormat(aImageFormat)
|
2013-10-01 14:01:19 -07:00
|
|
|
, mFilter(GraphicsFilter::FILTER_GOOD)
|
2012-12-17 17:58:44 -08:00
|
|
|
, mFlags(aFlags)
|
|
|
|
{}
|
|
|
|
|
2013-08-13 06:44:53 -07:00
|
|
|
// Moz2D equivalent...
|
|
|
|
TextureImage(const gfx::IntSize& aSize,
|
|
|
|
GLenum aWrapMode, ContentType aContentType,
|
|
|
|
Flags aFlags = NoFlags);
|
|
|
|
|
|
|
|
virtual gfx::IntRect GetSrcTileRect();
|
2012-12-17 17:58:44 -08:00
|
|
|
|
2013-12-13 09:32:06 -08:00
|
|
|
gfx::IntSize mSize;
|
2012-12-17 17:58:44 -08:00
|
|
|
GLenum mWrapMode;
|
|
|
|
ContentType mContentType;
|
2013-08-07 15:38:21 -07:00
|
|
|
ImageFormat mImageFormat;
|
2013-07-04 10:25:50 -07:00
|
|
|
gfx::SurfaceFormat mTextureFormat;
|
2013-10-01 14:01:19 -07:00
|
|
|
GraphicsFilter mFilter;
|
2012-12-17 17:58:44 -08:00
|
|
|
Flags mFlags;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* BasicTextureImage is the baseline TextureImage implementation ---
|
|
|
|
* it updates its texture by allocating a scratch buffer for the
|
|
|
|
* client to draw into, then using glTexSubImage2D() to upload the new
|
|
|
|
* pixels. Platforms must provide the code to create a new surface
|
|
|
|
* into which the updated pixels will be drawn, and the code to
|
|
|
|
* convert the update surface's pixels into an image on which we can
|
|
|
|
* glTexSubImage2D().
|
|
|
|
*/
|
|
|
|
class BasicTextureImage
|
|
|
|
: public TextureImage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~BasicTextureImage();
|
|
|
|
|
|
|
|
BasicTextureImage(GLuint aTexture,
|
|
|
|
const nsIntSize& aSize,
|
|
|
|
GLenum aWrapMode,
|
|
|
|
ContentType aContentType,
|
|
|
|
GLContext* aContext,
|
2013-08-07 15:38:21 -07:00
|
|
|
TextureImage::Flags aFlags = TextureImage::NoFlags,
|
2013-09-24 13:45:13 -07:00
|
|
|
TextureImage::ImageFormat aImageFormat = gfxImageFormatUnknown);
|
2013-08-13 06:44:53 -07:00
|
|
|
BasicTextureImage(GLuint aTexture,
|
|
|
|
const gfx::IntSize& aSize,
|
|
|
|
GLenum aWrapMode,
|
|
|
|
ContentType aContentType,
|
|
|
|
GLContext* aContext,
|
|
|
|
TextureImage::Flags aFlags = TextureImage::NoFlags,
|
2013-09-24 13:45:13 -07:00
|
|
|
TextureImage::ImageFormat aImageFormat = gfxImageFormatUnknown);
|
2013-08-13 06:44:53 -07:00
|
|
|
|
2012-12-17 17:58:44 -08:00
|
|
|
virtual void BindTexture(GLenum aTextureUnit);
|
|
|
|
|
|
|
|
virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion);
|
|
|
|
virtual void GetUpdateRegion(nsIntRegion& aForRegion);
|
|
|
|
virtual void EndUpdate();
|
|
|
|
virtual bool DirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
|
|
|
|
virtual GLuint GetTextureID() { return mTexture; }
|
|
|
|
// Returns a surface to draw into
|
|
|
|
virtual already_AddRefed<gfxASurface>
|
|
|
|
GetSurfaceForUpdate(const gfxIntSize& aSize, ImageFormat aFmt);
|
|
|
|
|
|
|
|
virtual void MarkValid() { mTextureState = Valid; }
|
|
|
|
|
|
|
|
// Call when drawing into the update surface is complete.
|
|
|
|
// Returns true if textures should be upload with a relative
|
|
|
|
// offset - See UploadSurfaceToTexture.
|
|
|
|
virtual bool FinishedSurfaceUpdate();
|
|
|
|
|
|
|
|
// Call after surface data has been uploaded to a texture.
|
|
|
|
virtual void FinishedSurfaceUpload();
|
|
|
|
|
|
|
|
virtual bool InUpdate() const { return !!mUpdateSurface; }
|
|
|
|
|
2013-12-13 09:32:06 -08:00
|
|
|
virtual void Resize(const gfx::IntSize& aSize);
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
GLuint mTexture;
|
|
|
|
TextureState mTextureState;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
nsRefPtr<GLContext> mGLContext;
|
2012-12-17 17:58:44 -08:00
|
|
|
nsRefPtr<gfxASurface> mUpdateSurface;
|
|
|
|
nsIntRegion mUpdateRegion;
|
|
|
|
|
|
|
|
// The offset into the update surface at which the update rect is located.
|
|
|
|
nsIntPoint mUpdateOffset;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A container class that complements many sub TextureImages into a big TextureImage.
|
|
|
|
* Aims to behave just like the real thing.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class TiledTextureImage
|
|
|
|
: public TextureImage
|
|
|
|
{
|
|
|
|
public:
|
2013-08-07 15:38:21 -07:00
|
|
|
TiledTextureImage(GLContext* aGL,
|
2013-12-13 09:32:06 -08:00
|
|
|
gfx::IntSize aSize,
|
2013-08-07 15:38:21 -07:00
|
|
|
TextureImage::ContentType,
|
|
|
|
TextureImage::Flags aFlags = TextureImage::NoFlags,
|
2013-09-24 13:45:13 -07:00
|
|
|
TextureImage::ImageFormat aImageFormat = gfxImageFormatUnknown);
|
2012-12-17 17:58:44 -08:00
|
|
|
~TiledTextureImage();
|
|
|
|
void DumpDiv();
|
|
|
|
virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion);
|
|
|
|
virtual void GetUpdateRegion(nsIntRegion& aForRegion);
|
|
|
|
virtual void EndUpdate();
|
2013-12-13 09:32:06 -08:00
|
|
|
virtual void Resize(const gfx::IntSize& aSize);
|
2012-12-17 17:58:44 -08:00
|
|
|
virtual uint32_t GetTileCount();
|
|
|
|
virtual void BeginTileIteration();
|
|
|
|
virtual bool NextTile();
|
|
|
|
virtual void SetIterationCallback(TileIterationCallback aCallback,
|
|
|
|
void* aCallbackData);
|
2013-08-13 06:44:53 -07:00
|
|
|
virtual gfx::IntRect GetTileRect();
|
2012-12-17 17:58:44 -08:00
|
|
|
virtual GLuint GetTextureID() {
|
|
|
|
return mImages[mCurrentImage]->GetTextureID();
|
|
|
|
}
|
|
|
|
virtual bool DirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
|
|
|
|
virtual bool InUpdate() const { return mInUpdate; }
|
|
|
|
virtual void BindTexture(GLenum);
|
|
|
|
|
|
|
|
protected:
|
2013-08-13 06:44:53 -07:00
|
|
|
virtual gfx::IntRect GetSrcTileRect();
|
2012-12-17 17:58:44 -08:00
|
|
|
|
|
|
|
unsigned int mCurrentImage;
|
|
|
|
TileIterationCallback mIterationCallback;
|
|
|
|
void* mIterationCallbackData;
|
|
|
|
nsTArray< nsRefPtr<TextureImage> > mImages;
|
|
|
|
bool mInUpdate;
|
2013-12-13 09:32:06 -08:00
|
|
|
gfx::IntSize mSize;
|
2012-12-17 17:58:44 -08:00
|
|
|
unsigned int mTileSize;
|
|
|
|
unsigned int mRows, mColumns;
|
|
|
|
GLContext* mGL;
|
|
|
|
// A temporary surface to faciliate cross-tile updates.
|
|
|
|
nsRefPtr<gfxASurface> mUpdateSurface;
|
|
|
|
// The region of update requested
|
|
|
|
nsIntRegion mUpdateRegion;
|
|
|
|
TextureState mTextureState;
|
2013-08-07 15:38:21 -07:00
|
|
|
TextureImage::ImageFormat mImageFormat;
|
2012-12-17 17:58:44 -08:00
|
|
|
};
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/**
|
|
|
|
* Creates a TextureImage of the basic implementation, can be useful in cases
|
|
|
|
* where we know we don't want to use platform-specific TextureImage.
|
|
|
|
* In doubt, use GLContext::CreateTextureImage instead.
|
|
|
|
*/
|
|
|
|
already_AddRefed<TextureImage>
|
|
|
|
CreateBasicTextureImage(GLContext* aGL,
|
2013-12-13 09:32:06 -08:00
|
|
|
const gfx::IntSize& aSize,
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
TextureImage::ContentType aContentType,
|
|
|
|
GLenum aWrapMode,
|
2013-08-07 15:38:21 -07:00
|
|
|
TextureImage::Flags aFlags,
|
2013-09-24 13:45:13 -07:00
|
|
|
TextureImage::ImageFormat aImageFormat = gfxImageFormatUnknown);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-12-03 10:44:38 -08:00
|
|
|
/**
|
|
|
|
* Return a valid, allocated TextureImage of |aSize| with
|
|
|
|
* |aContentType|. If |aContentType| is COLOR, |aImageFormat| can be used
|
|
|
|
* to hint at the preferred RGB format, however it is not necessarily
|
|
|
|
* respected. The TextureImage's texture is configured to use
|
|
|
|
* |aWrapMode| (usually GL_CLAMP_TO_EDGE or GL_REPEAT) and by
|
|
|
|
* default, GL_LINEAR filtering. Specify
|
|
|
|
* |aFlags=UseNearestFilter| for GL_NEAREST filtering. Specify
|
|
|
|
* |aFlags=NeedsYFlip| if the image is flipped. Return
|
|
|
|
* nullptr if creating the TextureImage fails.
|
|
|
|
*
|
|
|
|
* The returned TextureImage may only be used with this GLContext.
|
|
|
|
* Attempting to use the returned TextureImage after this
|
|
|
|
* GLContext is destroyed will result in undefined (and likely
|
|
|
|
* crashy) behavior.
|
|
|
|
*/
|
|
|
|
already_AddRefed<TextureImage>
|
|
|
|
CreateTextureImage(GLContext* gl,
|
2013-12-13 09:32:06 -08:00
|
|
|
const gfx::IntSize& aSize,
|
2013-12-03 10:44:38 -08:00
|
|
|
TextureImage::ContentType aContentType,
|
|
|
|
GLenum aWrapMode,
|
|
|
|
TextureImage::Flags aFlags = TextureImage::NoFlags,
|
|
|
|
TextureImage::ImageFormat aImageFormat = gfxImageFormatUnknown);
|
|
|
|
|
2012-12-17 17:58:44 -08:00
|
|
|
} // namespace gl
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* GLTEXTUREIMAGE_H_ */
|