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 GLenum 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
,
130 GLenum usage
) OVERRIDE
;
131 virtual void DestroyImageCHROMIUM(GLuint image_id
) OVERRIDE
;
132 virtual void* MapImageCHROMIUM(GLuint image_id
) OVERRIDE
;
133 virtual void GetImageParameterivCHROMIUM(GLuint image_id
,
135 GLint
* params
) OVERRIDE
;
136 virtual void UnmapImageCHROMIUM(GLuint image_id
) OVERRIDE
;
137 virtual void BindTexImage2DCHROMIUM(GLenum target
, GLint image_id
) OVERRIDE
;
138 virtual void ReleaseTexImage2DCHROMIUM(GLenum target
,
139 GLint image_id
) OVERRIDE
;
141 virtual void* MapBufferCHROMIUM(GLuint target
, GLenum access
) OVERRIDE
;
142 virtual GLboolean
UnmapBufferCHROMIUM(GLuint target
) OVERRIDE
;
143 virtual void BufferData(GLenum target
,
146 GLenum usage
) OVERRIDE
;
148 virtual void WaitSyncPointCHROMIUM(GLuint sync_point
) OVERRIDE
;
149 virtual GLuint
InsertSyncPointCHROMIUM() OVERRIDE
;
151 virtual void BeginQueryEXT(GLenum target
, GLuint id
) OVERRIDE
;
152 virtual void EndQueryEXT(GLenum target
) OVERRIDE
;
153 virtual void GetQueryObjectuivEXT(GLuint id
,
155 GLuint
* params
) OVERRIDE
;
157 virtual void DiscardFramebufferEXT(GLenum target
,
159 const GLenum
* attachments
) OVERRIDE
;
160 virtual void GenMailboxCHROMIUM(GLbyte
* mailbox
) OVERRIDE
;
161 virtual void ProduceTextureCHROMIUM(GLenum target
,
162 const GLbyte
* mailbox
) OVERRIDE
;
163 virtual void ConsumeTextureCHROMIUM(GLenum target
,
164 const GLbyte
* mailbox
) OVERRIDE
;
166 virtual void ResizeCHROMIUM(GLuint width
,
168 float device_scale
) OVERRIDE
;
169 virtual void LoseContextCHROMIUM(GLenum current
, GLenum other
) OVERRIDE
;
172 TestWebGraphicsContext3D
* test_context_
;
177 #endif // CC_TEST_TEST_GLES2_INTERFACE_H_