summaryrefslogtreecommitdiffstats
path: root/cc/test/test_gles2_interface.h
blob: a52d73e77d65cdf0ec0a0ad080ec23dbd042e915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_TEST_TEST_GLES2_INTERFACE_H_
#define CC_TEST_TEST_GLES2_INTERFACE_H_

#include "gpu/command_buffer/client/gles2_interface_stub.h"

namespace cc {
class TestWebGraphicsContext3D;

class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub {
 public:
  explicit TestGLES2Interface(TestWebGraphicsContext3D* test_context);
  virtual ~TestGLES2Interface();

  virtual void GenTextures(GLsizei n, GLuint* textures) OVERRIDE;
  virtual void GenBuffers(GLsizei n, GLuint* buffers) OVERRIDE;
  virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) OVERRIDE;
  virtual void GenQueriesEXT(GLsizei n, GLuint* queries) OVERRIDE;

  virtual void DeleteTextures(GLsizei n, const GLuint* textures) OVERRIDE;
  virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) OVERRIDE;
  virtual void DeleteFramebuffers(GLsizei n,
                                  const GLuint* framebuffers) OVERRIDE;
  virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) OVERRIDE;

  virtual GLuint CreateShader(GLenum type) OVERRIDE;
  virtual GLuint CreateProgram() OVERRIDE;

  virtual void BindTexture(GLenum target, GLuint texture) OVERRIDE;

  virtual void GetIntegerv(GLenum pname, GLint* params) OVERRIDE;
  virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) OVERRIDE;
  virtual void GetProgramiv(GLuint program,
                            GLenum pname,
                            GLint* params) OVERRIDE;
  virtual void GetShaderPrecisionFormat(GLenum shadertype,
                                        GLenum precisiontype,
                                        GLint* range,
                                        GLint* precision) OVERRIDE;
  virtual GLenum CheckFramebufferStatus(GLenum target) OVERRIDE;

  virtual void ActiveTexture(GLenum target) OVERRIDE;
  virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
      OVERRIDE;
  virtual void UseProgram(GLuint program) OVERRIDE;
  virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
      OVERRIDE;
  virtual void DrawElements(GLenum mode,
                            GLsizei count,
                            GLenum type,
                            const void* indices) OVERRIDE;
  virtual void ClearColor(GLclampf red,
                          GLclampf green,
                          GLclampf blue,
                          GLclampf alpha) OVERRIDE;
  virtual void ClearStencil(GLint s) OVERRIDE;
  virtual void Clear(GLbitfield mask) OVERRIDE;
  virtual void Flush() OVERRIDE;
  virtual void Finish() OVERRIDE;
  virtual void ShallowFlushCHROMIUM() OVERRIDE;
  virtual void Enable(GLenum cap) OVERRIDE;
  virtual void Disable(GLenum cap) OVERRIDE;

  virtual void BindBuffer(GLenum target, GLuint buffer) OVERRIDE;
  virtual void BindFramebuffer(GLenum target, GLuint buffer) OVERRIDE;

  virtual void TexImage2D(GLenum target,
                          GLint level,
                          GLint internalformat,
                          GLsizei width,
                          GLsizei height,
                          GLint border,
                          GLenum format,
                          GLenum type,
                          const void* pixels) OVERRIDE;
  virtual void TexSubImage2D(GLenum target,
                             GLint level,
                             GLint xoffset,
                             GLint yoffset,
                             GLsizei width,
                             GLsizei height,
                             GLenum format,
                             GLenum type,
                             const void* pixels) OVERRIDE;
  virtual void TexStorage2DEXT(GLenum target,
                               GLsizei levels,
                               GLenum internalformat,
                               GLsizei width,
                               GLsizei height) OVERRIDE;
  virtual void TexImageIOSurface2DCHROMIUM(GLenum target,
                                           GLsizei width,
                                           GLsizei height,
                                           GLuint io_surface_id,
                                           GLuint plane) OVERRIDE;
  virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE;

  virtual void AsyncTexImage2DCHROMIUM(GLenum target,
                                       GLint level,
                                       GLint internalformat,
                                       GLsizei width,
                                       GLsizei height,
                                       GLint border,
                                       GLenum format,
                                       GLenum type,
                                       const void* pixels) OVERRIDE;
  virtual void AsyncTexSubImage2DCHROMIUM(GLenum target,
                                          GLint level,
                                          GLint xoffset,
                                          GLint yoffset,
                                          GLsizei width,
                                          GLsizei height,
                                          GLenum format,
                                          GLenum type,
                                          const void* pixels) OVERRIDE;
  virtual void CompressedTexImage2D(GLenum target,
                                    GLint level,
                                    GLenum internalformat,
                                    GLsizei width,
                                    GLsizei height,
                                    GLint border,
                                    GLsizei image_size,
                                    const void* data) OVERRIDE;
  virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) OVERRIDE;
  virtual GLuint CreateImageCHROMIUM(GLsizei width,
                                     GLsizei height,
                                     GLenum internalformat) OVERRIDE;
  virtual void DestroyImageCHROMIUM(GLuint image_id) OVERRIDE;
  virtual void* MapImageCHROMIUM(GLuint image_id, GLenum access) OVERRIDE;
  virtual void GetImageParameterivCHROMIUM(GLuint image_id,
                                           GLenum pname,
                                           GLint* params) OVERRIDE;
  virtual void UnmapImageCHROMIUM(GLuint image_id) OVERRIDE;
  virtual void BindTexImage2DCHROMIUM(GLenum target, GLint image_id) OVERRIDE;
  virtual void ReleaseTexImage2DCHROMIUM(GLenum target,
                                         GLint image_id) OVERRIDE;

  virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) OVERRIDE;
  virtual GLboolean UnmapBufferCHROMIUM(GLuint target) OVERRIDE;
  virtual void BufferData(GLenum target,
                          GLsizeiptr size,
                          const void* data,
                          GLenum usage) OVERRIDE;

  virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
  virtual GLuint InsertSyncPointCHROMIUM() OVERRIDE;

  virtual void BeginQueryEXT(GLenum target, GLuint id) OVERRIDE;
  virtual void EndQueryEXT(GLenum target) OVERRIDE;
  virtual void GetQueryObjectuivEXT(GLuint id,
                                    GLenum pname,
                                    GLuint* params) OVERRIDE;

  virtual void DiscardFramebufferEXT(GLenum target,
                                     GLsizei count,
                                     const GLenum* attachments) OVERRIDE;
  virtual void GenMailboxCHROMIUM(GLbyte* mailbox) OVERRIDE;
  virtual void ProduceTextureCHROMIUM(GLenum target,
                                      const GLbyte* mailbox) OVERRIDE;
  virtual void ConsumeTextureCHROMIUM(GLenum target,
                                      const GLbyte* mailbox) OVERRIDE;

  virtual void ResizeCHROMIUM(GLuint width,
                              GLuint height,
                              float device_scale) OVERRIDE;
  virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;

 private:
  TestWebGraphicsContext3D* test_context_;
};

}  // namespace cc

#endif  // CC_TEST_TEST_GLES2_INTERFACE_H_