Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 1 | // |
| 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 Lang | 0b7eef7 | 2014-06-12 14:10:47 -0400 | [diff] [blame^] | 14 | #include "angle_gl.h" |
| 15 | |
Brandon Jones | 0511e80 | 2014-07-14 16:27:26 -0700 | [diff] [blame] | 16 | namespace egl |
| 17 | { |
| 18 | class Surface; |
| 19 | } |
| 20 | |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 21 | namespace gl |
| 22 | { |
| 23 | class Framebuffer; |
Brandon Jones | 0511e80 | 2014-07-14 16:27:26 -0700 | [diff] [blame] | 24 | struct PixelUnpackState; |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 25 | struct SamplerState; |
| 26 | } |
| 27 | |
| 28 | namespace rx |
| 29 | { |
| 30 | |
| 31 | class Image; |
| 32 | class RenderTarget; |
| 33 | class Renderer; |
| 34 | class TextureStorageInterface; |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 35 | |
Brandon Jones | 6b19b00 | 2014-07-16 14:32:05 -0700 | [diff] [blame] | 36 | class TextureImpl |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 37 | { |
| 38 | public: |
Brandon Jones | 6053a52 | 2014-07-25 16:22:09 -0700 | [diff] [blame] | 39 | virtual ~TextureImpl() {}; |
| 40 | |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 41 | // TODO: If this methods could go away that would be ideal; |
| 42 | // TextureStorage should only be necessary for the D3D backend, and as such |
| 43 | // higher level code should not rely on it. |
| 44 | virtual TextureStorageInterface *getNativeTexture() = 0; |
| 45 | |
Brandon Jones | cef06ff | 2014-08-05 13:27:48 -0700 | [diff] [blame] | 46 | virtual Image *getImage(int level, int layer) const = 0; |
| 47 | virtual GLsizei getLayerCount(int level) const = 0; |
| 48 | |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 49 | virtual void setUsage(GLenum usage) = 0; |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 50 | |
Brandon Jones | cef06ff | 2014-08-05 13:27:48 -0700 | [diff] [blame] | 51 | 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; |
| 52 | virtual void setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels) = 0; |
| 53 | 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; |
| 54 | 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; |
| 55 | virtual void copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0; |
Brandon Jones | 6b19b00 | 2014-07-16 14:32:05 -0700 | [diff] [blame] | 56 | 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 Jones | cef06ff | 2014-08-05 13:27:48 -0700 | [diff] [blame] | 57 | virtual void storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) = 0; |
Brandon Jones | 6b19b00 | 2014-07-16 14:32:05 -0700 | [diff] [blame] | 58 | |
| 59 | virtual void generateMipmaps() = 0; |
Brandon Jones | cef06ff | 2014-08-05 13:27:48 -0700 | [diff] [blame] | 60 | |
| 61 | virtual unsigned int getRenderTargetSerial(GLint level, GLint layer) = 0; |
| 62 | virtual RenderTarget *getRenderTarget(GLint level, GLint layer) = 0; |
| 63 | virtual RenderTarget *getDepthStencil(GLint level, GLint layer) = 0; |
Brandon Jones | 6b19b00 | 2014-07-16 14:32:05 -0700 | [diff] [blame] | 64 | |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 65 | virtual void bindTexImage(egl::Surface *surface) = 0; |
| 66 | virtual void releaseTexImage() = 0; |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 67 | }; |
| 68 | |
Brandon Jones | f47bebc | 2014-07-09 14:28:42 -0700 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | #endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_ |