Hash :
856d9d4b
Author :
Date :
2014-09-18T15:08:49
Squash the TextureStorageInterface heirarchy. Since there are no longer any significant differences in the child classes of TextureStorageInterface, we can scrap the different implementations. This involves changing the function names of some Renderer functions which relied on overloading. BUG=angle:741 Change-Id: I074797e4ac0bf3ecf8fe4bddf84eaed28b1a2c23 Reviewed-on: https://chromium-review.googlesource.com/218315 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
//
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// TextureStorage.h: Defines the abstract rx::TextureStorage class.
#ifndef LIBGLESV2_RENDERER_TEXTURESTORAGE_H_
#define LIBGLESV2_RENDERER_TEXTURESTORAGE_H_
#include "common/debug.h"
#include <GLES2/gl2.h>
namespace gl
{
struct ImageIndex;
}
namespace rx
{
class Renderer;
class SwapChain;
class RenderTarget;
class TextureStorage
{
public:
TextureStorage() {};
virtual ~TextureStorage() {};
virtual int getTopLevel() const = 0;
virtual bool isRenderTarget() const = 0;
virtual bool isManaged() const = 0;
virtual int getLevelCount() const = 0;
virtual RenderTarget *getRenderTarget(const gl::ImageIndex &index) = 0;
virtual void generateMipmaps() = 0;
private:
DISALLOW_COPY_AND_ASSIGN(TextureStorage);
};
class TextureStorageInterface
{
public:
TextureStorageInterface(TextureStorage *storageInstance, unsigned int rtSerialLayerStride);
virtual ~TextureStorageInterface();
TextureStorage *getStorageInstance() { return mInstance; }
unsigned int getTextureSerial() const;
virtual int getTopLevel() const;
virtual bool isRenderTarget() const;
virtual bool isManaged() const;
virtual int getLevelCount() const;
unsigned int getRenderTargetSerial(const gl::ImageIndex &index) const;
protected:
TextureStorage *mInstance;
private:
DISALLOW_COPY_AND_ASSIGN(TextureStorageInterface);
const unsigned int mTextureSerial;
static unsigned int issueTextureSerial();
static unsigned int mCurrentTextureSerial;
unsigned int mFirstRenderTargetSerial;
unsigned int mRenderTargetSerialsLayerStride;
};
}
#endif // LIBGLESV2_RENDERER_TEXTURESTORAGE_H_