Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: webkit/plugins/ppapi/ppb_opengles_impl.cc

Issue 7206016: Convert most remaining resources to use the API/thunk system. The significant (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is auto-generated. DO NOT EDIT! 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // DO NOT EDIT!
6 8
7 #include "webkit/plugins/ppapi/ppb_opengles_impl.h" 9 #include "webkit/plugins/ppapi/ppb_opengles_impl.h"
8 10
9 #include "gpu/command_buffer/client/gles2_implementation.h" 11 #include "gpu/command_buffer/client/gles2_implementation.h"
10 #include "ppapi/c/dev/ppb_opengles_dev.h" 12 #include "ppapi/c/dev/ppb_opengles_dev.h"
13 #include "ppapi/shared_impl/resource_object_base.h"
14 #include "ppapi/shared_impl/tracker_base.h"
11 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" 15 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h"
12 16
17 using ppapi::ResourceObjectBase;
18 using ppapi::TrackerBase;
19
13 namespace webkit { 20 namespace webkit {
14 namespace ppapi { 21 namespace ppapi {
15 22
16 namespace { 23 namespace {
17 24
25 gpu::gles2::GLES2Implementation* GetGLES(PP_Resource context) {
26 ResourceObjectBase* base = TrackerBase::Get()->GetResourceAPI(context);
27 DCHECK(base->AsPPB_Context3D_API());
28 return static_cast<PPB_Context3D_Impl*>(base)->gles2_impl();
29 }
30
18 void ActiveTexture(PP_Resource context_id, GLenum texture) { 31 void ActiveTexture(PP_Resource context_id, GLenum texture) {
19 scoped_refptr<PPB_Context3D_Impl> context = 32 GetGLES(context_id)->ActiveTexture(texture);
20 Resource::GetAs<PPB_Context3D_Impl>(context_id);
21 context->gles2_impl()->ActiveTexture(texture);
22 } 33 }
23 34
24 void AttachShader(PP_Resource context_id, GLuint program, GLuint shader) { 35 void AttachShader(PP_Resource context_id, GLuint program, GLuint shader) {
25 scoped_refptr<PPB_Context3D_Impl> context = 36 GetGLES(context_id)->AttachShader(program, shader);
26 Resource::GetAs<PPB_Context3D_Impl>(context_id);
27 context->gles2_impl()->AttachShader(program, shader);
28 } 37 }
29 38
30 void BindAttribLocation( 39 void BindAttribLocation(
31 PP_Resource context_id, GLuint program, GLuint index, const char* name) { 40 PP_Resource context_id, GLuint program, GLuint index, const char* name) {
32 scoped_refptr<PPB_Context3D_Impl> context = 41 GetGLES(context_id)->BindAttribLocation(program, index, name);
33 Resource::GetAs<PPB_Context3D_Impl>(context_id);
34 context->gles2_impl()->BindAttribLocation(program, index, name);
35 } 42 }
36 43
37 void BindBuffer(PP_Resource context_id, GLenum target, GLuint buffer) { 44 void BindBuffer(PP_Resource context_id, GLenum target, GLuint buffer) {
38 scoped_refptr<PPB_Context3D_Impl> context = 45 GetGLES(context_id)->BindBuffer(target, buffer);
39 Resource::GetAs<PPB_Context3D_Impl>(context_id);
40 context->gles2_impl()->BindBuffer(target, buffer);
41 } 46 }
42 47
43 void BindFramebuffer( 48 void BindFramebuffer(
44 PP_Resource context_id, GLenum target, GLuint framebuffer) { 49 PP_Resource context_id, GLenum target, GLuint framebuffer) {
45 scoped_refptr<PPB_Context3D_Impl> context = 50 GetGLES(context_id)->BindFramebuffer(target, framebuffer);
46 Resource::GetAs<PPB_Context3D_Impl>(context_id);
47 context->gles2_impl()->BindFramebuffer(target, framebuffer);
48 } 51 }
49 52
50 void BindRenderbuffer( 53 void BindRenderbuffer(
51 PP_Resource context_id, GLenum target, GLuint renderbuffer) { 54 PP_Resource context_id, GLenum target, GLuint renderbuffer) {
52 scoped_refptr<PPB_Context3D_Impl> context = 55 GetGLES(context_id)->BindRenderbuffer(target, renderbuffer);
53 Resource::GetAs<PPB_Context3D_Impl>(context_id);
54 context->gles2_impl()->BindRenderbuffer(target, renderbuffer);
55 } 56 }
56 57
57 void BindTexture(PP_Resource context_id, GLenum target, GLuint texture) { 58 void BindTexture(PP_Resource context_id, GLenum target, GLuint texture) {
58 scoped_refptr<PPB_Context3D_Impl> context = 59 GetGLES(context_id)->BindTexture(target, texture);
59 Resource::GetAs<PPB_Context3D_Impl>(context_id);
60 context->gles2_impl()->BindTexture(target, texture);
61 } 60 }
62 61
63 void BlendColor( 62 void BlendColor(
64 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, 63 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue,
65 GLclampf alpha) { 64 GLclampf alpha) {
66 scoped_refptr<PPB_Context3D_Impl> context = 65 GetGLES(context_id)->BlendColor(red, green, blue, alpha);
67 Resource::GetAs<PPB_Context3D_Impl>(context_id);
68 context->gles2_impl()->BlendColor(red, green, blue, alpha);
69 } 66 }
70 67
71 void BlendEquation(PP_Resource context_id, GLenum mode) { 68 void BlendEquation(PP_Resource context_id, GLenum mode) {
72 scoped_refptr<PPB_Context3D_Impl> context = 69 GetGLES(context_id)->BlendEquation(mode);
73 Resource::GetAs<PPB_Context3D_Impl>(context_id);
74 context->gles2_impl()->BlendEquation(mode);
75 } 70 }
76 71
77 void BlendEquationSeparate( 72 void BlendEquationSeparate(
78 PP_Resource context_id, GLenum modeRGB, GLenum modeAlpha) { 73 PP_Resource context_id, GLenum modeRGB, GLenum modeAlpha) {
79 scoped_refptr<PPB_Context3D_Impl> context = 74 GetGLES(context_id)->BlendEquationSeparate(modeRGB, modeAlpha);
80 Resource::GetAs<PPB_Context3D_Impl>(context_id);
81 context->gles2_impl()->BlendEquationSeparate(modeRGB, modeAlpha);
82 } 75 }
83 76
84 void BlendFunc(PP_Resource context_id, GLenum sfactor, GLenum dfactor) { 77 void BlendFunc(PP_Resource context_id, GLenum sfactor, GLenum dfactor) {
85 scoped_refptr<PPB_Context3D_Impl> context = 78 GetGLES(context_id)->BlendFunc(sfactor, dfactor);
86 Resource::GetAs<PPB_Context3D_Impl>(context_id);
87 context->gles2_impl()->BlendFunc(sfactor, dfactor);
88 } 79 }
89 80
90 void BlendFuncSeparate( 81 void BlendFuncSeparate(
91 PP_Resource context_id, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, 82 PP_Resource context_id, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha,
92 GLenum dstAlpha) { 83 GLenum dstAlpha) {
93 scoped_refptr<PPB_Context3D_Impl> context = 84 GetGLES(context_id)->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
94 Resource::GetAs<PPB_Context3D_Impl>(context_id);
95 context->gles2_impl()->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
96 } 85 }
97 86
98 void BufferData( 87 void BufferData(
99 PP_Resource context_id, GLenum target, GLsizeiptr size, const void* data, 88 PP_Resource context_id, GLenum target, GLsizeiptr size, const void* data,
100 GLenum usage) { 89 GLenum usage) {
101 scoped_refptr<PPB_Context3D_Impl> context = 90 GetGLES(context_id)->BufferData(target, size, data, usage);
102 Resource::GetAs<PPB_Context3D_Impl>(context_id);
103 context->gles2_impl()->BufferData(target, size, data, usage);
104 } 91 }
105 92
106 void BufferSubData( 93 void BufferSubData(
107 PP_Resource context_id, GLenum target, GLintptr offset, GLsizeiptr size, 94 PP_Resource context_id, GLenum target, GLintptr offset, GLsizeiptr size,
108 const void* data) { 95 const void* data) {
109 scoped_refptr<PPB_Context3D_Impl> context = 96 GetGLES(context_id)->BufferSubData(target, offset, size, data);
110 Resource::GetAs<PPB_Context3D_Impl>(context_id);
111 context->gles2_impl()->BufferSubData(target, offset, size, data);
112 } 97 }
113 98
114 GLenum CheckFramebufferStatus(PP_Resource context_id, GLenum target) { 99 GLenum CheckFramebufferStatus(PP_Resource context_id, GLenum target) {
115 scoped_refptr<PPB_Context3D_Impl> context = 100 return GetGLES(context_id)->CheckFramebufferStatus(target);
116 Resource::GetAs<PPB_Context3D_Impl>(context_id);
117 return context->gles2_impl()->CheckFramebufferStatus(target);
118 } 101 }
119 102
120 void Clear(PP_Resource context_id, GLbitfield mask) { 103 void Clear(PP_Resource context_id, GLbitfield mask) {
121 scoped_refptr<PPB_Context3D_Impl> context = 104 GetGLES(context_id)->Clear(mask);
122 Resource::GetAs<PPB_Context3D_Impl>(context_id);
123 context->gles2_impl()->Clear(mask);
124 } 105 }
125 106
126 void ClearColor( 107 void ClearColor(
127 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, 108 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue,
128 GLclampf alpha) { 109 GLclampf alpha) {
129 scoped_refptr<PPB_Context3D_Impl> context = 110 GetGLES(context_id)->ClearColor(red, green, blue, alpha);
130 Resource::GetAs<PPB_Context3D_Impl>(context_id);
131 context->gles2_impl()->ClearColor(red, green, blue, alpha);
132 } 111 }
133 112
134 void ClearDepthf(PP_Resource context_id, GLclampf depth) { 113 void ClearDepthf(PP_Resource context_id, GLclampf depth) {
135 scoped_refptr<PPB_Context3D_Impl> context = 114 GetGLES(context_id)->ClearDepthf(depth);
136 Resource::GetAs<PPB_Context3D_Impl>(context_id);
137 context->gles2_impl()->ClearDepthf(depth);
138 } 115 }
139 116
140 void ClearStencil(PP_Resource context_id, GLint s) { 117 void ClearStencil(PP_Resource context_id, GLint s) {
141 scoped_refptr<PPB_Context3D_Impl> context = 118 GetGLES(context_id)->ClearStencil(s);
142 Resource::GetAs<PPB_Context3D_Impl>(context_id);
143 context->gles2_impl()->ClearStencil(s);
144 } 119 }
145 120
146 void ColorMask( 121 void ColorMask(
147 PP_Resource context_id, GLboolean red, GLboolean green, GLboolean blue, 122 PP_Resource context_id, GLboolean red, GLboolean green, GLboolean blue,
148 GLboolean alpha) { 123 GLboolean alpha) {
149 scoped_refptr<PPB_Context3D_Impl> context = 124 GetGLES(context_id)->ColorMask(red, green, blue, alpha);
150 Resource::GetAs<PPB_Context3D_Impl>(context_id);
151 context->gles2_impl()->ColorMask(red, green, blue, alpha);
152 } 125 }
153 126
154 void CompileShader(PP_Resource context_id, GLuint shader) { 127 void CompileShader(PP_Resource context_id, GLuint shader) {
155 scoped_refptr<PPB_Context3D_Impl> context = 128 GetGLES(context_id)->CompileShader(shader);
156 Resource::GetAs<PPB_Context3D_Impl>(context_id);
157 context->gles2_impl()->CompileShader(shader);
158 } 129 }
159 130
160 void CompressedTexImage2D( 131 void CompressedTexImage2D(
161 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, 132 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat,
162 GLsizei width, GLsizei height, GLint border, GLsizei imageSize, 133 GLsizei width, GLsizei height, GLint border, GLsizei imageSize,
163 const void* data) { 134 const void* data) {
164 scoped_refptr<PPB_Context3D_Impl> context = 135 GetGLES(
165 Resource::GetAs<PPB_Context3D_Impl>(context_id); 136 context_id)->CompressedTexImage2D(
166 context->gles2_impl()->CompressedTexImage2D( 137 target, level, internalformat, width, height, border, imageSize,
167 target, level, internalformat, width, height, border, imageSize, data); 138 data);
168 } 139 }
169 140
170 void CompressedTexSubImage2D( 141 void CompressedTexSubImage2D(
171 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, 142 PP_Resource context_id, GLenum target, GLint level, GLint xoffset,
172 GLint yoffset, GLsizei width, GLsizei height, GLenum format, 143 GLint yoffset, GLsizei width, GLsizei height, GLenum format,
173 GLsizei imageSize, const void* data) { 144 GLsizei imageSize, const void* data) {
174 scoped_refptr<PPB_Context3D_Impl> context = 145 GetGLES(
175 Resource::GetAs<PPB_Context3D_Impl>(context_id); 146 context_id)->CompressedTexSubImage2D(
176 context->gles2_impl()->CompressedTexSubImage2D( 147 target, level, xoffset, yoffset, width, height, format, imageSize,
177 target, level, xoffset, yoffset, width, height, format, imageSize, data); 148 data);
178 } 149 }
179 150
180 void CopyTexImage2D( 151 void CopyTexImage2D(
181 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, 152 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat,
182 GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { 153 GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
183 scoped_refptr<PPB_Context3D_Impl> context = 154 GetGLES(
184 Resource::GetAs<PPB_Context3D_Impl>(context_id); 155 context_id)->CopyTexImage2D(
185 context->gles2_impl()->CopyTexImage2D( 156 target, level, internalformat, x, y, width, height, border);
186 target, level, internalformat, x, y, width, height, border);
187 } 157 }
188 158
189 void CopyTexSubImage2D( 159 void CopyTexSubImage2D(
190 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, 160 PP_Resource context_id, GLenum target, GLint level, GLint xoffset,
191 GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { 161 GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
192 scoped_refptr<PPB_Context3D_Impl> context = 162 GetGLES(
193 Resource::GetAs<PPB_Context3D_Impl>(context_id); 163 context_id)->CopyTexSubImage2D(
194 context->gles2_impl()->CopyTexSubImage2D( 164 target, level, xoffset, yoffset, x, y, width, height);
195 target, level, xoffset, yoffset, x, y, width, height);
196 } 165 }
197 166
198 GLuint CreateProgram(PP_Resource context_id) { 167 GLuint CreateProgram(PP_Resource context_id) {
199 scoped_refptr<PPB_Context3D_Impl> context = 168 return GetGLES(context_id)->CreateProgram();
200 Resource::GetAs<PPB_Context3D_Impl>(context_id);
201 return context->gles2_impl()->CreateProgram();
202 } 169 }
203 170
204 GLuint CreateShader(PP_Resource context_id, GLenum type) { 171 GLuint CreateShader(PP_Resource context_id, GLenum type) {
205 scoped_refptr<PPB_Context3D_Impl> context = 172 return GetGLES(context_id)->CreateShader(type);
206 Resource::GetAs<PPB_Context3D_Impl>(context_id);
207 return context->gles2_impl()->CreateShader(type);
208 } 173 }
209 174
210 void CullFace(PP_Resource context_id, GLenum mode) { 175 void CullFace(PP_Resource context_id, GLenum mode) {
211 scoped_refptr<PPB_Context3D_Impl> context = 176 GetGLES(context_id)->CullFace(mode);
212 Resource::GetAs<PPB_Context3D_Impl>(context_id);
213 context->gles2_impl()->CullFace(mode);
214 } 177 }
215 178
216 void DeleteBuffers(PP_Resource context_id, GLsizei n, const GLuint* buffers) { 179 void DeleteBuffers(PP_Resource context_id, GLsizei n, const GLuint* buffers) {
217 scoped_refptr<PPB_Context3D_Impl> context = 180 GetGLES(context_id)->DeleteBuffers(n, buffers);
218 Resource::GetAs<PPB_Context3D_Impl>(context_id);
219 context->gles2_impl()->DeleteBuffers(n, buffers);
220 } 181 }
221 182
222 void DeleteFramebuffers( 183 void DeleteFramebuffers(
223 PP_Resource context_id, GLsizei n, const GLuint* framebuffers) { 184 PP_Resource context_id, GLsizei n, const GLuint* framebuffers) {
224 scoped_refptr<PPB_Context3D_Impl> context = 185 GetGLES(context_id)->DeleteFramebuffers(n, framebuffers);
225 Resource::GetAs<PPB_Context3D_Impl>(context_id);
226 context->gles2_impl()->DeleteFramebuffers(n, framebuffers);
227 } 186 }
228 187
229 void DeleteProgram(PP_Resource context_id, GLuint program) { 188 void DeleteProgram(PP_Resource context_id, GLuint program) {
230 scoped_refptr<PPB_Context3D_Impl> context = 189 GetGLES(context_id)->DeleteProgram(program);
231 Resource::GetAs<PPB_Context3D_Impl>(context_id);
232 context->gles2_impl()->DeleteProgram(program);
233 } 190 }
234 191
235 void DeleteRenderbuffers( 192 void DeleteRenderbuffers(
236 PP_Resource context_id, GLsizei n, const GLuint* renderbuffers) { 193 PP_Resource context_id, GLsizei n, const GLuint* renderbuffers) {
237 scoped_refptr<PPB_Context3D_Impl> context = 194 GetGLES(context_id)->DeleteRenderbuffers(n, renderbuffers);
238 Resource::GetAs<PPB_Context3D_Impl>(context_id);
239 context->gles2_impl()->DeleteRenderbuffers(n, renderbuffers);
240 } 195 }
241 196
242 void DeleteShader(PP_Resource context_id, GLuint shader) { 197 void DeleteShader(PP_Resource context_id, GLuint shader) {
243 scoped_refptr<PPB_Context3D_Impl> context = 198 GetGLES(context_id)->DeleteShader(shader);
244 Resource::GetAs<PPB_Context3D_Impl>(context_id);
245 context->gles2_impl()->DeleteShader(shader);
246 } 199 }
247 200
248 void DeleteTextures( 201 void DeleteTextures(
249 PP_Resource context_id, GLsizei n, const GLuint* textures) { 202 PP_Resource context_id, GLsizei n, const GLuint* textures) {
250 scoped_refptr<PPB_Context3D_Impl> context = 203 GetGLES(context_id)->DeleteTextures(n, textures);
251 Resource::GetAs<PPB_Context3D_Impl>(context_id);
252 context->gles2_impl()->DeleteTextures(n, textures);
253 } 204 }
254 205
255 void DepthFunc(PP_Resource context_id, GLenum func) { 206 void DepthFunc(PP_Resource context_id, GLenum func) {
256 scoped_refptr<PPB_Context3D_Impl> context = 207 GetGLES(context_id)->DepthFunc(func);
257 Resource::GetAs<PPB_Context3D_Impl>(context_id);
258 context->gles2_impl()->DepthFunc(func);
259 } 208 }
260 209
261 void DepthMask(PP_Resource context_id, GLboolean flag) { 210 void DepthMask(PP_Resource context_id, GLboolean flag) {
262 scoped_refptr<PPB_Context3D_Impl> context = 211 GetGLES(context_id)->DepthMask(flag);
263 Resource::GetAs<PPB_Context3D_Impl>(context_id);
264 context->gles2_impl()->DepthMask(flag);
265 } 212 }
266 213
267 void DepthRangef(PP_Resource context_id, GLclampf zNear, GLclampf zFar) { 214 void DepthRangef(PP_Resource context_id, GLclampf zNear, GLclampf zFar) {
268 scoped_refptr<PPB_Context3D_Impl> context = 215 GetGLES(context_id)->DepthRangef(zNear, zFar);
269 Resource::GetAs<PPB_Context3D_Impl>(context_id);
270 context->gles2_impl()->DepthRangef(zNear, zFar);
271 } 216 }
272 217
273 void DetachShader(PP_Resource context_id, GLuint program, GLuint shader) { 218 void DetachShader(PP_Resource context_id, GLuint program, GLuint shader) {
274 scoped_refptr<PPB_Context3D_Impl> context = 219 GetGLES(context_id)->DetachShader(program, shader);
275 Resource::GetAs<PPB_Context3D_Impl>(context_id);
276 context->gles2_impl()->DetachShader(program, shader);
277 } 220 }
278 221
279 void Disable(PP_Resource context_id, GLenum cap) { 222 void Disable(PP_Resource context_id, GLenum cap) {
280 scoped_refptr<PPB_Context3D_Impl> context = 223 GetGLES(context_id)->Disable(cap);
281 Resource::GetAs<PPB_Context3D_Impl>(context_id);
282 context->gles2_impl()->Disable(cap);
283 } 224 }
284 225
285 void DisableVertexAttribArray(PP_Resource context_id, GLuint index) { 226 void DisableVertexAttribArray(PP_Resource context_id, GLuint index) {
286 scoped_refptr<PPB_Context3D_Impl> context = 227 GetGLES(context_id)->DisableVertexAttribArray(index);
287 Resource::GetAs<PPB_Context3D_Impl>(context_id);
288 context->gles2_impl()->DisableVertexAttribArray(index);
289 } 228 }
290 229
291 void DrawArrays( 230 void DrawArrays(
292 PP_Resource context_id, GLenum mode, GLint first, GLsizei count) { 231 PP_Resource context_id, GLenum mode, GLint first, GLsizei count) {
293 scoped_refptr<PPB_Context3D_Impl> context = 232 GetGLES(context_id)->DrawArrays(mode, first, count);
294 Resource::GetAs<PPB_Context3D_Impl>(context_id);
295 context->gles2_impl()->DrawArrays(mode, first, count);
296 } 233 }
297 234
298 void DrawElements( 235 void DrawElements(
299 PP_Resource context_id, GLenum mode, GLsizei count, GLenum type, 236 PP_Resource context_id, GLenum mode, GLsizei count, GLenum type,
300 const void* indices) { 237 const void* indices) {
301 scoped_refptr<PPB_Context3D_Impl> context = 238 GetGLES(context_id)->DrawElements(mode, count, type, indices);
302 Resource::GetAs<PPB_Context3D_Impl>(context_id);
303 context->gles2_impl()->DrawElements(mode, count, type, indices);
304 } 239 }
305 240
306 void Enable(PP_Resource context_id, GLenum cap) { 241 void Enable(PP_Resource context_id, GLenum cap) {
307 scoped_refptr<PPB_Context3D_Impl> context = 242 GetGLES(context_id)->Enable(cap);
308 Resource::GetAs<PPB_Context3D_Impl>(context_id);
309 context->gles2_impl()->Enable(cap);
310 } 243 }
311 244
312 void EnableVertexAttribArray(PP_Resource context_id, GLuint index) { 245 void EnableVertexAttribArray(PP_Resource context_id, GLuint index) {
313 scoped_refptr<PPB_Context3D_Impl> context = 246 GetGLES(context_id)->EnableVertexAttribArray(index);
314 Resource::GetAs<PPB_Context3D_Impl>(context_id);
315 context->gles2_impl()->EnableVertexAttribArray(index);
316 } 247 }
317 248
318 void Finish(PP_Resource context_id) { 249 void Finish(PP_Resource context_id) {
319 scoped_refptr<PPB_Context3D_Impl> context = 250 GetGLES(context_id)->Finish();
320 Resource::GetAs<PPB_Context3D_Impl>(context_id);
321 context->gles2_impl()->Finish();
322 } 251 }
323 252
324 void Flush(PP_Resource context_id) { 253 void Flush(PP_Resource context_id) {
325 scoped_refptr<PPB_Context3D_Impl> context = 254 GetGLES(context_id)->Flush();
326 Resource::GetAs<PPB_Context3D_Impl>(context_id);
327 context->gles2_impl()->Flush();
328 } 255 }
329 256
330 void FramebufferRenderbuffer( 257 void FramebufferRenderbuffer(
331 PP_Resource context_id, GLenum target, GLenum attachment, 258 PP_Resource context_id, GLenum target, GLenum attachment,
332 GLenum renderbuffertarget, GLuint renderbuffer) { 259 GLenum renderbuffertarget, GLuint renderbuffer) {
333 scoped_refptr<PPB_Context3D_Impl> context = 260 GetGLES(
334 Resource::GetAs<PPB_Context3D_Impl>(context_id); 261 context_id)->FramebufferRenderbuffer(
335 context->gles2_impl()->FramebufferRenderbuffer( 262 target, attachment, renderbuffertarget, renderbuffer);
336 target, attachment, renderbuffertarget, renderbuffer);
337 } 263 }
338 264
339 void FramebufferTexture2D( 265 void FramebufferTexture2D(
340 PP_Resource context_id, GLenum target, GLenum attachment, GLenum textarget, 266 PP_Resource context_id, GLenum target, GLenum attachment, GLenum textarget,
341 GLuint texture, GLint level) { 267 GLuint texture, GLint level) {
342 scoped_refptr<PPB_Context3D_Impl> context = 268 GetGLES(
343 Resource::GetAs<PPB_Context3D_Impl>(context_id); 269 context_id)->FramebufferTexture2D(
344 context->gles2_impl()->FramebufferTexture2D( 270 target, attachment, textarget, texture, level);
345 target, attachment, textarget, texture, level);
346 } 271 }
347 272
348 void FrontFace(PP_Resource context_id, GLenum mode) { 273 void FrontFace(PP_Resource context_id, GLenum mode) {
349 scoped_refptr<PPB_Context3D_Impl> context = 274 GetGLES(context_id)->FrontFace(mode);
350 Resource::GetAs<PPB_Context3D_Impl>(context_id);
351 context->gles2_impl()->FrontFace(mode);
352 } 275 }
353 276
354 void GenBuffers(PP_Resource context_id, GLsizei n, GLuint* buffers) { 277 void GenBuffers(PP_Resource context_id, GLsizei n, GLuint* buffers) {
355 scoped_refptr<PPB_Context3D_Impl> context = 278 GetGLES(context_id)->GenBuffers(n, buffers);
356 Resource::GetAs<PPB_Context3D_Impl>(context_id);
357 context->gles2_impl()->GenBuffers(n, buffers);
358 } 279 }
359 280
360 void GenerateMipmap(PP_Resource context_id, GLenum target) { 281 void GenerateMipmap(PP_Resource context_id, GLenum target) {
361 scoped_refptr<PPB_Context3D_Impl> context = 282 GetGLES(context_id)->GenerateMipmap(target);
362 Resource::GetAs<PPB_Context3D_Impl>(context_id);
363 context->gles2_impl()->GenerateMipmap(target);
364 } 283 }
365 284
366 void GenFramebuffers(PP_Resource context_id, GLsizei n, GLuint* framebuffers) { 285 void GenFramebuffers(PP_Resource context_id, GLsizei n, GLuint* framebuffers) {
367 scoped_refptr<PPB_Context3D_Impl> context = 286 GetGLES(context_id)->GenFramebuffers(n, framebuffers);
368 Resource::GetAs<PPB_Context3D_Impl>(context_id);
369 context->gles2_impl()->GenFramebuffers(n, framebuffers);
370 } 287 }
371 288
372 void GenRenderbuffers( 289 void GenRenderbuffers(
373 PP_Resource context_id, GLsizei n, GLuint* renderbuffers) { 290 PP_Resource context_id, GLsizei n, GLuint* renderbuffers) {
374 scoped_refptr<PPB_Context3D_Impl> context = 291 GetGLES(context_id)->GenRenderbuffers(n, renderbuffers);
375 Resource::GetAs<PPB_Context3D_Impl>(context_id);
376 context->gles2_impl()->GenRenderbuffers(n, renderbuffers);
377 } 292 }
378 293
379 void GenTextures(PP_Resource context_id, GLsizei n, GLuint* textures) { 294 void GenTextures(PP_Resource context_id, GLsizei n, GLuint* textures) {
380 scoped_refptr<PPB_Context3D_Impl> context = 295 GetGLES(context_id)->GenTextures(n, textures);
381 Resource::GetAs<PPB_Context3D_Impl>(context_id);
382 context->gles2_impl()->GenTextures(n, textures);
383 } 296 }
384 297
385 void GetActiveAttrib( 298 void GetActiveAttrib(
386 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, 299 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize,
387 GLsizei* length, GLint* size, GLenum* type, char* name) { 300 GLsizei* length, GLint* size, GLenum* type, char* name) {
388 scoped_refptr<PPB_Context3D_Impl> context = 301 GetGLES(
389 Resource::GetAs<PPB_Context3D_Impl>(context_id); 302 context_id)->GetActiveAttrib(
390 context->gles2_impl()->GetActiveAttrib( 303 program, index, bufsize, length, size, type, name);
391 program, index, bufsize, length, size, type, name);
392 } 304 }
393 305
394 void GetActiveUniform( 306 void GetActiveUniform(
395 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, 307 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize,
396 GLsizei* length, GLint* size, GLenum* type, char* name) { 308 GLsizei* length, GLint* size, GLenum* type, char* name) {
397 scoped_refptr<PPB_Context3D_Impl> context = 309 GetGLES(
398 Resource::GetAs<PPB_Context3D_Impl>(context_id); 310 context_id)->GetActiveUniform(
399 context->gles2_impl()->GetActiveUniform( 311 program, index, bufsize, length, size, type, name);
400 program, index, bufsize, length, size, type, name);
401 } 312 }
402 313
403 void GetAttachedShaders( 314 void GetAttachedShaders(
404 PP_Resource context_id, GLuint program, GLsizei maxcount, GLsizei* count, 315 PP_Resource context_id, GLuint program, GLsizei maxcount, GLsizei* count,
405 GLuint* shaders) { 316 GLuint* shaders) {
406 scoped_refptr<PPB_Context3D_Impl> context = 317 GetGLES(context_id)->GetAttachedShaders(program, maxcount, count, shaders);
407 Resource::GetAs<PPB_Context3D_Impl>(context_id);
408 context->gles2_impl()->GetAttachedShaders(program, maxcount, count, shaders);
409 } 318 }
410 319
411 GLint GetAttribLocation( 320 GLint GetAttribLocation(
412 PP_Resource context_id, GLuint program, const char* name) { 321 PP_Resource context_id, GLuint program, const char* name) {
413 scoped_refptr<PPB_Context3D_Impl> context = 322 return GetGLES(context_id)->GetAttribLocation(program, name);
414 Resource::GetAs<PPB_Context3D_Impl>(context_id);
415 return context->gles2_impl()->GetAttribLocation(program, name);
416 } 323 }
417 324
418 void GetBooleanv(PP_Resource context_id, GLenum pname, GLboolean* params) { 325 void GetBooleanv(PP_Resource context_id, GLenum pname, GLboolean* params) {
419 scoped_refptr<PPB_Context3D_Impl> context = 326 GetGLES(context_id)->GetBooleanv(pname, params);
420 Resource::GetAs<PPB_Context3D_Impl>(context_id);
421 context->gles2_impl()->GetBooleanv(pname, params);
422 } 327 }
423 328
424 void GetBufferParameteriv( 329 void GetBufferParameteriv(
425 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { 330 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) {
426 scoped_refptr<PPB_Context3D_Impl> context = 331 GetGLES(context_id)->GetBufferParameteriv(target, pname, params);
427 Resource::GetAs<PPB_Context3D_Impl>(context_id);
428 context->gles2_impl()->GetBufferParameteriv(target, pname, params);
429 } 332 }
430 333
431 GLenum GetError(PP_Resource context_id) { 334 GLenum GetError(PP_Resource context_id) {
432 scoped_refptr<PPB_Context3D_Impl> context = 335 return GetGLES(context_id)->GetError();
433 Resource::GetAs<PPB_Context3D_Impl>(context_id);
434 return context->gles2_impl()->GetError();
435 } 336 }
436 337
437 void GetFloatv(PP_Resource context_id, GLenum pname, GLfloat* params) { 338 void GetFloatv(PP_Resource context_id, GLenum pname, GLfloat* params) {
438 scoped_refptr<PPB_Context3D_Impl> context = 339 GetGLES(context_id)->GetFloatv(pname, params);
439 Resource::GetAs<PPB_Context3D_Impl>(context_id);
440 context->gles2_impl()->GetFloatv(pname, params);
441 } 340 }
442 341
443 void GetFramebufferAttachmentParameteriv( 342 void GetFramebufferAttachmentParameteriv(
444 PP_Resource context_id, GLenum target, GLenum attachment, GLenum pname, 343 PP_Resource context_id, GLenum target, GLenum attachment, GLenum pname,
445 GLint* params) { 344 GLint* params) {
446 scoped_refptr<PPB_Context3D_Impl> context = 345 GetGLES(
447 Resource::GetAs<PPB_Context3D_Impl>(context_id); 346 context_id)->GetFramebufferAttachmentParameteriv(
448 context->gles2_impl()->GetFramebufferAttachmentParameteriv( 347 target, attachment, pname, params);
449 target, attachment, pname, params);
450 } 348 }
451 349
452 void GetIntegerv(PP_Resource context_id, GLenum pname, GLint* params) { 350 void GetIntegerv(PP_Resource context_id, GLenum pname, GLint* params) {
453 scoped_refptr<PPB_Context3D_Impl> context = 351 GetGLES(context_id)->GetIntegerv(pname, params);
454 Resource::GetAs<PPB_Context3D_Impl>(context_id);
455 context->gles2_impl()->GetIntegerv(pname, params);
456 } 352 }
457 353
458 void GetProgramiv( 354 void GetProgramiv(
459 PP_Resource context_id, GLuint program, GLenum pname, GLint* params) { 355 PP_Resource context_id, GLuint program, GLenum pname, GLint* params) {
460 scoped_refptr<PPB_Context3D_Impl> context = 356 GetGLES(context_id)->GetProgramiv(program, pname, params);
461 Resource::GetAs<PPB_Context3D_Impl>(context_id);
462 context->gles2_impl()->GetProgramiv(program, pname, params);
463 } 357 }
464 358
465 void GetProgramInfoLog( 359 void GetProgramInfoLog(
466 PP_Resource context_id, GLuint program, GLsizei bufsize, GLsizei* length, 360 PP_Resource context_id, GLuint program, GLsizei bufsize, GLsizei* length,
467 char* infolog) { 361 char* infolog) {
468 scoped_refptr<PPB_Context3D_Impl> context = 362 GetGLES(context_id)->GetProgramInfoLog(program, bufsize, length, infolog);
469 Resource::GetAs<PPB_Context3D_Impl>(context_id);
470 context->gles2_impl()->GetProgramInfoLog(program, bufsize, length, infolog);
471 } 363 }
472 364
473 void GetRenderbufferParameteriv( 365 void GetRenderbufferParameteriv(
474 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { 366 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) {
475 scoped_refptr<PPB_Context3D_Impl> context = 367 GetGLES(context_id)->GetRenderbufferParameteriv(target, pname, params);
476 Resource::GetAs<PPB_Context3D_Impl>(context_id);
477 context->gles2_impl()->GetRenderbufferParameteriv(target, pname, params);
478 } 368 }
479 369
480 void GetShaderiv( 370 void GetShaderiv(
481 PP_Resource context_id, GLuint shader, GLenum pname, GLint* params) { 371 PP_Resource context_id, GLuint shader, GLenum pname, GLint* params) {
482 scoped_refptr<PPB_Context3D_Impl> context = 372 GetGLES(context_id)->GetShaderiv(shader, pname, params);
483 Resource::GetAs<PPB_Context3D_Impl>(context_id);
484 context->gles2_impl()->GetShaderiv(shader, pname, params);
485 } 373 }
486 374
487 void GetShaderInfoLog( 375 void GetShaderInfoLog(
488 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, 376 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length,
489 char* infolog) { 377 char* infolog) {
490 scoped_refptr<PPB_Context3D_Impl> context = 378 GetGLES(context_id)->GetShaderInfoLog(shader, bufsize, length, infolog);
491 Resource::GetAs<PPB_Context3D_Impl>(context_id);
492 context->gles2_impl()->GetShaderInfoLog(shader, bufsize, length, infolog);
493 } 379 }
494 380
495 void GetShaderPrecisionFormat( 381 void GetShaderPrecisionFormat(
496 PP_Resource context_id, GLenum shadertype, GLenum precisiontype, 382 PP_Resource context_id, GLenum shadertype, GLenum precisiontype,
497 GLint* range, GLint* precision) { 383 GLint* range, GLint* precision) {
498 scoped_refptr<PPB_Context3D_Impl> context = 384 GetGLES(
499 Resource::GetAs<PPB_Context3D_Impl>(context_id); 385 context_id)->GetShaderPrecisionFormat(
500 context->gles2_impl()->GetShaderPrecisionFormat( 386 shadertype, precisiontype, range, precision);
501 shadertype, precisiontype, range, precision);
502 } 387 }
503 388
504 void GetShaderSource( 389 void GetShaderSource(
505 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, 390 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length,
506 char* source) { 391 char* source) {
507 scoped_refptr<PPB_Context3D_Impl> context = 392 GetGLES(context_id)->GetShaderSource(shader, bufsize, length, source);
508 Resource::GetAs<PPB_Context3D_Impl>(context_id);
509 context->gles2_impl()->GetShaderSource(shader, bufsize, length, source);
510 } 393 }
511 394
512 const GLubyte* GetString(PP_Resource context_id, GLenum name) { 395 const GLubyte* GetString(PP_Resource context_id, GLenum name) {
513 scoped_refptr<PPB_Context3D_Impl> context = 396 return GetGLES(context_id)->GetString(name);
514 Resource::GetAs<PPB_Context3D_Impl>(context_id);
515 return context->gles2_impl()->GetString(name);
516 } 397 }
517 398
518 void GetTexParameterfv( 399 void GetTexParameterfv(
519 PP_Resource context_id, GLenum target, GLenum pname, GLfloat* params) { 400 PP_Resource context_id, GLenum target, GLenum pname, GLfloat* params) {
520 scoped_refptr<PPB_Context3D_Impl> context = 401 GetGLES(context_id)->GetTexParameterfv(target, pname, params);
521 Resource::GetAs<PPB_Context3D_Impl>(context_id);
522 context->gles2_impl()->GetTexParameterfv(target, pname, params);
523 } 402 }
524 403
525 void GetTexParameteriv( 404 void GetTexParameteriv(
526 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { 405 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) {
527 scoped_refptr<PPB_Context3D_Impl> context = 406 GetGLES(context_id)->GetTexParameteriv(target, pname, params);
528 Resource::GetAs<PPB_Context3D_Impl>(context_id);
529 context->gles2_impl()->GetTexParameteriv(target, pname, params);
530 } 407 }
531 408
532 void GetUniformfv( 409 void GetUniformfv(
533 PP_Resource context_id, GLuint program, GLint location, GLfloat* params) { 410 PP_Resource context_id, GLuint program, GLint location, GLfloat* params) {
534 scoped_refptr<PPB_Context3D_Impl> context = 411 GetGLES(context_id)->GetUniformfv(program, location, params);
535 Resource::GetAs<PPB_Context3D_Impl>(context_id);
536 context->gles2_impl()->GetUniformfv(program, location, params);
537 } 412 }
538 413
539 void GetUniformiv( 414 void GetUniformiv(
540 PP_Resource context_id, GLuint program, GLint location, GLint* params) { 415 PP_Resource context_id, GLuint program, GLint location, GLint* params) {
541 scoped_refptr<PPB_Context3D_Impl> context = 416 GetGLES(context_id)->GetUniformiv(program, location, params);
542 Resource::GetAs<PPB_Context3D_Impl>(context_id);
543 context->gles2_impl()->GetUniformiv(program, location, params);
544 } 417 }
545 418
546 GLint GetUniformLocation( 419 GLint GetUniformLocation(
547 PP_Resource context_id, GLuint program, const char* name) { 420 PP_Resource context_id, GLuint program, const char* name) {
548 scoped_refptr<PPB_Context3D_Impl> context = 421 return GetGLES(context_id)->GetUniformLocation(program, name);
549 Resource::GetAs<PPB_Context3D_Impl>(context_id);
550 return context->gles2_impl()->GetUniformLocation(program, name);
551 } 422 }
552 423
553 void GetVertexAttribfv( 424 void GetVertexAttribfv(
554 PP_Resource context_id, GLuint index, GLenum pname, GLfloat* params) { 425 PP_Resource context_id, GLuint index, GLenum pname, GLfloat* params) {
555 scoped_refptr<PPB_Context3D_Impl> context = 426 GetGLES(context_id)->GetVertexAttribfv(index, pname, params);
556 Resource::GetAs<PPB_Context3D_Impl>(context_id);
557 context->gles2_impl()->GetVertexAttribfv(index, pname, params);
558 } 427 }
559 428
560 void GetVertexAttribiv( 429 void GetVertexAttribiv(
561 PP_Resource context_id, GLuint index, GLenum pname, GLint* params) { 430 PP_Resource context_id, GLuint index, GLenum pname, GLint* params) {
562 scoped_refptr<PPB_Context3D_Impl> context = 431 GetGLES(context_id)->GetVertexAttribiv(index, pname, params);
563 Resource::GetAs<PPB_Context3D_Impl>(context_id);
564 context->gles2_impl()->GetVertexAttribiv(index, pname, params);
565 } 432 }
566 433
567 void GetVertexAttribPointerv( 434 void GetVertexAttribPointerv(
568 PP_Resource context_id, GLuint index, GLenum pname, void** pointer) { 435 PP_Resource context_id, GLuint index, GLenum pname, void** pointer) {
569 scoped_refptr<PPB_Context3D_Impl> context = 436 GetGLES(context_id)->GetVertexAttribPointerv(index, pname, pointer);
570 Resource::GetAs<PPB_Context3D_Impl>(context_id);
571 context->gles2_impl()->GetVertexAttribPointerv(index, pname, pointer);
572 } 437 }
573 438
574 void Hint(PP_Resource context_id, GLenum target, GLenum mode) { 439 void Hint(PP_Resource context_id, GLenum target, GLenum mode) {
575 scoped_refptr<PPB_Context3D_Impl> context = 440 GetGLES(context_id)->Hint(target, mode);
576 Resource::GetAs<PPB_Context3D_Impl>(context_id);
577 context->gles2_impl()->Hint(target, mode);
578 } 441 }
579 442
580 GLboolean IsBuffer(PP_Resource context_id, GLuint buffer) { 443 GLboolean IsBuffer(PP_Resource context_id, GLuint buffer) {
581 scoped_refptr<PPB_Context3D_Impl> context = 444 return GetGLES(context_id)->IsBuffer(buffer);
582 Resource::GetAs<PPB_Context3D_Impl>(context_id);
583 return context->gles2_impl()->IsBuffer(buffer);
584 } 445 }
585 446
586 GLboolean IsEnabled(PP_Resource context_id, GLenum cap) { 447 GLboolean IsEnabled(PP_Resource context_id, GLenum cap) {
587 scoped_refptr<PPB_Context3D_Impl> context = 448 return GetGLES(context_id)->IsEnabled(cap);
588 Resource::GetAs<PPB_Context3D_Impl>(context_id);
589 return context->gles2_impl()->IsEnabled(cap);
590 } 449 }
591 450
592 GLboolean IsFramebuffer(PP_Resource context_id, GLuint framebuffer) { 451 GLboolean IsFramebuffer(PP_Resource context_id, GLuint framebuffer) {
593 scoped_refptr<PPB_Context3D_Impl> context = 452 return GetGLES(context_id)->IsFramebuffer(framebuffer);
594 Resource::GetAs<PPB_Context3D_Impl>(context_id);
595 return context->gles2_impl()->IsFramebuffer(framebuffer);
596 } 453 }
597 454
598 GLboolean IsProgram(PP_Resource context_id, GLuint program) { 455 GLboolean IsProgram(PP_Resource context_id, GLuint program) {
599 scoped_refptr<PPB_Context3D_Impl> context = 456 return GetGLES(context_id)->IsProgram(program);
600 Resource::GetAs<PPB_Context3D_Impl>(context_id);
601 return context->gles2_impl()->IsProgram(program);
602 } 457 }
603 458
604 GLboolean IsRenderbuffer(PP_Resource context_id, GLuint renderbuffer) { 459 GLboolean IsRenderbuffer(PP_Resource context_id, GLuint renderbuffer) {
605 scoped_refptr<PPB_Context3D_Impl> context = 460 return GetGLES(context_id)->IsRenderbuffer(renderbuffer);
606 Resource::GetAs<PPB_Context3D_Impl>(context_id);
607 return context->gles2_impl()->IsRenderbuffer(renderbuffer);
608 } 461 }
609 462
610 GLboolean IsShader(PP_Resource context_id, GLuint shader) { 463 GLboolean IsShader(PP_Resource context_id, GLuint shader) {
611 scoped_refptr<PPB_Context3D_Impl> context = 464 return GetGLES(context_id)->IsShader(shader);
612 Resource::GetAs<PPB_Context3D_Impl>(context_id);
613 return context->gles2_impl()->IsShader(shader);
614 } 465 }
615 466
616 GLboolean IsTexture(PP_Resource context_id, GLuint texture) { 467 GLboolean IsTexture(PP_Resource context_id, GLuint texture) {
617 scoped_refptr<PPB_Context3D_Impl> context = 468 return GetGLES(context_id)->IsTexture(texture);
618 Resource::GetAs<PPB_Context3D_Impl>(context_id);
619 return context->gles2_impl()->IsTexture(texture);
620 } 469 }
621 470
622 void LineWidth(PP_Resource context_id, GLfloat width) { 471 void LineWidth(PP_Resource context_id, GLfloat width) {
623 scoped_refptr<PPB_Context3D_Impl> context = 472 GetGLES(context_id)->LineWidth(width);
624 Resource::GetAs<PPB_Context3D_Impl>(context_id);
625 context->gles2_impl()->LineWidth(width);
626 } 473 }
627 474
628 void LinkProgram(PP_Resource context_id, GLuint program) { 475 void LinkProgram(PP_Resource context_id, GLuint program) {
629 scoped_refptr<PPB_Context3D_Impl> context = 476 GetGLES(context_id)->LinkProgram(program);
630 Resource::GetAs<PPB_Context3D_Impl>(context_id);
631 context->gles2_impl()->LinkProgram(program);
632 } 477 }
633 478
634 void PixelStorei(PP_Resource context_id, GLenum pname, GLint param) { 479 void PixelStorei(PP_Resource context_id, GLenum pname, GLint param) {
635 scoped_refptr<PPB_Context3D_Impl> context = 480 GetGLES(context_id)->PixelStorei(pname, param);
636 Resource::GetAs<PPB_Context3D_Impl>(context_id);
637 context->gles2_impl()->PixelStorei(pname, param);
638 } 481 }
639 482
640 void PolygonOffset(PP_Resource context_id, GLfloat factor, GLfloat units) { 483 void PolygonOffset(PP_Resource context_id, GLfloat factor, GLfloat units) {
641 scoped_refptr<PPB_Context3D_Impl> context = 484 GetGLES(context_id)->PolygonOffset(factor, units);
642 Resource::GetAs<PPB_Context3D_Impl>(context_id);
643 context->gles2_impl()->PolygonOffset(factor, units);
644 } 485 }
645 486
646 void ReadPixels( 487 void ReadPixels(
647 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height, 488 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height,
648 GLenum format, GLenum type, void* pixels) { 489 GLenum format, GLenum type, void* pixels) {
649 scoped_refptr<PPB_Context3D_Impl> context = 490 GetGLES(context_id)->ReadPixels(x, y, width, height, format, type, pixels);
650 Resource::GetAs<PPB_Context3D_Impl>(context_id);
651 context->gles2_impl()->ReadPixels(x, y, width, height, format, type, pixels);
652 } 491 }
653 492
654 void ReleaseShaderCompiler(PP_Resource context_id) { 493 void ReleaseShaderCompiler(PP_Resource context_id) {
655 scoped_refptr<PPB_Context3D_Impl> context = 494 GetGLES(context_id)->ReleaseShaderCompiler();
656 Resource::GetAs<PPB_Context3D_Impl>(context_id);
657 context->gles2_impl()->ReleaseShaderCompiler();
658 } 495 }
659 496
660 void RenderbufferStorage( 497 void RenderbufferStorage(
661 PP_Resource context_id, GLenum target, GLenum internalformat, GLsizei width, 498 PP_Resource context_id, GLenum target, GLenum internalformat, GLsizei width,
662 GLsizei height) { 499 GLsizei height) {
663 scoped_refptr<PPB_Context3D_Impl> context = 500 GetGLES(
664 Resource::GetAs<PPB_Context3D_Impl>(context_id); 501 context_id)->RenderbufferStorage(target, internalformat, width, height);
665 context->gles2_impl()->RenderbufferStorage(
666 target, internalformat, width, height);
667 } 502 }
668 503
669 void SampleCoverage(PP_Resource context_id, GLclampf value, GLboolean invert) { 504 void SampleCoverage(PP_Resource context_id, GLclampf value, GLboolean invert) {
670 scoped_refptr<PPB_Context3D_Impl> context = 505 GetGLES(context_id)->SampleCoverage(value, invert);
671 Resource::GetAs<PPB_Context3D_Impl>(context_id);
672 context->gles2_impl()->SampleCoverage(value, invert);
673 } 506 }
674 507
675 void Scissor( 508 void Scissor(
676 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { 509 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) {
677 scoped_refptr<PPB_Context3D_Impl> context = 510 GetGLES(context_id)->Scissor(x, y, width, height);
678 Resource::GetAs<PPB_Context3D_Impl>(context_id);
679 context->gles2_impl()->Scissor(x, y, width, height);
680 } 511 }
681 512
682 void ShaderBinary( 513 void ShaderBinary(
683 PP_Resource context_id, GLsizei n, const GLuint* shaders, 514 PP_Resource context_id, GLsizei n, const GLuint* shaders,
684 GLenum binaryformat, const void* binary, GLsizei length) { 515 GLenum binaryformat, const void* binary, GLsizei length) {
685 scoped_refptr<PPB_Context3D_Impl> context = 516 GetGLES(context_id)->ShaderBinary(n, shaders, binaryformat, binary, length);
686 Resource::GetAs<PPB_Context3D_Impl>(context_id);
687 context->gles2_impl()->ShaderBinary(
688 n, shaders, binaryformat, binary, length);
689 } 517 }
690 518
691 void ShaderSource( 519 void ShaderSource(
692 PP_Resource context_id, GLuint shader, GLsizei count, const char** str, 520 PP_Resource context_id, GLuint shader, GLsizei count, const char** str,
693 const GLint* length) { 521 const GLint* length) {
694 scoped_refptr<PPB_Context3D_Impl> context = 522 GetGLES(context_id)->ShaderSource(shader, count, str, length);
695 Resource::GetAs<PPB_Context3D_Impl>(context_id);
696 context->gles2_impl()->ShaderSource(shader, count, str, length);
697 } 523 }
698 524
699 void StencilFunc(PP_Resource context_id, GLenum func, GLint ref, GLuint mask) { 525 void StencilFunc(PP_Resource context_id, GLenum func, GLint ref, GLuint mask) {
700 scoped_refptr<PPB_Context3D_Impl> context = 526 GetGLES(context_id)->StencilFunc(func, ref, mask);
701 Resource::GetAs<PPB_Context3D_Impl>(context_id);
702 context->gles2_impl()->StencilFunc(func, ref, mask);
703 } 527 }
704 528
705 void StencilFuncSeparate( 529 void StencilFuncSeparate(
706 PP_Resource context_id, GLenum face, GLenum func, GLint ref, GLuint mask) { 530 PP_Resource context_id, GLenum face, GLenum func, GLint ref, GLuint mask) {
707 scoped_refptr<PPB_Context3D_Impl> context = 531 GetGLES(context_id)->StencilFuncSeparate(face, func, ref, mask);
708 Resource::GetAs<PPB_Context3D_Impl>(context_id);
709 context->gles2_impl()->StencilFuncSeparate(face, func, ref, mask);
710 } 532 }
711 533
712 void StencilMask(PP_Resource context_id, GLuint mask) { 534 void StencilMask(PP_Resource context_id, GLuint mask) {
713 scoped_refptr<PPB_Context3D_Impl> context = 535 GetGLES(context_id)->StencilMask(mask);
714 Resource::GetAs<PPB_Context3D_Impl>(context_id);
715 context->gles2_impl()->StencilMask(mask);
716 } 536 }
717 537
718 void StencilMaskSeparate(PP_Resource context_id, GLenum face, GLuint mask) { 538 void StencilMaskSeparate(PP_Resource context_id, GLenum face, GLuint mask) {
719 scoped_refptr<PPB_Context3D_Impl> context = 539 GetGLES(context_id)->StencilMaskSeparate(face, mask);
720 Resource::GetAs<PPB_Context3D_Impl>(context_id);
721 context->gles2_impl()->StencilMaskSeparate(face, mask);
722 } 540 }
723 541
724 void StencilOp( 542 void StencilOp(
725 PP_Resource context_id, GLenum fail, GLenum zfail, GLenum zpass) { 543 PP_Resource context_id, GLenum fail, GLenum zfail, GLenum zpass) {
726 scoped_refptr<PPB_Context3D_Impl> context = 544 GetGLES(context_id)->StencilOp(fail, zfail, zpass);
727 Resource::GetAs<PPB_Context3D_Impl>(context_id);
728 context->gles2_impl()->StencilOp(fail, zfail, zpass);
729 } 545 }
730 546
731 void StencilOpSeparate( 547 void StencilOpSeparate(
732 PP_Resource context_id, GLenum face, GLenum fail, GLenum zfail, 548 PP_Resource context_id, GLenum face, GLenum fail, GLenum zfail,
733 GLenum zpass) { 549 GLenum zpass) {
734 scoped_refptr<PPB_Context3D_Impl> context = 550 GetGLES(context_id)->StencilOpSeparate(face, fail, zfail, zpass);
735 Resource::GetAs<PPB_Context3D_Impl>(context_id);
736 context->gles2_impl()->StencilOpSeparate(face, fail, zfail, zpass);
737 } 551 }
738 552
739 void TexImage2D( 553 void TexImage2D(
740 PP_Resource context_id, GLenum target, GLint level, GLint internalformat, 554 PP_Resource context_id, GLenum target, GLint level, GLint internalformat,
741 GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, 555 GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
742 const void* pixels) { 556 const void* pixels) {
743 scoped_refptr<PPB_Context3D_Impl> context = 557 GetGLES(
744 Resource::GetAs<PPB_Context3D_Impl>(context_id); 558 context_id)->TexImage2D(
745 context->gles2_impl()->TexImage2D( 559 target, level, internalformat, width, height, border, format, type,
746 target, level, internalformat, width, height, border, format, type, 560 pixels);
747 pixels);
748 } 561 }
749 562
750 void TexParameterf( 563 void TexParameterf(
751 PP_Resource context_id, GLenum target, GLenum pname, GLfloat param) { 564 PP_Resource context_id, GLenum target, GLenum pname, GLfloat param) {
752 scoped_refptr<PPB_Context3D_Impl> context = 565 GetGLES(context_id)->TexParameterf(target, pname, param);
753 Resource::GetAs<PPB_Context3D_Impl>(context_id);
754 context->gles2_impl()->TexParameterf(target, pname, param);
755 } 566 }
756 567
757 void TexParameterfv( 568 void TexParameterfv(
758 PP_Resource context_id, GLenum target, GLenum pname, 569 PP_Resource context_id, GLenum target, GLenum pname,
759 const GLfloat* params) { 570 const GLfloat* params) {
760 scoped_refptr<PPB_Context3D_Impl> context = 571 GetGLES(context_id)->TexParameterfv(target, pname, params);
761 Resource::GetAs<PPB_Context3D_Impl>(context_id);
762 context->gles2_impl()->TexParameterfv(target, pname, params);
763 } 572 }
764 573
765 void TexParameteri( 574 void TexParameteri(
766 PP_Resource context_id, GLenum target, GLenum pname, GLint param) { 575 PP_Resource context_id, GLenum target, GLenum pname, GLint param) {
767 scoped_refptr<PPB_Context3D_Impl> context = 576 GetGLES(context_id)->TexParameteri(target, pname, param);
768 Resource::GetAs<PPB_Context3D_Impl>(context_id);
769 context->gles2_impl()->TexParameteri(target, pname, param);
770 } 577 }
771 578
772 void TexParameteriv( 579 void TexParameteriv(
773 PP_Resource context_id, GLenum target, GLenum pname, const GLint* params) { 580 PP_Resource context_id, GLenum target, GLenum pname, const GLint* params) {
774 scoped_refptr<PPB_Context3D_Impl> context = 581 GetGLES(context_id)->TexParameteriv(target, pname, params);
775 Resource::GetAs<PPB_Context3D_Impl>(context_id);
776 context->gles2_impl()->TexParameteriv(target, pname, params);
777 } 582 }
778 583
779 void TexSubImage2D( 584 void TexSubImage2D(
780 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, 585 PP_Resource context_id, GLenum target, GLint level, GLint xoffset,
781 GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, 586 GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
782 const void* pixels) { 587 const void* pixels) {
783 scoped_refptr<PPB_Context3D_Impl> context = 588 GetGLES(
784 Resource::GetAs<PPB_Context3D_Impl>(context_id); 589 context_id)->TexSubImage2D(
785 context->gles2_impl()->TexSubImage2D( 590 target, level, xoffset, yoffset, width, height, format, type,
786 target, level, xoffset, yoffset, width, height, format, type, pixels); 591 pixels);
787 } 592 }
788 593
789 void Uniform1f(PP_Resource context_id, GLint location, GLfloat x) { 594 void Uniform1f(PP_Resource context_id, GLint location, GLfloat x) {
790 scoped_refptr<PPB_Context3D_Impl> context = 595 GetGLES(context_id)->Uniform1f(location, x);
791 Resource::GetAs<PPB_Context3D_Impl>(context_id);
792 context->gles2_impl()->Uniform1f(location, x);
793 } 596 }
794 597
795 void Uniform1fv( 598 void Uniform1fv(
796 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { 599 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) {
797 scoped_refptr<PPB_Context3D_Impl> context = 600 GetGLES(context_id)->Uniform1fv(location, count, v);
798 Resource::GetAs<PPB_Context3D_Impl>(context_id);
799 context->gles2_impl()->Uniform1fv(location, count, v);
800 } 601 }
801 602
802 void Uniform1i(PP_Resource context_id, GLint location, GLint x) { 603 void Uniform1i(PP_Resource context_id, GLint location, GLint x) {
803 scoped_refptr<PPB_Context3D_Impl> context = 604 GetGLES(context_id)->Uniform1i(location, x);
804 Resource::GetAs<PPB_Context3D_Impl>(context_id);
805 context->gles2_impl()->Uniform1i(location, x);
806 } 605 }
807 606
808 void Uniform1iv( 607 void Uniform1iv(
809 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { 608 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) {
810 scoped_refptr<PPB_Context3D_Impl> context = 609 GetGLES(context_id)->Uniform1iv(location, count, v);
811 Resource::GetAs<PPB_Context3D_Impl>(context_id);
812 context->gles2_impl()->Uniform1iv(location, count, v);
813 } 610 }
814 611
815 void Uniform2f(PP_Resource context_id, GLint location, GLfloat x, GLfloat y) { 612 void Uniform2f(PP_Resource context_id, GLint location, GLfloat x, GLfloat y) {
816 scoped_refptr<PPB_Context3D_Impl> context = 613 GetGLES(context_id)->Uniform2f(location, x, y);
817 Resource::GetAs<PPB_Context3D_Impl>(context_id);
818 context->gles2_impl()->Uniform2f(location, x, y);
819 } 614 }
820 615
821 void Uniform2fv( 616 void Uniform2fv(
822 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { 617 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) {
823 scoped_refptr<PPB_Context3D_Impl> context = 618 GetGLES(context_id)->Uniform2fv(location, count, v);
824 Resource::GetAs<PPB_Context3D_Impl>(context_id);
825 context->gles2_impl()->Uniform2fv(location, count, v);
826 } 619 }
827 620
828 void Uniform2i(PP_Resource context_id, GLint location, GLint x, GLint y) { 621 void Uniform2i(PP_Resource context_id, GLint location, GLint x, GLint y) {
829 scoped_refptr<PPB_Context3D_Impl> context = 622 GetGLES(context_id)->Uniform2i(location, x, y);
830 Resource::GetAs<PPB_Context3D_Impl>(context_id);
831 context->gles2_impl()->Uniform2i(location, x, y);
832 } 623 }
833 624
834 void Uniform2iv( 625 void Uniform2iv(
835 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { 626 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) {
836 scoped_refptr<PPB_Context3D_Impl> context = 627 GetGLES(context_id)->Uniform2iv(location, count, v);
837 Resource::GetAs<PPB_Context3D_Impl>(context_id);
838 context->gles2_impl()->Uniform2iv(location, count, v);
839 } 628 }
840 629
841 void Uniform3f( 630 void Uniform3f(
842 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z) { 631 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z) {
843 scoped_refptr<PPB_Context3D_Impl> context = 632 GetGLES(context_id)->Uniform3f(location, x, y, z);
844 Resource::GetAs<PPB_Context3D_Impl>(context_id);
845 context->gles2_impl()->Uniform3f(location, x, y, z);
846 } 633 }
847 634
848 void Uniform3fv( 635 void Uniform3fv(
849 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { 636 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) {
850 scoped_refptr<PPB_Context3D_Impl> context = 637 GetGLES(context_id)->Uniform3fv(location, count, v);
851 Resource::GetAs<PPB_Context3D_Impl>(context_id);
852 context->gles2_impl()->Uniform3fv(location, count, v);
853 } 638 }
854 639
855 void Uniform3i( 640 void Uniform3i(
856 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z) { 641 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z) {
857 scoped_refptr<PPB_Context3D_Impl> context = 642 GetGLES(context_id)->Uniform3i(location, x, y, z);
858 Resource::GetAs<PPB_Context3D_Impl>(context_id);
859 context->gles2_impl()->Uniform3i(location, x, y, z);
860 } 643 }
861 644
862 void Uniform3iv( 645 void Uniform3iv(
863 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { 646 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) {
864 scoped_refptr<PPB_Context3D_Impl> context = 647 GetGLES(context_id)->Uniform3iv(location, count, v);
865 Resource::GetAs<PPB_Context3D_Impl>(context_id);
866 context->gles2_impl()->Uniform3iv(location, count, v);
867 } 648 }
868 649
869 void Uniform4f( 650 void Uniform4f(
870 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z, 651 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z,
871 GLfloat w) { 652 GLfloat w) {
872 scoped_refptr<PPB_Context3D_Impl> context = 653 GetGLES(context_id)->Uniform4f(location, x, y, z, w);
873 Resource::GetAs<PPB_Context3D_Impl>(context_id);
874 context->gles2_impl()->Uniform4f(location, x, y, z, w);
875 } 654 }
876 655
877 void Uniform4fv( 656 void Uniform4fv(
878 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { 657 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) {
879 scoped_refptr<PPB_Context3D_Impl> context = 658 GetGLES(context_id)->Uniform4fv(location, count, v);
880 Resource::GetAs<PPB_Context3D_Impl>(context_id);
881 context->gles2_impl()->Uniform4fv(location, count, v);
882 } 659 }
883 660
884 void Uniform4i( 661 void Uniform4i(
885 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z, 662 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z,
886 GLint w) { 663 GLint w) {
887 scoped_refptr<PPB_Context3D_Impl> context = 664 GetGLES(context_id)->Uniform4i(location, x, y, z, w);
888 Resource::GetAs<PPB_Context3D_Impl>(context_id);
889 context->gles2_impl()->Uniform4i(location, x, y, z, w);
890 } 665 }
891 666
892 void Uniform4iv( 667 void Uniform4iv(
893 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { 668 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) {
894 scoped_refptr<PPB_Context3D_Impl> context = 669 GetGLES(context_id)->Uniform4iv(location, count, v);
895 Resource::GetAs<PPB_Context3D_Impl>(context_id);
896 context->gles2_impl()->Uniform4iv(location, count, v);
897 } 670 }
898 671
899 void UniformMatrix2fv( 672 void UniformMatrix2fv(
900 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, 673 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose,
901 const GLfloat* value) { 674 const GLfloat* value) {
902 scoped_refptr<PPB_Context3D_Impl> context = 675 GetGLES(context_id)->UniformMatrix2fv(location, count, transpose, value);
903 Resource::GetAs<PPB_Context3D_Impl>(context_id);
904 context->gles2_impl()->UniformMatrix2fv(location, count, transpose, value);
905 } 676 }
906 677
907 void UniformMatrix3fv( 678 void UniformMatrix3fv(
908 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, 679 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose,
909 const GLfloat* value) { 680 const GLfloat* value) {
910 scoped_refptr<PPB_Context3D_Impl> context = 681 GetGLES(context_id)->UniformMatrix3fv(location, count, transpose, value);
911 Resource::GetAs<PPB_Context3D_Impl>(context_id);
912 context->gles2_impl()->UniformMatrix3fv(location, count, transpose, value);
913 } 682 }
914 683
915 void UniformMatrix4fv( 684 void UniformMatrix4fv(
916 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, 685 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose,
917 const GLfloat* value) { 686 const GLfloat* value) {
918 scoped_refptr<PPB_Context3D_Impl> context = 687 GetGLES(context_id)->UniformMatrix4fv(location, count, transpose, value);
919 Resource::GetAs<PPB_Context3D_Impl>(context_id);
920 context->gles2_impl()->UniformMatrix4fv(location, count, transpose, value);
921 } 688 }
922 689
923 void UseProgram(PP_Resource context_id, GLuint program) { 690 void UseProgram(PP_Resource context_id, GLuint program) {
924 scoped_refptr<PPB_Context3D_Impl> context = 691 GetGLES(context_id)->UseProgram(program);
925 Resource::GetAs<PPB_Context3D_Impl>(context_id);
926 context->gles2_impl()->UseProgram(program);
927 } 692 }
928 693
929 void ValidateProgram(PP_Resource context_id, GLuint program) { 694 void ValidateProgram(PP_Resource context_id, GLuint program) {
930 scoped_refptr<PPB_Context3D_Impl> context = 695 GetGLES(context_id)->ValidateProgram(program);
931 Resource::GetAs<PPB_Context3D_Impl>(context_id);
932 context->gles2_impl()->ValidateProgram(program);
933 } 696 }
934 697
935 void VertexAttrib1f(PP_Resource context_id, GLuint indx, GLfloat x) { 698 void VertexAttrib1f(PP_Resource context_id, GLuint indx, GLfloat x) {
936 scoped_refptr<PPB_Context3D_Impl> context = 699 GetGLES(context_id)->VertexAttrib1f(indx, x);
937 Resource::GetAs<PPB_Context3D_Impl>(context_id);
938 context->gles2_impl()->VertexAttrib1f(indx, x);
939 } 700 }
940 701
941 void VertexAttrib1fv( 702 void VertexAttrib1fv(
942 PP_Resource context_id, GLuint indx, const GLfloat* values) { 703 PP_Resource context_id, GLuint indx, const GLfloat* values) {
943 scoped_refptr<PPB_Context3D_Impl> context = 704 GetGLES(context_id)->VertexAttrib1fv(indx, values);
944 Resource::GetAs<PPB_Context3D_Impl>(context_id);
945 context->gles2_impl()->VertexAttrib1fv(indx, values);
946 } 705 }
947 706
948 void VertexAttrib2f( 707 void VertexAttrib2f(
949 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y) { 708 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y) {
950 scoped_refptr<PPB_Context3D_Impl> context = 709 GetGLES(context_id)->VertexAttrib2f(indx, x, y);
951 Resource::GetAs<PPB_Context3D_Impl>(context_id);
952 context->gles2_impl()->VertexAttrib2f(indx, x, y);
953 } 710 }
954 711
955 void VertexAttrib2fv( 712 void VertexAttrib2fv(
956 PP_Resource context_id, GLuint indx, const GLfloat* values) { 713 PP_Resource context_id, GLuint indx, const GLfloat* values) {
957 scoped_refptr<PPB_Context3D_Impl> context = 714 GetGLES(context_id)->VertexAttrib2fv(indx, values);
958 Resource::GetAs<PPB_Context3D_Impl>(context_id);
959 context->gles2_impl()->VertexAttrib2fv(indx, values);
960 } 715 }
961 716
962 void VertexAttrib3f( 717 void VertexAttrib3f(
963 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z) { 718 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
964 scoped_refptr<PPB_Context3D_Impl> context = 719 GetGLES(context_id)->VertexAttrib3f(indx, x, y, z);
965 Resource::GetAs<PPB_Context3D_Impl>(context_id);
966 context->gles2_impl()->VertexAttrib3f(indx, x, y, z);
967 } 720 }
968 721
969 void VertexAttrib3fv( 722 void VertexAttrib3fv(
970 PP_Resource context_id, GLuint indx, const GLfloat* values) { 723 PP_Resource context_id, GLuint indx, const GLfloat* values) {
971 scoped_refptr<PPB_Context3D_Impl> context = 724 GetGLES(context_id)->VertexAttrib3fv(indx, values);
972 Resource::GetAs<PPB_Context3D_Impl>(context_id);
973 context->gles2_impl()->VertexAttrib3fv(indx, values);
974 } 725 }
975 726
976 void VertexAttrib4f( 727 void VertexAttrib4f(
977 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z, 728 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z,
978 GLfloat w) { 729 GLfloat w) {
979 scoped_refptr<PPB_Context3D_Impl> context = 730 GetGLES(context_id)->VertexAttrib4f(indx, x, y, z, w);
980 Resource::GetAs<PPB_Context3D_Impl>(context_id);
981 context->gles2_impl()->VertexAttrib4f(indx, x, y, z, w);
982 } 731 }
983 732
984 void VertexAttrib4fv( 733 void VertexAttrib4fv(
985 PP_Resource context_id, GLuint indx, const GLfloat* values) { 734 PP_Resource context_id, GLuint indx, const GLfloat* values) {
986 scoped_refptr<PPB_Context3D_Impl> context = 735 GetGLES(context_id)->VertexAttrib4fv(indx, values);
987 Resource::GetAs<PPB_Context3D_Impl>(context_id);
988 context->gles2_impl()->VertexAttrib4fv(indx, values);
989 } 736 }
990 737
991 void VertexAttribPointer( 738 void VertexAttribPointer(
992 PP_Resource context_id, GLuint indx, GLint size, GLenum type, 739 PP_Resource context_id, GLuint indx, GLint size, GLenum type,
993 GLboolean normalized, GLsizei stride, const void* ptr) { 740 GLboolean normalized, GLsizei stride, const void* ptr) {
994 scoped_refptr<PPB_Context3D_Impl> context = 741 GetGLES(
995 Resource::GetAs<PPB_Context3D_Impl>(context_id); 742 context_id)->VertexAttribPointer(
996 context->gles2_impl()->VertexAttribPointer( 743 indx, size, type, normalized, stride, ptr);
997 indx, size, type, normalized, stride, ptr);
998 } 744 }
999 745
1000 void Viewport( 746 void Viewport(
1001 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { 747 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) {
1002 scoped_refptr<PPB_Context3D_Impl> context = 748 GetGLES(context_id)->Viewport(x, y, width, height);
1003 Resource::GetAs<PPB_Context3D_Impl>(context_id); 749 }
1004 context->gles2_impl()->Viewport(x, y, width, height); 750
751 void SetLatchCHROMIUM(PP_Resource context_id, GLuint latch_id) {
752 GetGLES(context_id)->SetLatchCHROMIUM(latch_id);
753 }
754
755 void WaitLatchCHROMIUM(PP_Resource context_id, GLuint latch_id) {
756 GetGLES(context_id)->WaitLatchCHROMIUM(latch_id);
1005 } 757 }
1006 758
1007 759
1008 const struct PPB_OpenGLES2_Dev ppb_opengles2 = { 760 const struct PPB_OpenGLES2_Dev ppb_opengles2 = {
1009 &ActiveTexture, 761 &ActiveTexture,
1010 &AttachShader, 762 &AttachShader,
1011 &BindAttribLocation, 763 &BindAttribLocation,
1012 &BindBuffer, 764 &BindBuffer,
1013 &BindFramebuffer, 765 &BindFramebuffer,
1014 &BindRenderbuffer, 766 &BindRenderbuffer,
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 &ValidateProgram, 892 &ValidateProgram,
1141 &VertexAttrib1f, 893 &VertexAttrib1f,
1142 &VertexAttrib1fv, 894 &VertexAttrib1fv,
1143 &VertexAttrib2f, 895 &VertexAttrib2f,
1144 &VertexAttrib2fv, 896 &VertexAttrib2fv,
1145 &VertexAttrib3f, 897 &VertexAttrib3f,
1146 &VertexAttrib3fv, 898 &VertexAttrib3fv,
1147 &VertexAttrib4f, 899 &VertexAttrib4f,
1148 &VertexAttrib4fv, 900 &VertexAttrib4fv,
1149 &VertexAttribPointer, 901 &VertexAttribPointer,
1150 &Viewport 902 &Viewport,
903 &SetLatchCHROMIUM,
904 &WaitLatchCHROMIUM
1151 }; 905 };
1152 906
1153 } // namespace 907 } // namespace
1154 908
1155 const PPB_OpenGLES2_Dev* PPB_OpenGLES_Impl::GetInterface() { 909 const PPB_OpenGLES2_Dev* PPB_OpenGLES_Impl::GetInterface() {
1156 return &ppb_opengles2; 910 return &ppb_opengles2;
1157 } 911 }
1158 912
1159 } // namespace ppapi 913 } // namespace ppapi
1160 } // namespace webkit 914 } // namespace webkit
1161 915
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_layer_compositor_impl.cc ('k') | webkit/plugins/ppapi/ppb_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698