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
14#include "angle_gl.h"
15
16#include "libGLESv2/ImageIndex.h"
17
18namespace egl
19{
20class Surface;
21}
22
23namespace gl
24{
25class Framebuffer;
26struct PixelUnpackState;
27struct SamplerState;
28}
29
30namespace rx
31{
32
33class Image;
34class Renderer;
35class TextureStorage;
36
37class TextureImpl
38{
39  public:
40    virtual ~TextureImpl() {};
41
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;
46
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;
51
52    virtual void setUsage(GLenum usage) = 0;
53
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;
61
62    virtual void generateMipmaps() = 0;
63
64    virtual void bindTexImage(egl::Surface *surface) = 0;
65    virtual void releaseTexImage() = 0;
66};
67
68}
69
70#endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_
71