2 // Copyright 2014 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 // TextureImpl.h: Defines the abstract rx::TextureImpl classes.
9 #ifndef LIBGLESV2_RENDERER_TEXTUREIMPL_H_
10 #define LIBGLESV2_RENDERER_TEXTUREIMPL_H_
12 #include "common/angleutils.h"
13 #include "libGLESv2/Error.h"
17 #include "libGLESv2/ImageIndex.h"
27 struct PixelUnpackState;
41 virtual ~TextureImpl() {};
43 // Deprecated in favour of the ImageIndex method
44 virtual Image *getImage(int level, int layer) const = 0;
45 virtual Image *getImage(const gl::ImageIndex &index) const = 0;
46 virtual GLsizei getLayerCount(int level) const = 0;
48 virtual void setUsage(GLenum usage) = 0;
50 virtual gl::Error setImage(GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels) = 0;
51 virtual gl::Error setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const gl::PixelUnpackState &unpack, const void *pixels) = 0;
52 virtual gl::Error subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels) = 0;
53 virtual gl::Error subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const gl::PixelUnpackState &unpack, const void *pixels) = 0;
54 virtual gl::Error copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
55 virtual gl::Error copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
56 virtual gl::Error storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) = 0;
58 virtual gl::Error generateMipmaps() = 0;
60 virtual void bindTexImage(egl::Surface *surface) = 0;
61 virtual void releaseTexImage() = 0;
66 #endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_