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

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

Powered by Google App Engine
This is Rietveld 408576698