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"
16 #include "libGLESv2/ImageIndex.h"
26 struct PixelUnpackState;
40 virtual ~TextureImpl() {};
42 // TODO: If this methods could go away that would be ideal;
43 // TextureStorage should only be necessary for the D3D backend, and as such
44 // higher level code should not rely on it.
45 virtual TextureStorage *getNativeTexture() = 0;
47 // Deprecated in favour of the ImageIndex method
48 virtual Image *getImage(int level, int layer) const = 0;
49 virtual Image *getImage(const gl::ImageIndex &index) const = 0;
50 virtual GLsizei getLayerCount(int level) const = 0;
52 virtual void setUsage(GLenum usage) = 0;
54 virtual void 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;
55 virtual void setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels) = 0;
56 virtual void 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;
57 virtual void subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels) = 0;
58 virtual void copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
59 virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
60 virtual void storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) = 0;
62 virtual void generateMipmaps() = 0;
64 virtual void bindTexImage(egl::Surface *surface) = 0;
65 virtual void releaseTexImage() = 0;
70 #endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_