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

Side by Side Diff: ppapi/proxy/ppb_opengles2_proxy.cc

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

Powered by Google App Engine
This is Rietveld 408576698