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 "libGLESv2/Error.h"
14 #include "common/debug.h"
15 #include "libGLESv2/Error.h"
17 #include <GLES2/gl2.h>
24 struct PixelUnpackState;
38 virtual ~TextureStorage() {};
40 virtual int getTopLevel() const = 0;
41 virtual bool isRenderTarget() const = 0;
42 virtual bool isManaged() const = 0;
43 virtual int getLevelCount() const = 0;
45 virtual gl::Error getRenderTarget(const gl::ImageIndex &index, RenderTarget **outRT) = 0;
46 virtual gl::Error generateMipmap(const gl::ImageIndex &sourceIndex, const gl::ImageIndex &destIndex) = 0;
48 virtual gl::Error copyToStorage(TextureStorage *destStorage) = 0;
49 virtual gl::Error setData(const gl::ImageIndex &index, Image *image, const gl::Box *destBox, GLenum type,
50 const gl::PixelUnpackState &unpack, const uint8_t *pixelData) = 0;
52 unsigned int getRenderTargetSerial(const gl::ImageIndex &index) const;
53 unsigned int getTextureSerial() const;
56 void initializeSerials(unsigned int rtSerialsToReserve, unsigned int rtSerialsLayerStride);
59 DISALLOW_COPY_AND_ASSIGN(TextureStorage);
61 unsigned int mFirstRenderTargetSerial;
62 unsigned int mRenderTargetSerialsLayerStride;
67 #endif // LIBGLESV2_RENDERER_TEXTURESTORAGE_H_