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. 4 5 #ifndef CC_TEST_TEST_GLES2_INTERFACE_H_ 6 #define CC_TEST_TEST_GLES2_INTERFACE_H_ 7 8 #include "gpu/command_buffer/client/gles2_interface_stub.h" 9 10 namespace cc { 11 class TestWebGraphicsContext3D; 12 13 class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub { 14 public: 15 explicit TestGLES2Interface(TestWebGraphicsContext3D* test_context); 16 virtual ~TestGLES2Interface(); 17 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; 22 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; 28 29 virtual GLuint CreateShader(GLenum type) OVERRIDE; 30 virtual GLuint CreateProgram() OVERRIDE; 31 32 virtual void BindTexture(GLenum target, GLuint texture) OVERRIDE; 33 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, 37 GLenum pname, 38 GLint* params) OVERRIDE; 39 virtual void GetShaderPrecisionFormat(GLenum shadertype, 40 GLenum precisiontype, 41 GLint* range, 42 GLint* precision) OVERRIDE; 43 virtual GLenum CheckFramebufferStatus(GLenum target) OVERRIDE; 44 45 virtual void ActiveTexture(GLenum target) OVERRIDE; 46 virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) 47 OVERRIDE; 48 virtual void UseProgram(GLuint program) OVERRIDE; 49 virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) 50 OVERRIDE; 51 virtual void DrawElements(GLenum mode, 52 GLsizei count, 53 GLenum type, 54 const void* indices) OVERRIDE; 55 virtual void ClearColor(GLclampf red, 56 GLclampf green, 57 GLclampf blue, 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; 66 67 virtual void BindBuffer(GLenum target, GLuint buffer) OVERRIDE; 68 virtual void BindFramebuffer(GLenum target, GLuint buffer) OVERRIDE; 69 70 virtual void TexImage2D(GLenum target, 71 GLint level, 72 GLint internalformat, 73 GLsizei width, 74 GLsizei height, 75 GLint border, 76 GLenum format, 77 GLenum type, 78 const void* pixels) OVERRIDE; 79 virtual void TexSubImage2D(GLenum target, 80 GLint level, 81 GLint xoffset, 82 GLint yoffset, 83 GLsizei width, 84 GLsizei height, 85 GLenum format, 86 GLenum type, 87 const void* pixels) OVERRIDE; 88 virtual void TexStorage2DEXT(GLenum target, 89 GLsizei levels, 90 GLenum internalformat, 91 GLsizei width, 92 GLsizei height) OVERRIDE; 93 virtual void TexImageIOSurface2DCHROMIUM(GLenum target, 94 GLsizei width, 95 GLsizei height, 96 GLuint io_surface_id, 97 GLuint plane) OVERRIDE; 98 virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE; 99 100 virtual void AsyncTexImage2DCHROMIUM(GLenum target, 101 GLint level, 102 GLint internalformat, 103 GLsizei width, 104 GLsizei height, 105 GLint border, 106 GLenum format, 107 GLenum type, 108 const void* pixels) OVERRIDE; 109 virtual void AsyncTexSubImage2DCHROMIUM(GLenum target, 110 GLint level, 111 GLint xoffset, 112 GLint yoffset, 113 GLsizei width, 114 GLsizei height, 115 GLenum format, 116 GLenum type, 117 const void* pixels) OVERRIDE; 118 virtual void CompressedTexImage2D(GLenum target, 119 GLint level, 120 GLenum internalformat, 121 GLsizei width, 122 GLsizei height, 123 GLint border, 124 GLsizei image_size, 125 const void* data) OVERRIDE; 126 virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) OVERRIDE; 127 virtual GLuint CreateImageCHROMIUM(GLsizei width, 128 GLsizei height, 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, 133 GLenum pname, 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; 139 140 virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) OVERRIDE; 141 virtual GLboolean UnmapBufferCHROMIUM(GLuint target) OVERRIDE; 142 virtual void BufferData(GLenum target, 143 GLsizeiptr size, 144 const void* data, 145 GLenum usage) OVERRIDE; 146 147 virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE; 148 virtual GLuint InsertSyncPointCHROMIUM() OVERRIDE; 149 150 virtual void BeginQueryEXT(GLenum target, GLuint id) OVERRIDE; 151 virtual void EndQueryEXT(GLenum target) OVERRIDE; 152 virtual void GetQueryObjectuivEXT(GLuint id, 153 GLenum pname, 154 GLuint* params) OVERRIDE; 155 156 virtual void DiscardFramebufferEXT(GLenum target, 157 GLsizei count, 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; 164 165 private: 166 TestWebGraphicsContext3D* test_context_; 167 }; 168 169 } // namespace cc 170 171 #endif // CC_TEST_TEST_GLES2_INTERFACE_H_ 172