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 ~TestGLES2Interface() override
;
18 void GenTextures(GLsizei n
, GLuint
* textures
) override
;
19 void GenBuffers(GLsizei n
, GLuint
* buffers
) override
;
20 void GenFramebuffers(GLsizei n
, GLuint
* framebuffers
) override
;
21 void GenRenderbuffers(GLsizei n
, GLuint
* renderbuffers
) override
;
22 void GenQueriesEXT(GLsizei n
, GLuint
* queries
) override
;
24 void DeleteTextures(GLsizei n
, const GLuint
* textures
) override
;
25 void DeleteBuffers(GLsizei n
, const GLuint
* buffers
) override
;
26 void DeleteFramebuffers(GLsizei n
, const GLuint
* framebuffers
) override
;
27 void DeleteQueriesEXT(GLsizei n
, const GLuint
* queries
) override
;
29 GLuint
CreateShader(GLenum type
) override
;
30 GLuint
CreateProgram() override
;
32 void BindTexture(GLenum target
, GLuint texture
) override
;
34 void GetIntegerv(GLenum pname
, GLint
* params
) override
;
35 void GetShaderiv(GLuint shader
, GLenum pname
, GLint
* params
) override
;
36 void GetProgramiv(GLuint program
, GLenum pname
, GLint
* params
) override
;
37 void GetShaderPrecisionFormat(GLenum shadertype
,
40 GLint
* precision
) override
;
41 GLenum
CheckFramebufferStatus(GLenum target
) override
;
43 void ActiveTexture(GLenum target
) override
;
44 void Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
) override
;
45 void UseProgram(GLuint program
) override
;
46 void Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
) override
;
47 void DrawElements(GLenum mode
,
50 const void* indices
) override
;
51 void ClearColor(GLclampf red
,
54 GLclampf alpha
) override
;
55 void ClearStencil(GLint s
) override
;
56 void Clear(GLbitfield mask
) override
;
57 void Flush() override
;
58 void Finish() override
;
59 void ShallowFinishCHROMIUM() override
;
60 void ShallowFlushCHROMIUM() override
;
61 void Enable(GLenum cap
) override
;
62 void Disable(GLenum cap
) override
;
64 void BindBuffer(GLenum target
, GLuint buffer
) override
;
65 void BindRenderbuffer(GLenum target
, GLuint buffer
) override
;
66 void BindFramebuffer(GLenum target
, GLuint buffer
) override
;
68 void PixelStorei(GLenum pname
, GLint param
) override
;
70 void TexImage2D(GLenum target
,
78 const void* pixels
) override
;
79 void TexSubImage2D(GLenum target
,
87 const void* pixels
) override
;
88 void TexStorage2DEXT(GLenum target
,
90 GLenum internalformat
,
92 GLsizei height
) override
;
93 void TexImageIOSurface2DCHROMIUM(GLenum target
,
97 GLuint plane
) override
;
98 void TexParameteri(GLenum target
, GLenum pname
, GLint param
) override
;
100 void CompressedTexImage2D(GLenum target
,
102 GLenum internalformat
,
107 const void* data
) override
;
108 GLuint
CreateImageCHROMIUM(ClientBuffer buffer
,
111 GLenum internalformat
) override
;
112 void DestroyImageCHROMIUM(GLuint image_id
) override
;
113 GLuint
CreateGpuMemoryBufferImageCHROMIUM(GLsizei width
,
115 GLenum internalformat
,
116 GLenum usage
) override
;
117 void BindTexImage2DCHROMIUM(GLenum target
, GLint image_id
) override
;
118 void ReleaseTexImage2DCHROMIUM(GLenum target
, GLint image_id
) override
;
119 void FramebufferRenderbuffer(GLenum target
,
121 GLenum renderbuffertarget
,
122 GLuint renderbuffer
) override
;
123 void FramebufferTexture2D(GLenum target
,
127 GLint level
) override
;
128 void RenderbufferStorage(GLenum target
,
129 GLenum internalformat
,
131 GLsizei height
) override
;
133 void* MapBufferCHROMIUM(GLuint target
, GLenum access
) override
;
134 GLboolean
UnmapBufferCHROMIUM(GLuint target
) override
;
135 void BufferData(GLenum target
,
138 GLenum usage
) override
;
140 void WaitSyncPointCHROMIUM(GLuint sync_point
) override
;
141 GLuint
InsertSyncPointCHROMIUM() override
;
143 void BeginQueryEXT(GLenum target
, GLuint id
) override
;
144 void EndQueryEXT(GLenum target
) override
;
145 void GetQueryObjectuivEXT(GLuint id
, GLenum pname
, GLuint
* params
) override
;
147 void DiscardFramebufferEXT(GLenum target
,
149 const GLenum
* attachments
) override
;
150 void GenMailboxCHROMIUM(GLbyte
* mailbox
) override
;
151 void ProduceTextureCHROMIUM(GLenum target
, const GLbyte
* mailbox
) override
;
152 void ProduceTextureDirectCHROMIUM(GLuint texture
,
154 const GLbyte
* mailbox
) override
;
155 void ConsumeTextureCHROMIUM(GLenum target
, const GLbyte
* mailbox
) override
;
156 GLuint
CreateAndConsumeTextureCHROMIUM(GLenum target
,
157 const GLbyte
* mailbox
) override
;
159 void ResizeCHROMIUM(GLuint width
, GLuint height
, float device_scale
) override
;
160 void LoseContextCHROMIUM(GLenum current
, GLenum other
) override
;
161 GLenum
GetGraphicsResetStatusKHR() override
;
164 TestWebGraphicsContext3D
* test_context_
;
169 #endif // CC_TEST_TEST_GLES2_INTERFACE_H_