blob: e3cc50d68094c50880759a8f476af14fa82996ac [file] [log] [blame]
Brandon Jonesf47bebc2014-07-09 14:28:42 -07001//
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.
5//
6
7// TextureImpl.h: Defines the abstract rx::TextureImpl classes.
8
9#ifndef LIBGLESV2_RENDERER_TEXTUREIMPL_H_
10#define LIBGLESV2_RENDERER_TEXTUREIMPL_H_
11
12#include "common/angleutils.h"
13
Geoff Lang0b7eef72014-06-12 14:10:47 -040014#include "angle_gl.h"
15
Jamie Madillfeda4d22014-09-17 13:03:29 -040016#include "libGLESv2/ImageIndex.h"
17
Brandon Jones0511e802014-07-14 16:27:26 -070018namespace egl
19{
20class Surface;
21}
22
Brandon Jonesf47bebc2014-07-09 14:28:42 -070023namespace gl
24{
25class Framebuffer;
Brandon Jones0511e802014-07-14 16:27:26 -070026struct PixelUnpackState;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070027struct SamplerState;
28}
29
30namespace rx
31{
32
33class Image;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070034class Renderer;
Jamie Madill2f06dbf2014-09-18 15:08:50 -040035class TextureStorage;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070036
Brandon Jones6b19b002014-07-16 14:32:05 -070037class TextureImpl
Brandon Jonesf47bebc2014-07-09 14:28:42 -070038{
39 public:
Brandon Jones6053a522014-07-25 16:22:09 -070040 virtual ~TextureImpl() {};
41
Brandon Jonesf47bebc2014-07-09 14:28:42 -070042 // 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.
Jamie Madill2f06dbf2014-09-18 15:08:50 -040045 virtual TextureStorage *getNativeTexture() = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070046
Jamie Madillfeda4d22014-09-17 13:03:29 -040047 // Deprecated in favour of the ImageIndex method
Brandon Jonescef06ff2014-08-05 13:27:48 -070048 virtual Image *getImage(int level, int layer) const = 0;
Jamie Madillfeda4d22014-09-17 13:03:29 -040049 virtual Image *getImage(const gl::ImageIndex &index) const = 0;
Brandon Jonescef06ff2014-08-05 13:27:48 -070050 virtual GLsizei getLayerCount(int level) const = 0;
51
Brandon Jonesf47bebc2014-07-09 14:28:42 -070052 virtual void setUsage(GLenum usage) = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070053
Brandon Jonescef06ff2014-08-05 13:27:48 -070054 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;
Brandon Jones6b19b002014-07-16 14:32:05 -070059 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;
Brandon Jonescef06ff2014-08-05 13:27:48 -070060 virtual void storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) = 0;
Brandon Jones6b19b002014-07-16 14:32:05 -070061
62 virtual void generateMipmaps() = 0;
Brandon Jonescef06ff2014-08-05 13:27:48 -070063
Brandon Jonesf47bebc2014-07-09 14:28:42 -070064 virtual void bindTexImage(egl::Surface *surface) = 0;
65 virtual void releaseTexImage() = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070066};
67
Brandon Jonesf47bebc2014-07-09 14:28:42 -070068}
69
70#endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_