blob: ee13c12adbe1be5476ec825666f886706bf36442 [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
Brandon Jones0511e802014-07-14 16:27:26 -070014namespace egl
15{
16class Surface;
17}
18
Brandon Jonesf47bebc2014-07-09 14:28:42 -070019namespace gl
20{
21class Framebuffer;
Brandon Jones0511e802014-07-14 16:27:26 -070022struct PixelUnpackState;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070023struct SamplerState;
24}
25
26namespace rx
27{
28
29class Image;
30class RenderTarget;
31class Renderer;
32class TextureStorageInterface;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070033
Brandon Jones6b19b002014-07-16 14:32:05 -070034class TextureImpl
Brandon Jonesf47bebc2014-07-09 14:28:42 -070035{
36 public:
Brandon Jones6053a522014-07-25 16:22:09 -070037 virtual ~TextureImpl() {};
38
Brandon Jonesf47bebc2014-07-09 14:28:42 -070039 // TODO: If this methods could go away that would be ideal;
40 // TextureStorage should only be necessary for the D3D backend, and as such
41 // higher level code should not rely on it.
42 virtual TextureStorageInterface *getNativeTexture() = 0;
43
Brandon Jonescef06ff2014-08-05 13:27:48 -070044 virtual Image *getImage(int level, int layer) const = 0;
45 virtual GLsizei getLayerCount(int level) const = 0;
46
Brandon Jonesf47bebc2014-07-09 14:28:42 -070047 virtual void setUsage(GLenum usage) = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070048
Brandon Jonescef06ff2014-08-05 13:27:48 -070049 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;
50 virtual void setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels) = 0;
51 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;
52 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;
53 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 -070054 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 -070055 virtual void storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) = 0;
Brandon Jones6b19b002014-07-16 14:32:05 -070056
57 virtual void generateMipmaps() = 0;
Brandon Jonescef06ff2014-08-05 13:27:48 -070058
59 virtual unsigned int getRenderTargetSerial(GLint level, GLint layer) = 0;
60 virtual RenderTarget *getRenderTarget(GLint level, GLint layer) = 0;
61 virtual RenderTarget *getDepthStencil(GLint level, GLint layer) = 0;
Brandon Jones6b19b002014-07-16 14:32:05 -070062
Brandon Jonesf47bebc2014-07-09 14:28:42 -070063 virtual void bindTexImage(egl::Surface *surface) = 0;
64 virtual void releaseTexImage() = 0;
Brandon Jonesf47bebc2014-07-09 14:28:42 -070065};
66
Brandon Jonesf47bebc2014-07-09 14:28:42 -070067}
68
69#endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_