1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TEST_TEST_GLES2_INTERFACE_H_
6 #define CC_TEST_TEST_GLES2_INTERFACE_H_
8 #include "gpu/command_buffer/client/gles2_interface_stub.h"
11 class TestWebGraphicsContext3D
;
13 class TestGLES2Interface
: public gpu::gles2::GLES2InterfaceStub
{
15 explicit TestGLES2Interface(TestWebGraphicsContext3D
* test_context
);
16 virtual ~TestGLES2Interface();
18 virtual void GenTextures(GLsizei n
, GLuint
* textures
) OVERRIDE
;
19 virtual void GenBuffers(GLsizei n
, GLuint
* buffers
) OVERRIDE
;
20 virtual void GenFramebuffers(GLsizei n
, GLuint
* framebuffers
) OVERRIDE
;
21 virtual void GenRenderbuffers(GLsizei n
, GLuint
* renderbuffers
) OVERRIDE
;
22 virtual void GenQueriesEXT(GLsizei n
, GLuint
* queries
) OVERRIDE
;
24 virtual void DeleteTextures(GLsizei n
, const GLuint
* textures
) OVERRIDE
;
25 virtual void DeleteBuffers(GLsizei n
, const GLuint
* buffers
) OVERRIDE
;
26 virtual void DeleteFramebuffers(GLsizei n
,
27 const GLuint
* framebuffers
) OVERRIDE
;
28 virtual void DeleteQueriesEXT(GLsizei n
, const GLuint
* queries
) OVERRIDE
;
30 virtual GLuint
CreateShader(GLenum type
) OVERRIDE
;
31 virtual GLuint
CreateProgram() OVERRIDE
;
33 virtual void BindTexture(GLenum target
, GLuint texture
) OVERRIDE
;
35 virtual void GetIntegerv(GLenum pname
, GLint
* params
) OVERRIDE
;
36 virtual void GetShaderiv(GLuint shader
, GLenum pname
, GLint
* params
) OVERRIDE
;
37 virtual void GetProgramiv(GLuint program
,
39 GLint
* params
) OVERRIDE
;
40 virtual void GetShaderPrecisionFormat(GLenum shadertype
,
43 GLint
* precision
) OVERRIDE
;
44 virtual GLenum
CheckFramebufferStatus(GLenum target
) OVERRIDE
;
46 virtual void ActiveTexture(GLenum target
) OVERRIDE
;
47 virtual void Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
49 virtual void UseProgram(GLuint program
) OVERRIDE
;
50 virtual void Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
52 virtual void DrawElements(GLenum mode
,
55 const void* indices
) OVERRIDE
;
56 virtual void ClearColor(GLclampf red
,
59 GLclampf alpha
) OVERRIDE
;
60 virtual void ClearStencil(GLint s
) OVERRIDE
;
61 virtual void Clear(GLbitfield mask
) OVERRIDE
;
62 virtual void Flush() OVERRIDE
;
63 virtual void Finish() OVERRIDE
;
64 virtual void ShallowFlushCHROMIUM() OVERRIDE
;
65 virtual void Enable(GLenum cap
) OVERRIDE
;
66 virtual void Disable(GLenum cap
) OVERRIDE
;
68 virtual void BindBuffer(GLenum target
, GLuint buffer
) OVERRIDE
;
69 virtual void BindRenderbuffer(GLenum target
, GLuint buffer
) OVERRIDE
;
70 virtual void BindFramebuffer(GLenum target
, GLuint buffer
) OVERRIDE
;
72 virtual void TexImage2D(GLenum target
,
80 const void* pixels
) OVERRIDE
;
81 virtual void TexSubImage2D(GLenum target
,
89 const void* pixels
) OVERRIDE
;
90 virtual void TexStorage2DEXT(GLenum target
,
92 GLenum internalformat
,
94 GLsizei height
) OVERRIDE
;
95 virtual void TexImageIOSurface2DCHROMIUM(GLenum target
,
99 GLuint plane
) OVERRIDE
;
100 virtual void TexParameteri(GLenum target
, GLenum pname
, GLint param
) OVERRIDE
;
102 virtual void AsyncTexImage2DCHROMIUM(GLenum target
,
104 GLenum internalformat
,
110 const void* pixels
) OVERRIDE
;
111 virtual void AsyncTexSubImage2DCHROMIUM(GLenum target
,
119 const void* pixels
) OVERRIDE
;
120 virtual void CompressedTexImage2D(GLenum target
,
122 GLenum internalformat
,
127 const void* data
) OVERRIDE
;
128 virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target
) OVERRIDE
;
129 virtual GLuint
CreateImageCHROMIUM(GLsizei width
,
131 GLenum internalformat
,
132 GLenum usage
) OVERRIDE
;
133 virtual void DestroyImageCHROMIUM(GLuint image_id
) OVERRIDE
;
134 virtual void* MapImageCHROMIUM(GLuint image_id
) OVERRIDE
;
135 virtual void GetImageParameterivCHROMIUM(GLuint image_id
,
137 GLint
* params
) OVERRIDE
;
138 virtual void UnmapImageCHROMIUM(GLuint image_id
) OVERRIDE
;
139 virtual void BindTexImage2DCHROMIUM(GLenum target
, GLint image_id
) OVERRIDE
;
140 virtual void ReleaseTexImage2DCHROMIUM(GLenum target
,
141 GLint image_id
) OVERRIDE
;
142 virtual void FramebufferRenderbuffer(GLenum target
,
144 GLenum renderbuffertarget
,
145 GLuint renderbuffer
) OVERRIDE
;
146 virtual void FramebufferTexture2D(GLenum target
,
150 GLint level
) OVERRIDE
;
151 virtual void RenderbufferStorage(GLenum target
,
152 GLenum internalformat
,
154 GLsizei height
) OVERRIDE
;
156 virtual void* MapBufferCHROMIUM(GLuint target
, GLenum access
) OVERRIDE
;
157 virtual GLboolean
UnmapBufferCHROMIUM(GLuint target
) OVERRIDE
;
158 virtual void BufferData(GLenum target
,
161 GLenum usage
) OVERRIDE
;
163 virtual void WaitSyncPointCHROMIUM(GLuint sync_point
) OVERRIDE
;
164 virtual GLuint
InsertSyncPointCHROMIUM() OVERRIDE
;
166 virtual void BeginQueryEXT(GLenum target
, GLuint id
) OVERRIDE
;
167 virtual void EndQueryEXT(GLenum target
) OVERRIDE
;
168 virtual void GetQueryObjectuivEXT(GLuint id
,
170 GLuint
* params
) OVERRIDE
;
172 virtual void DiscardFramebufferEXT(GLenum target
,
174 const GLenum
* attachments
) OVERRIDE
;
175 virtual void GenMailboxCHROMIUM(GLbyte
* mailbox
) OVERRIDE
;
176 virtual void ProduceTextureCHROMIUM(GLenum target
,
177 const GLbyte
* mailbox
) OVERRIDE
;
178 virtual void ProduceTextureDirectCHROMIUM(GLuint texture
,
180 const GLbyte
* mailbox
) OVERRIDE
;
181 virtual void ConsumeTextureCHROMIUM(GLenum target
,
182 const GLbyte
* mailbox
) OVERRIDE
;
183 virtual GLuint
CreateAndConsumeTextureCHROMIUM(
185 const GLbyte
* mailbox
) OVERRIDE
;
187 virtual void ResizeCHROMIUM(GLuint width
,
189 float device_scale
) OVERRIDE
;
190 virtual void LoseContextCHROMIUM(GLenum current
, GLenum other
) OVERRIDE
;
193 TestWebGraphicsContext3D
* test_context_
;
198 #endif // CC_TEST_TEST_GLES2_INTERFACE_H_