rename TextureStorage renderable flag to reflect it's actual usage

Trac #19356 Issue=273 Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@927 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent b9aa00b2
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 926 #define BUILD_REVISION 927
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1267,9 +1267,9 @@ void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ...@@ -1267,9 +1267,9 @@ void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width,
mDirty = true; mDirty = true;
} }
TextureStorage::TextureStorage(bool renderable) TextureStorage::TextureStorage(bool renderTarget)
: mRenderable(renderable), : mRenderTarget(renderTarget),
mD3DPool(getDisplay()->getTexturePool(renderable)), mD3DPool(getDisplay()->getTexturePool(mRenderTarget)),
mTextureSerial(issueTextureSerial()) mTextureSerial(issueTextureSerial())
{ {
} }
...@@ -1278,9 +1278,9 @@ TextureStorage::~TextureStorage() ...@@ -1278,9 +1278,9 @@ TextureStorage::~TextureStorage()
{ {
} }
bool TextureStorage::isRenderable() const bool TextureStorage::isRenderTarget() const
{ {
return mRenderable; return mRenderTarget;
} }
bool TextureStorage::isManaged() const bool TextureStorage::isManaged() const
...@@ -1671,12 +1671,13 @@ TextureStorage2D::TextureStorage2D(IDirect3DTexture9 *surfaceTexture) : TextureS ...@@ -1671,12 +1671,13 @@ TextureStorage2D::TextureStorage2D(IDirect3DTexture9 *surfaceTexture) : TextureS
mTexture = surfaceTexture; mTexture = surfaceTexture;
} }
TextureStorage2D::TextureStorage2D(int levels, D3DFORMAT format, int width, int height, bool renderable) : TextureStorage(renderable), mRenderTargetSerial(RenderbufferStorage::issueSerial()) TextureStorage2D::TextureStorage2D(int levels, D3DFORMAT format, int width, int height, bool renderTarget)
: TextureStorage(renderTarget), mRenderTargetSerial(RenderbufferStorage::issueSerial())
{ {
IDirect3DDevice9 *device = getDevice(); IDirect3DDevice9 *device = getDevice();
mTexture = NULL; mTexture = NULL;
HRESULT result = device->CreateTexture(width, height, levels, renderable ? D3DUSAGE_RENDERTARGET : 0, format, getPool(), &mTexture, NULL); HRESULT result = device->CreateTexture(width, height, levels, isRenderTarget() ? D3DUSAGE_RENDERTARGET : 0, format, getPool(), &mTexture, NULL);
if (FAILED(result)) if (FAILED(result))
{ {
...@@ -1908,7 +1909,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei ...@@ -1908,7 +1909,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
} }
else else
{ {
if (!mTexStorage || !mTexStorage->isRenderable()) if (!mTexStorage || !mTexStorage->isRenderTarget())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -1960,7 +1961,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo ...@@ -1960,7 +1961,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
} }
else else
{ {
if (!mTexStorage || !mTexStorage->isRenderable()) if (!mTexStorage || !mTexStorage->isRenderTarget())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2248,7 +2249,7 @@ void Texture2D::generateMipmaps() ...@@ -2248,7 +2249,7 @@ void Texture2D::generateMipmaps()
mImageArray[0].getType()); mImageArray[0].getType());
} }
if (mTexStorage && mTexStorage->isRenderable()) if (mTexStorage && mTexStorage->isRenderTarget())
{ {
for (unsigned int i = 1; i <= q; i++) for (unsigned int i = 1; i <= q; i++)
{ {
...@@ -2304,7 +2305,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target) ...@@ -2304,7 +2305,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target)
{ {
ASSERT(target == GL_TEXTURE_2D); ASSERT(target == GL_TEXTURE_2D);
if (!mTexStorage || !mTexStorage->isRenderable()) if (!mTexStorage || !mTexStorage->isRenderTarget())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2324,12 +2325,13 @@ TextureStorage *Texture2D::getStorage() const ...@@ -2324,12 +2325,13 @@ TextureStorage *Texture2D::getStorage() const
return mTexStorage; return mTexStorage;
} }
TextureStorageCubeMap::TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderable) : TextureStorage(renderable), mFirstRenderTargetSerial(RenderbufferStorage::issueCubeSerials()) TextureStorageCubeMap::TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderTarget)
: TextureStorage(renderTarget), mFirstRenderTargetSerial(RenderbufferStorage::issueCubeSerials())
{ {
IDirect3DDevice9 *device = getDevice(); IDirect3DDevice9 *device = getDevice();
mTexture = NULL; mTexture = NULL;
HRESULT result = device->CreateCubeTexture(size, levels, renderable ? D3DUSAGE_RENDERTARGET : 0, format, getPool(), &mTexture, NULL); HRESULT result = device->CreateCubeTexture(size, levels, isRenderTarget() ? D3DUSAGE_RENDERTARGET : 0, format, getPool(), &mTexture, NULL);
if (FAILED(result)) if (FAILED(result))
{ {
...@@ -2773,7 +2775,7 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint ...@@ -2773,7 +2775,7 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint
} }
else else
{ {
if (!mTexStorage || !mTexStorage->isRenderable()) if (!mTexStorage || !mTexStorage->isRenderTarget())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2831,7 +2833,7 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi ...@@ -2831,7 +2833,7 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi
} }
else else
{ {
if (!mTexStorage || !mTexStorage->isRenderable()) if (!mTexStorage || !mTexStorage->isRenderTarget())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2932,7 +2934,7 @@ void TextureCubeMap::generateMipmaps() ...@@ -2932,7 +2934,7 @@ void TextureCubeMap::generateMipmaps()
} }
} }
if (mTexStorage && mTexStorage->isRenderable()) if (mTexStorage && mTexStorage->isRenderTarget())
{ {
for (unsigned int f = 0; f < 6; f++) for (unsigned int f = 0; f < 6; f++)
{ {
...@@ -2996,7 +2998,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target) ...@@ -2996,7 +2998,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target)
{ {
ASSERT(IsCubemapTextureTarget(target)); ASSERT(IsCubemapTextureTarget(target));
if (!mTexStorage || !mTexStorage->isRenderable()) if (!mTexStorage || !mTexStorage->isRenderTarget())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
......
...@@ -144,11 +144,11 @@ class Image ...@@ -144,11 +144,11 @@ class Image
class TextureStorage class TextureStorage
{ {
public: public:
explicit TextureStorage(bool renderable); explicit TextureStorage(bool renderTarget);
virtual ~TextureStorage(); virtual ~TextureStorage();
bool isRenderable() const; bool isRenderTarget() const;
bool isManaged() const; bool isManaged() const;
D3DPOOL getPool() const; D3DPOOL getPool() const;
unsigned int getTextureSerial() const; unsigned int getTextureSerial() const;
...@@ -157,7 +157,7 @@ class TextureStorage ...@@ -157,7 +157,7 @@ class TextureStorage
private: private:
DISALLOW_COPY_AND_ASSIGN(TextureStorage); DISALLOW_COPY_AND_ASSIGN(TextureStorage);
const bool mRenderable; const bool mRenderTarget;
const D3DPOOL mD3DPool; const D3DPOOL mD3DPool;
const unsigned int mTextureSerial; const unsigned int mTextureSerial;
...@@ -255,7 +255,7 @@ class TextureStorage2D : public TextureStorage ...@@ -255,7 +255,7 @@ class TextureStorage2D : public TextureStorage
{ {
public: public:
explicit TextureStorage2D(IDirect3DTexture9 *surfaceTexture); explicit TextureStorage2D(IDirect3DTexture9 *surfaceTexture);
TextureStorage2D(int levels, D3DFORMAT format, int width, int height, bool renderable); TextureStorage2D(int levels, D3DFORMAT format, int width, int height, bool renderTarget);
virtual ~TextureStorage2D(); virtual ~TextureStorage2D();
...@@ -329,7 +329,7 @@ class Texture2D : public Texture ...@@ -329,7 +329,7 @@ class Texture2D : public Texture
class TextureStorageCubeMap : public TextureStorage class TextureStorageCubeMap : public TextureStorage
{ {
public: public:
TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderable); TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderTarget);
virtual ~TextureStorageCubeMap(); virtual ~TextureStorageCubeMap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment