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 MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 926
#define BUILD_REVISION 927
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -1267,9 +1267,9 @@ void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width,
mDirty = true;
}
TextureStorage::TextureStorage(bool renderable)
: mRenderable(renderable),
mD3DPool(getDisplay()->getTexturePool(renderable)),
TextureStorage::TextureStorage(bool renderTarget)
: mRenderTarget(renderTarget),
mD3DPool(getDisplay()->getTexturePool(mRenderTarget)),
mTextureSerial(issueTextureSerial())
{
}
......@@ -1278,9 +1278,9 @@ TextureStorage::~TextureStorage()
{
}
bool TextureStorage::isRenderable() const
bool TextureStorage::isRenderTarget() const
{
return mRenderable;
return mRenderTarget;
}
bool TextureStorage::isManaged() const
......@@ -1671,12 +1671,13 @@ TextureStorage2D::TextureStorage2D(IDirect3DTexture9 *surfaceTexture) : TextureS
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();
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))
{
......@@ -1908,7 +1909,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
}
else
{
if (!mTexStorage || !mTexStorage->isRenderable())
if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
......@@ -1960,7 +1961,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
}
else
{
if (!mTexStorage || !mTexStorage->isRenderable())
if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
......@@ -2248,7 +2249,7 @@ void Texture2D::generateMipmaps()
mImageArray[0].getType());
}
if (mTexStorage && mTexStorage->isRenderable())
if (mTexStorage && mTexStorage->isRenderTarget())
{
for (unsigned int i = 1; i <= q; i++)
{
......@@ -2304,7 +2305,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target)
{
ASSERT(target == GL_TEXTURE_2D);
if (!mTexStorage || !mTexStorage->isRenderable())
if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
......@@ -2324,12 +2325,13 @@ TextureStorage *Texture2D::getStorage() const
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();
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))
{
......@@ -2773,7 +2775,7 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint
}
else
{
if (!mTexStorage || !mTexStorage->isRenderable())
if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
......@@ -2831,7 +2833,7 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi
}
else
{
if (!mTexStorage || !mTexStorage->isRenderable())
if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
......@@ -2932,7 +2934,7 @@ void TextureCubeMap::generateMipmaps()
}
}
if (mTexStorage && mTexStorage->isRenderable())
if (mTexStorage && mTexStorage->isRenderTarget())
{
for (unsigned int f = 0; f < 6; f++)
{
......@@ -2996,7 +2998,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target)
{
ASSERT(IsCubemapTextureTarget(target));
if (!mTexStorage || !mTexStorage->isRenderable())
if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
......
......@@ -144,11 +144,11 @@ class Image
class TextureStorage
{
public:
explicit TextureStorage(bool renderable);
explicit TextureStorage(bool renderTarget);
virtual ~TextureStorage();
bool isRenderable() const;
bool isRenderTarget() const;
bool isManaged() const;
D3DPOOL getPool() const;
unsigned int getTextureSerial() const;
......@@ -157,7 +157,7 @@ class TextureStorage
private:
DISALLOW_COPY_AND_ASSIGN(TextureStorage);
const bool mRenderable;
const bool mRenderTarget;
const D3DPOOL mD3DPool;
const unsigned int mTextureSerial;
......@@ -255,7 +255,7 @@ class TextureStorage2D : public TextureStorage
{
public:
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();
......@@ -329,7 +329,7 @@ class Texture2D : public Texture
class TextureStorageCubeMap : public TextureStorage
{
public:
TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderable);
TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderTarget);
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