blob: dcf839c73bda4177c4030b2a57a1725a450b7d23 [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"
Geoff Lang1ba6b8d2014-08-28 10:57:31 -040013#include "libGLESv2/Error.h"
Brandon Jonesf47bebc2014-07-09 14:28:42 -070014
Geoff Lang0b7eef72014-06-12 14:10:47 -040015#include "angle_gl.h"
16
Jamie Madillfeda4d22014-09-17 13:03:29 -040017#include "libGLESv2/ImageIndex.h"
18
Brandon Jones0511e802014-07-14 16:27:26 -070019namespace egl
20{
21class Surface;
22}
23
Brandon Jonesf47bebc2014-07-09 14:28:42 -070024namespace gl
25{
26class Framebuffer;
Brandon Jones0511e802014-07-14 16:27:26 -070027struct PixelUnpackState;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070028struct SamplerState;
29}
30
31namespace rx
32{
33
34class Image;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070035class Renderer;
Jamie Madill2f06dbf2014-09-18 15:08:50 -040036class TextureStorage;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070037
Brandon Jones6b19b002014-07-16 14:32:05 -070038class TextureImpl
Brandon Jonesf47bebc2014-07-09 14:28:42 -070039{
40 public:
Brandon Jones6053a522014-07-25 16:22:09 -070041 virtual ~TextureImpl() {};
42
Brandon Jonesf47bebc2014-07-09 14:28:42 -070043 // TODO: If this methods could go away that would be ideal;
44 // TextureStorage should only be necessary for the D3D backend, and as such
45 // higher level code should not rely on it.
Jamie Madill2f06dbf2014-09-18 15:08:50 -040046 virtual TextureStorage *getNativeTexture() = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070047
Jamie Madillfeda4d22014-09-17 13:03:29 -040048 // Deprecated in favour of the ImageIndex method
Brandon Jonescef06ff2014-08-05 13:27:48 -070049 virtual Image *getImage(int level, int layer) const = 0;
Jamie Madillfeda4d22014-09-17 13:03:29 -040050 virtual Image *getImage(const gl::ImageIndex &index) const = 0;
Brandon Jonescef06ff2014-08-05 13:27:48 -070051 virtual GLsizei getLayerCount(int level) const = 0;
52
Brandon Jonesf47bebc2014-07-09 14:28:42 -070053 virtual void setUsage(GLenum usage) = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070054
Geoff Lang1ba6b8d2014-08-28 10:57:31 -040055 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;
Brandon Jonescef06ff2014-08-05 13:27:48 -070056 virtual void setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels) = 0;
Geoff Lang1ba6b8d2014-08-28 10:57:31 -040057 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;
Brandon Jonescef06ff2014-08-05 13:27:48 -070058 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;
59 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 -070060 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 -070061 virtual void storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) = 0;
Brandon Jones6b19b002014-07-16 14:32:05 -070062
63 virtual void generateMipmaps() = 0;
Brandon Jonescef06ff2014-08-05 13:27:48 -070064
Brandon Jonesf47bebc2014-07-09 14:28:42 -070065 virtual void bindTexImage(egl::Surface *surface) = 0;
66 virtual void releaseTexImage() = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070067};
68
Brandon Jonesf47bebc2014-07-09 14:28:42 -070069}
70
71#endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_