2 // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 // TextureStorage.h: Defines the abstract rx::TextureStorage class.
9 #ifndef LIBGLESV2_RENDERER_TEXTURESTORAGE_H_
10 #define LIBGLESV2_RENDERER_TEXTURESTORAGE_H_
12 #include "common/debug.h"
14 #include <GLES2/gl2.h>
31 virtual ~TextureStorage() {};
33 virtual int getTopLevel() const = 0;
34 virtual bool isRenderTarget() const = 0;
35 virtual bool isManaged() const = 0;
36 virtual int getLevelCount() const = 0;
38 virtual RenderTarget *getRenderTarget(const gl::ImageIndex &index) = 0;
39 virtual void generateMipmaps() = 0;
41 unsigned int getRenderTargetSerial(const gl::ImageIndex &index) const;
42 unsigned int getTextureSerial() const;
45 void initializeSerials(unsigned int rtSerialsToReserve, unsigned int rtSerialsLayerStride);
48 DISALLOW_COPY_AND_ASSIGN(TextureStorage);
50 const unsigned int mTextureSerial;
51 static unsigned int issueTextureSerial();
53 static unsigned int mCurrentTextureSerial;
55 unsigned int mFirstRenderTargetSerial;
56 unsigned int mRenderTargetSerialsLayerStride;
61 #endif // LIBGLESV2_RENDERER_TEXTURESTORAGE_H_