Fix IsRenderFrameLive and use it in RenderFrameHostManager.
[chromium-blink-merge.git] / cc / test / test_gles2_interface.h
blob68495f4a46f60351087e2e19dc09fd4d57a5d129
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"
10 namespace cc {
11 class TestWebGraphicsContext3D;
13 class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub {
14 public:
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,
38 GLenum pname,
39 GLint* params) OVERRIDE;
40 virtual void GetShaderPrecisionFormat(GLenum shadertype,
41 GLenum precisiontype,
42 GLint* range,
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)
48 OVERRIDE;
49 virtual void UseProgram(GLuint program) OVERRIDE;
50 virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
51 OVERRIDE;
52 virtual void DrawElements(GLenum mode,
53 GLsizei count,
54 GLenum type,
55 const void* indices) OVERRIDE;
56 virtual void ClearColor(GLclampf red,
57 GLclampf green,
58 GLclampf blue,
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,
73 GLint level,
74 GLint internalformat,
75 GLsizei width,
76 GLsizei height,
77 GLint border,
78 GLenum format,
79 GLenum type,
80 const void* pixels) OVERRIDE;
81 virtual void TexSubImage2D(GLenum target,
82 GLint level,
83 GLint xoffset,
84 GLint yoffset,
85 GLsizei width,
86 GLsizei height,
87 GLenum format,
88 GLenum type,
89 const void* pixels) OVERRIDE;
90 virtual void TexStorage2DEXT(GLenum target,
91 GLsizei levels,
92 GLenum internalformat,
93 GLsizei width,
94 GLsizei height) OVERRIDE;
95 virtual void TexImageIOSurface2DCHROMIUM(GLenum target,
96 GLsizei width,
97 GLsizei height,
98 GLuint io_surface_id,
99 GLuint plane) OVERRIDE;
100 virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE;
102 virtual void AsyncTexImage2DCHROMIUM(GLenum target,
103 GLint level,
104 GLenum internalformat,
105 GLsizei width,
106 GLsizei height,
107 GLint border,
108 GLenum format,
109 GLenum type,
110 const void* pixels) OVERRIDE;
111 virtual void AsyncTexSubImage2DCHROMIUM(GLenum target,
112 GLint level,
113 GLint xoffset,
114 GLint yoffset,
115 GLsizei width,
116 GLsizei height,
117 GLenum format,
118 GLenum type,
119 const void* pixels) OVERRIDE;
120 virtual void CompressedTexImage2D(GLenum target,
121 GLint level,
122 GLenum internalformat,
123 GLsizei width,
124 GLsizei height,
125 GLint border,
126 GLsizei image_size,
127 const void* data) OVERRIDE;
128 virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) OVERRIDE;
129 virtual GLuint CreateImageCHROMIUM(GLsizei width,
130 GLsizei height,
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,
136 GLenum pname,
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,
143 GLenum attachment,
144 GLenum renderbuffertarget,
145 GLuint renderbuffer) OVERRIDE;
146 virtual void FramebufferTexture2D(GLenum target,
147 GLenum attachment,
148 GLenum textarget,
149 GLuint texture,
150 GLint level) OVERRIDE;
151 virtual void RenderbufferStorage(GLenum target,
152 GLenum internalformat,
153 GLsizei width,
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,
159 GLsizeiptr size,
160 const void* data,
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,
169 GLenum pname,
170 GLuint* params) OVERRIDE;
172 virtual void DiscardFramebufferEXT(GLenum target,
173 GLsizei count,
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,
179 GLenum target,
180 const GLbyte* mailbox) OVERRIDE;
181 virtual void ConsumeTextureCHROMIUM(GLenum target,
182 const GLbyte* mailbox) OVERRIDE;
183 virtual GLuint CreateAndConsumeTextureCHROMIUM(
184 GLenum target,
185 const GLbyte* mailbox) OVERRIDE;
187 virtual void ResizeCHROMIUM(GLuint width,
188 GLuint height,
189 float device_scale) OVERRIDE;
190 virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
192 private:
193 TestWebGraphicsContext3D* test_context_;
196 } // namespace cc
198 #endif // CC_TEST_TEST_GLES2_INTERFACE_H_