Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / libGLESv2 / renderer / TextureImpl.h
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 #include "libGLESv2/Error.h"
14
15 #include "angle_gl.h"
16
17 #include "libGLESv2/ImageIndex.h"
18
19 namespace egl
20 {
21 class Surface;
22 }
23
24 namespace gl
25 {
26 class Framebuffer;
27 struct PixelUnpackState;
28 struct SamplerState;
29 }
30
31 namespace rx
32 {
33
34 class Image;
35 class Renderer;
36 class TextureStorage;
37
38 class TextureImpl
39 {
40   public:
41     virtual ~TextureImpl() {};
42
43     // Deprecated in favour of the ImageIndex method
44     virtual Image *getImage(int level, int layer) const = 0;
45     virtual Image *getImage(const gl::ImageIndex &index) const = 0;
46     virtual GLsizei getLayerCount(int level) const = 0;
47
48     virtual void setUsage(GLenum usage) = 0;
49
50     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;
51     virtual gl::Error setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const gl::PixelUnpackState &unpack, const void *pixels) = 0;
52     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;
53     virtual gl::Error subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const gl::PixelUnpackState &unpack, const void *pixels) = 0;
54     virtual gl::Error copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
55     virtual gl::Error copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
56     virtual gl::Error storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) = 0;
57
58     virtual gl::Error generateMipmaps() = 0;
59
60     virtual void bindTexImage(egl::Surface *surface) = 0;
61     virtual void releaseTexImage() = 0;
62 };
63
64 }
65
66 #endif // LIBGLESV2_RENDERER_TEXTUREIMPL_H_