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 GenQueriesEXT(GLsizei n
, GLuint
* queries
) OVERRIDE
;
23 virtual void DeleteTextures(GLsizei n
, const GLuint
* textures
) OVERRIDE
;
24 virtual void DeleteBuffers(GLsizei n
, const GLuint
* buffers
) OVERRIDE
;
25 virtual void DeleteFramebuffers(GLsizei n
,
26 const GLuint
* framebuffers
) OVERRIDE
;
27 virtual void DeleteQueriesEXT(GLsizei n
, const GLuint
* queries
) OVERRIDE
;
29 virtual GLuint
CreateShader(GLenum type
) OVERRIDE
;
30 virtual GLuint
CreateProgram() OVERRIDE
;
32 virtual void BindTexture(GLenum target
, GLuint texture
) OVERRIDE
;
34 virtual void GetIntegerv(GLenum pname
, GLint
* params
) OVERRIDE
;
35 virtual void GetShaderiv(GLuint shader
, GLenum pname
, GLint
* params
) OVERRIDE
;
36 virtual void GetProgramiv(GLuint program
,
38 GLint
* params
) OVERRIDE
;
39 virtual void GetShaderPrecisionFormat(GLenum shadertype
,
42 GLint
* precision
) OVERRIDE
;
43 virtual GLenum
CheckFramebufferStatus(GLenum target
) OVERRIDE
;
45 virtual void ActiveTexture(GLenum target
) OVERRIDE
;
46 virtual void Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
48 virtual void UseProgram(GLuint program
) OVERRIDE
;
49 virtual void Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
51 virtual void DrawElements(GLenum mode
,
54 const void* indices
) OVERRIDE
;
55 virtual void ClearColor(GLclampf red
,
58 GLclampf alpha
) OVERRIDE
;
59 virtual void ClearStencil(GLint s
) OVERRIDE
;
60 virtual void Clear(GLbitfield mask
) OVERRIDE
;
61 virtual void Flush() OVERRIDE
;
62 virtual void Finish() OVERRIDE
;
63 virtual void ShallowFlushCHROMIUM() OVERRIDE
;
64 virtual void Enable(GLenum cap
) OVERRIDE
;
65 virtual void Disable(GLenum cap
) OVERRIDE
;
67 virtual void BindBuffer(GLenum target
, GLuint buffer
) OVERRIDE
;
68 virtual void BindFramebuffer(GLenum target
, GLuint buffer
) OVERRIDE
;
70 virtual void TexImage2D(GLenum target
,
78 const void* pixels
) OVERRIDE
;
79 virtual void TexSubImage2D(GLenum target
,
87 const void* pixels
) OVERRIDE
;
88 virtual void TexStorage2DEXT(GLenum target
,
90 GLenum internalformat
,
92 GLsizei height
) OVERRIDE
;
93 virtual void TexImageIOSurface2DCHROMIUM(GLenum target
,
97 GLuint plane
) OVERRIDE
;
98 virtual void TexParameteri(GLenum target
, GLenum pname
, GLint param
) OVERRIDE
;
100 virtual void AsyncTexImage2DCHROMIUM(GLenum target
,
102 GLint internalformat
,
108 const void* pixels
) OVERRIDE
;
109 virtual void AsyncTexSubImage2DCHROMIUM(GLenum target
,
117 const void* pixels
) OVERRIDE
;
118 virtual void CompressedTexImage2D(GLenum target
,
120 GLenum internalformat
,
125 const void* data
) OVERRIDE
;
126 virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target
) OVERRIDE
;
127 virtual GLuint
CreateImageCHROMIUM(GLsizei width
,
129 GLenum internalformat
) OVERRIDE
;
130 virtual void DestroyImageCHROMIUM(GLuint image_id
) OVERRIDE
;
131 virtual void* MapImageCHROMIUM(GLuint image_id
, GLenum access
) OVERRIDE
;
132 virtual void GetImageParameterivCHROMIUM(GLuint image_id
,
134 GLint
* params
) OVERRIDE
;
135 virtual void UnmapImageCHROMIUM(GLuint image_id
) OVERRIDE
;
136 virtual void BindTexImage2DCHROMIUM(GLenum target
, GLint image_id
) OVERRIDE
;
137 virtual void ReleaseTexImage2DCHROMIUM(GLenum target
,
138 GLint image_id
) OVERRIDE
;
140 virtual void* MapBufferCHROMIUM(GLuint target
, GLenum access
) OVERRIDE
;
141 virtual GLboolean
UnmapBufferCHROMIUM(GLuint target
) OVERRIDE
;
142 virtual void BufferData(GLenum target
,
145 GLenum usage
) OVERRIDE
;
147 virtual void WaitSyncPointCHROMIUM(GLuint sync_point
) OVERRIDE
;
148 virtual GLuint
InsertSyncPointCHROMIUM() OVERRIDE
;
150 virtual void BeginQueryEXT(GLenum target
, GLuint id
) OVERRIDE
;
151 virtual void EndQueryEXT(GLenum target
) OVERRIDE
;
152 virtual void GetQueryObjectuivEXT(GLuint id
,
154 GLuint
* params
) OVERRIDE
;
156 virtual void DiscardFramebufferEXT(GLenum target
,
158 const GLenum
* attachments
) OVERRIDE
;
159 virtual void GenMailboxCHROMIUM(GLbyte
* mailbox
) OVERRIDE
;
160 virtual void ProduceTextureCHROMIUM(GLenum target
,
161 const GLbyte
* mailbox
) OVERRIDE
;
162 virtual void ConsumeTextureCHROMIUM(GLenum target
,
163 const GLbyte
* mailbox
) OVERRIDE
;
165 virtual void ResizeCHROMIUM(GLuint width
,
167 float device_scale
) OVERRIDE
;
168 virtual void LoseContextCHROMIUM(GLenum current
, GLenum other
) OVERRIDE
;
171 TestWebGraphicsContext3D
* test_context_
;
176 #endif // CC_TEST_TEST_GLES2_INTERFACE_H_