Don't probe for IPv6 connectivity when resolving IPv6 literals.
[chromium-blink-merge.git] / ppapi / shared_impl / ppb_opengles2_shared.cc
blob32bb5476ec2ce70b2b175432ffc44615c7fc0b58
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT!
11 #include "ppapi/shared_impl/ppb_opengles2_shared.h"
13 #include "base/logging.h"
14 #include "gpu/command_buffer/client/gles2_implementation.h"
15 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
16 #include "ppapi/thunk/enter.h"
18 namespace ppapi {
20 namespace {
22 typedef thunk::EnterResource<thunk::PPB_Graphics3D_API> Enter3D;
24 gpu::gles2::GLES2Implementation* ToGles2Impl(Enter3D* enter) {
25 DCHECK(enter);
26 DCHECK(enter->succeeded());
27 return static_cast<PPB_Graphics3D_Shared*>(enter->object())->gles2_impl();
30 void ActiveTexture(PP_Resource context_id, GLenum texture) {
31 Enter3D enter(context_id, true);
32 if (enter.succeeded()) {
33 ToGles2Impl(&enter)->ActiveTexture(texture);
37 void AttachShader(PP_Resource context_id, GLuint program, GLuint shader) {
38 Enter3D enter(context_id, true);
39 if (enter.succeeded()) {
40 ToGles2Impl(&enter)->AttachShader(program, shader);
44 void BindAttribLocation(PP_Resource context_id,
45 GLuint program,
46 GLuint index,
47 const char* name) {
48 Enter3D enter(context_id, true);
49 if (enter.succeeded()) {
50 ToGles2Impl(&enter)->BindAttribLocation(program, index, name);
54 void BindBuffer(PP_Resource context_id, GLenum target, GLuint buffer) {
55 Enter3D enter(context_id, true);
56 if (enter.succeeded()) {
57 ToGles2Impl(&enter)->BindBuffer(target, buffer);
61 void BindFramebuffer(PP_Resource context_id,
62 GLenum target,
63 GLuint framebuffer) {
64 Enter3D enter(context_id, true);
65 if (enter.succeeded()) {
66 ToGles2Impl(&enter)->BindFramebuffer(target, framebuffer);
70 void BindRenderbuffer(PP_Resource context_id,
71 GLenum target,
72 GLuint renderbuffer) {
73 Enter3D enter(context_id, true);
74 if (enter.succeeded()) {
75 ToGles2Impl(&enter)->BindRenderbuffer(target, renderbuffer);
79 void BindTexture(PP_Resource context_id, GLenum target, GLuint texture) {
80 Enter3D enter(context_id, true);
81 if (enter.succeeded()) {
82 ToGles2Impl(&enter)->BindTexture(target, texture);
86 void BlendColor(PP_Resource context_id,
87 GLclampf red,
88 GLclampf green,
89 GLclampf blue,
90 GLclampf alpha) {
91 Enter3D enter(context_id, true);
92 if (enter.succeeded()) {
93 ToGles2Impl(&enter)->BlendColor(red, green, blue, alpha);
97 void BlendEquation(PP_Resource context_id, GLenum mode) {
98 Enter3D enter(context_id, true);
99 if (enter.succeeded()) {
100 ToGles2Impl(&enter)->BlendEquation(mode);
104 void BlendEquationSeparate(PP_Resource context_id,
105 GLenum modeRGB,
106 GLenum modeAlpha) {
107 Enter3D enter(context_id, true);
108 if (enter.succeeded()) {
109 ToGles2Impl(&enter)->BlendEquationSeparate(modeRGB, modeAlpha);
113 void BlendFunc(PP_Resource context_id, GLenum sfactor, GLenum dfactor) {
114 Enter3D enter(context_id, true);
115 if (enter.succeeded()) {
116 ToGles2Impl(&enter)->BlendFunc(sfactor, dfactor);
120 void BlendFuncSeparate(PP_Resource context_id,
121 GLenum srcRGB,
122 GLenum dstRGB,
123 GLenum srcAlpha,
124 GLenum dstAlpha) {
125 Enter3D enter(context_id, true);
126 if (enter.succeeded()) {
127 ToGles2Impl(&enter)->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
131 void BufferData(PP_Resource context_id,
132 GLenum target,
133 GLsizeiptr size,
134 const void* data,
135 GLenum usage) {
136 Enter3D enter(context_id, true);
137 if (enter.succeeded()) {
138 ToGles2Impl(&enter)->BufferData(target, size, data, usage);
142 void BufferSubData(PP_Resource context_id,
143 GLenum target,
144 GLintptr offset,
145 GLsizeiptr size,
146 const void* data) {
147 Enter3D enter(context_id, true);
148 if (enter.succeeded()) {
149 ToGles2Impl(&enter)->BufferSubData(target, offset, size, data);
153 GLenum CheckFramebufferStatus(PP_Resource context_id, GLenum target) {
154 Enter3D enter(context_id, true);
155 if (enter.succeeded()) {
156 return ToGles2Impl(&enter)->CheckFramebufferStatus(target);
157 } else {
158 return 0;
162 void Clear(PP_Resource context_id, GLbitfield mask) {
163 Enter3D enter(context_id, true);
164 if (enter.succeeded()) {
165 ToGles2Impl(&enter)->Clear(mask);
169 void ClearColor(PP_Resource context_id,
170 GLclampf red,
171 GLclampf green,
172 GLclampf blue,
173 GLclampf alpha) {
174 Enter3D enter(context_id, true);
175 if (enter.succeeded()) {
176 ToGles2Impl(&enter)->ClearColor(red, green, blue, alpha);
180 void ClearDepthf(PP_Resource context_id, GLclampf depth) {
181 Enter3D enter(context_id, true);
182 if (enter.succeeded()) {
183 ToGles2Impl(&enter)->ClearDepthf(depth);
187 void ClearStencil(PP_Resource context_id, GLint s) {
188 Enter3D enter(context_id, true);
189 if (enter.succeeded()) {
190 ToGles2Impl(&enter)->ClearStencil(s);
194 void ColorMask(PP_Resource context_id,
195 GLboolean red,
196 GLboolean green,
197 GLboolean blue,
198 GLboolean alpha) {
199 Enter3D enter(context_id, true);
200 if (enter.succeeded()) {
201 ToGles2Impl(&enter)->ColorMask(red, green, blue, alpha);
205 void CompileShader(PP_Resource context_id, GLuint shader) {
206 Enter3D enter(context_id, true);
207 if (enter.succeeded()) {
208 ToGles2Impl(&enter)->CompileShader(shader);
212 void CompressedTexImage2D(PP_Resource context_id,
213 GLenum target,
214 GLint level,
215 GLenum internalformat,
216 GLsizei width,
217 GLsizei height,
218 GLint border,
219 GLsizei imageSize,
220 const void* data) {
221 Enter3D enter(context_id, true);
222 if (enter.succeeded()) {
223 ToGles2Impl(&enter)->CompressedTexImage2D(
224 target, level, internalformat, width, height, border, imageSize, data);
228 void CompressedTexSubImage2D(PP_Resource context_id,
229 GLenum target,
230 GLint level,
231 GLint xoffset,
232 GLint yoffset,
233 GLsizei width,
234 GLsizei height,
235 GLenum format,
236 GLsizei imageSize,
237 const void* data) {
238 Enter3D enter(context_id, true);
239 if (enter.succeeded()) {
240 ToGles2Impl(&enter)->CompressedTexSubImage2D(target, level, xoffset,
241 yoffset, width, height, format,
242 imageSize, data);
246 void CopyTexImage2D(PP_Resource context_id,
247 GLenum target,
248 GLint level,
249 GLenum internalformat,
250 GLint x,
251 GLint y,
252 GLsizei width,
253 GLsizei height,
254 GLint border) {
255 Enter3D enter(context_id, true);
256 if (enter.succeeded()) {
257 ToGles2Impl(&enter)->CopyTexImage2D(target, level, internalformat, x, y,
258 width, height, border);
262 void CopyTexSubImage2D(PP_Resource context_id,
263 GLenum target,
264 GLint level,
265 GLint xoffset,
266 GLint yoffset,
267 GLint x,
268 GLint y,
269 GLsizei width,
270 GLsizei height) {
271 Enter3D enter(context_id, true);
272 if (enter.succeeded()) {
273 ToGles2Impl(&enter)->CopyTexSubImage2D(target, level, xoffset, yoffset, x,
274 y, width, height);
278 GLuint CreateProgram(PP_Resource context_id) {
279 Enter3D enter(context_id, true);
280 if (enter.succeeded()) {
281 return ToGles2Impl(&enter)->CreateProgram();
282 } else {
283 return 0;
287 GLuint CreateShader(PP_Resource context_id, GLenum type) {
288 Enter3D enter(context_id, true);
289 if (enter.succeeded()) {
290 return ToGles2Impl(&enter)->CreateShader(type);
291 } else {
292 return 0;
296 void CullFace(PP_Resource context_id, GLenum mode) {
297 Enter3D enter(context_id, true);
298 if (enter.succeeded()) {
299 ToGles2Impl(&enter)->CullFace(mode);
303 void DeleteBuffers(PP_Resource context_id, GLsizei n, const GLuint* buffers) {
304 Enter3D enter(context_id, true);
305 if (enter.succeeded()) {
306 ToGles2Impl(&enter)->DeleteBuffers(n, buffers);
310 void DeleteFramebuffers(PP_Resource context_id,
311 GLsizei n,
312 const GLuint* framebuffers) {
313 Enter3D enter(context_id, true);
314 if (enter.succeeded()) {
315 ToGles2Impl(&enter)->DeleteFramebuffers(n, framebuffers);
319 void DeleteProgram(PP_Resource context_id, GLuint program) {
320 Enter3D enter(context_id, true);
321 if (enter.succeeded()) {
322 ToGles2Impl(&enter)->DeleteProgram(program);
326 void DeleteRenderbuffers(PP_Resource context_id,
327 GLsizei n,
328 const GLuint* renderbuffers) {
329 Enter3D enter(context_id, true);
330 if (enter.succeeded()) {
331 ToGles2Impl(&enter)->DeleteRenderbuffers(n, renderbuffers);
335 void DeleteShader(PP_Resource context_id, GLuint shader) {
336 Enter3D enter(context_id, true);
337 if (enter.succeeded()) {
338 ToGles2Impl(&enter)->DeleteShader(shader);
342 void DeleteTextures(PP_Resource context_id, GLsizei n, const GLuint* textures) {
343 Enter3D enter(context_id, true);
344 if (enter.succeeded()) {
345 ToGles2Impl(&enter)->DeleteTextures(n, textures);
349 void DepthFunc(PP_Resource context_id, GLenum func) {
350 Enter3D enter(context_id, true);
351 if (enter.succeeded()) {
352 ToGles2Impl(&enter)->DepthFunc(func);
356 void DepthMask(PP_Resource context_id, GLboolean flag) {
357 Enter3D enter(context_id, true);
358 if (enter.succeeded()) {
359 ToGles2Impl(&enter)->DepthMask(flag);
363 void DepthRangef(PP_Resource context_id, GLclampf zNear, GLclampf zFar) {
364 Enter3D enter(context_id, true);
365 if (enter.succeeded()) {
366 ToGles2Impl(&enter)->DepthRangef(zNear, zFar);
370 void DetachShader(PP_Resource context_id, GLuint program, GLuint shader) {
371 Enter3D enter(context_id, true);
372 if (enter.succeeded()) {
373 ToGles2Impl(&enter)->DetachShader(program, shader);
377 void Disable(PP_Resource context_id, GLenum cap) {
378 Enter3D enter(context_id, true);
379 if (enter.succeeded()) {
380 ToGles2Impl(&enter)->Disable(cap);
384 void DisableVertexAttribArray(PP_Resource context_id, GLuint index) {
385 Enter3D enter(context_id, true);
386 if (enter.succeeded()) {
387 ToGles2Impl(&enter)->DisableVertexAttribArray(index);
391 void DrawArrays(PP_Resource context_id,
392 GLenum mode,
393 GLint first,
394 GLsizei count) {
395 Enter3D enter(context_id, true);
396 if (enter.succeeded()) {
397 ToGles2Impl(&enter)->DrawArrays(mode, first, count);
401 void DrawElements(PP_Resource context_id,
402 GLenum mode,
403 GLsizei count,
404 GLenum type,
405 const void* indices) {
406 Enter3D enter(context_id, true);
407 if (enter.succeeded()) {
408 ToGles2Impl(&enter)->DrawElements(mode, count, type, indices);
412 void Enable(PP_Resource context_id, GLenum cap) {
413 Enter3D enter(context_id, true);
414 if (enter.succeeded()) {
415 ToGles2Impl(&enter)->Enable(cap);
419 void EnableVertexAttribArray(PP_Resource context_id, GLuint index) {
420 Enter3D enter(context_id, true);
421 if (enter.succeeded()) {
422 ToGles2Impl(&enter)->EnableVertexAttribArray(index);
426 void Finish(PP_Resource context_id) {
427 Enter3D enter(context_id, true);
428 if (enter.succeeded()) {
429 ToGles2Impl(&enter)->Finish();
433 void Flush(PP_Resource context_id) {
434 Enter3D enter(context_id, true);
435 if (enter.succeeded()) {
436 ToGles2Impl(&enter)->Flush();
440 void FramebufferRenderbuffer(PP_Resource context_id,
441 GLenum target,
442 GLenum attachment,
443 GLenum renderbuffertarget,
444 GLuint renderbuffer) {
445 Enter3D enter(context_id, true);
446 if (enter.succeeded()) {
447 ToGles2Impl(&enter)->FramebufferRenderbuffer(
448 target, attachment, renderbuffertarget, renderbuffer);
452 void FramebufferTexture2D(PP_Resource context_id,
453 GLenum target,
454 GLenum attachment,
455 GLenum textarget,
456 GLuint texture,
457 GLint level) {
458 Enter3D enter(context_id, true);
459 if (enter.succeeded()) {
460 ToGles2Impl(&enter)
461 ->FramebufferTexture2D(target, attachment, textarget, texture, level);
465 void FrontFace(PP_Resource context_id, GLenum mode) {
466 Enter3D enter(context_id, true);
467 if (enter.succeeded()) {
468 ToGles2Impl(&enter)->FrontFace(mode);
472 void GenBuffers(PP_Resource context_id, GLsizei n, GLuint* buffers) {
473 Enter3D enter(context_id, true);
474 if (enter.succeeded()) {
475 ToGles2Impl(&enter)->GenBuffers(n, buffers);
479 void GenerateMipmap(PP_Resource context_id, GLenum target) {
480 Enter3D enter(context_id, true);
481 if (enter.succeeded()) {
482 ToGles2Impl(&enter)->GenerateMipmap(target);
486 void GenFramebuffers(PP_Resource context_id, GLsizei n, GLuint* framebuffers) {
487 Enter3D enter(context_id, true);
488 if (enter.succeeded()) {
489 ToGles2Impl(&enter)->GenFramebuffers(n, framebuffers);
493 void GenRenderbuffers(PP_Resource context_id,
494 GLsizei n,
495 GLuint* renderbuffers) {
496 Enter3D enter(context_id, true);
497 if (enter.succeeded()) {
498 ToGles2Impl(&enter)->GenRenderbuffers(n, renderbuffers);
502 void GenTextures(PP_Resource context_id, GLsizei n, GLuint* textures) {
503 Enter3D enter(context_id, true);
504 if (enter.succeeded()) {
505 ToGles2Impl(&enter)->GenTextures(n, textures);
509 void GetActiveAttrib(PP_Resource context_id,
510 GLuint program,
511 GLuint index,
512 GLsizei bufsize,
513 GLsizei* length,
514 GLint* size,
515 GLenum* type,
516 char* name) {
517 Enter3D enter(context_id, true);
518 if (enter.succeeded()) {
519 ToGles2Impl(&enter)
520 ->GetActiveAttrib(program, index, bufsize, length, size, type, name);
524 void GetActiveUniform(PP_Resource context_id,
525 GLuint program,
526 GLuint index,
527 GLsizei bufsize,
528 GLsizei* length,
529 GLint* size,
530 GLenum* type,
531 char* name) {
532 Enter3D enter(context_id, true);
533 if (enter.succeeded()) {
534 ToGles2Impl(&enter)
535 ->GetActiveUniform(program, index, bufsize, length, size, type, name);
539 void GetAttachedShaders(PP_Resource context_id,
540 GLuint program,
541 GLsizei maxcount,
542 GLsizei* count,
543 GLuint* shaders) {
544 Enter3D enter(context_id, true);
545 if (enter.succeeded()) {
546 ToGles2Impl(&enter)->GetAttachedShaders(program, maxcount, count, shaders);
550 GLint GetAttribLocation(PP_Resource context_id,
551 GLuint program,
552 const char* name) {
553 Enter3D enter(context_id, true);
554 if (enter.succeeded()) {
555 return ToGles2Impl(&enter)->GetAttribLocation(program, name);
556 } else {
557 return -1;
561 void GetBooleanv(PP_Resource context_id, GLenum pname, GLboolean* params) {
562 Enter3D enter(context_id, true);
563 if (enter.succeeded()) {
564 ToGles2Impl(&enter)->GetBooleanv(pname, params);
568 void GetBufferParameteriv(PP_Resource context_id,
569 GLenum target,
570 GLenum pname,
571 GLint* params) {
572 Enter3D enter(context_id, true);
573 if (enter.succeeded()) {
574 ToGles2Impl(&enter)->GetBufferParameteriv(target, pname, params);
578 GLenum GetError(PP_Resource context_id) {
579 Enter3D enter(context_id, true);
580 if (enter.succeeded()) {
581 return ToGles2Impl(&enter)->GetError();
582 } else {
583 return 0;
587 void GetFloatv(PP_Resource context_id, GLenum pname, GLfloat* params) {
588 Enter3D enter(context_id, true);
589 if (enter.succeeded()) {
590 ToGles2Impl(&enter)->GetFloatv(pname, params);
594 void GetFramebufferAttachmentParameteriv(PP_Resource context_id,
595 GLenum target,
596 GLenum attachment,
597 GLenum pname,
598 GLint* params) {
599 Enter3D enter(context_id, true);
600 if (enter.succeeded()) {
601 ToGles2Impl(&enter)->GetFramebufferAttachmentParameteriv(target, attachment,
602 pname, params);
606 void GetIntegerv(PP_Resource context_id, GLenum pname, GLint* params) {
607 Enter3D enter(context_id, true);
608 if (enter.succeeded()) {
609 ToGles2Impl(&enter)->GetIntegerv(pname, params);
613 void GetProgramiv(PP_Resource context_id,
614 GLuint program,
615 GLenum pname,
616 GLint* params) {
617 Enter3D enter(context_id, true);
618 if (enter.succeeded()) {
619 ToGles2Impl(&enter)->GetProgramiv(program, pname, params);
623 void GetProgramInfoLog(PP_Resource context_id,
624 GLuint program,
625 GLsizei bufsize,
626 GLsizei* length,
627 char* infolog) {
628 Enter3D enter(context_id, true);
629 if (enter.succeeded()) {
630 ToGles2Impl(&enter)->GetProgramInfoLog(program, bufsize, length, infolog);
634 void GetRenderbufferParameteriv(PP_Resource context_id,
635 GLenum target,
636 GLenum pname,
637 GLint* params) {
638 Enter3D enter(context_id, true);
639 if (enter.succeeded()) {
640 ToGles2Impl(&enter)->GetRenderbufferParameteriv(target, pname, params);
644 void GetShaderiv(PP_Resource context_id,
645 GLuint shader,
646 GLenum pname,
647 GLint* params) {
648 Enter3D enter(context_id, true);
649 if (enter.succeeded()) {
650 ToGles2Impl(&enter)->GetShaderiv(shader, pname, params);
654 void GetShaderInfoLog(PP_Resource context_id,
655 GLuint shader,
656 GLsizei bufsize,
657 GLsizei* length,
658 char* infolog) {
659 Enter3D enter(context_id, true);
660 if (enter.succeeded()) {
661 ToGles2Impl(&enter)->GetShaderInfoLog(shader, bufsize, length, infolog);
665 void GetShaderPrecisionFormat(PP_Resource context_id,
666 GLenum shadertype,
667 GLenum precisiontype,
668 GLint* range,
669 GLint* precision) {
670 Enter3D enter(context_id, true);
671 if (enter.succeeded()) {
672 ToGles2Impl(&enter)
673 ->GetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
677 void GetShaderSource(PP_Resource context_id,
678 GLuint shader,
679 GLsizei bufsize,
680 GLsizei* length,
681 char* source) {
682 Enter3D enter(context_id, true);
683 if (enter.succeeded()) {
684 ToGles2Impl(&enter)->GetShaderSource(shader, bufsize, length, source);
688 const GLubyte* GetString(PP_Resource context_id, GLenum name) {
689 Enter3D enter(context_id, true);
690 if (enter.succeeded()) {
691 return ToGles2Impl(&enter)->GetString(name);
692 } else {
693 return NULL;
697 void GetTexParameterfv(PP_Resource context_id,
698 GLenum target,
699 GLenum pname,
700 GLfloat* params) {
701 Enter3D enter(context_id, true);
702 if (enter.succeeded()) {
703 ToGles2Impl(&enter)->GetTexParameterfv(target, pname, params);
707 void GetTexParameteriv(PP_Resource context_id,
708 GLenum target,
709 GLenum pname,
710 GLint* params) {
711 Enter3D enter(context_id, true);
712 if (enter.succeeded()) {
713 ToGles2Impl(&enter)->GetTexParameteriv(target, pname, params);
717 void GetUniformfv(PP_Resource context_id,
718 GLuint program,
719 GLint location,
720 GLfloat* params) {
721 Enter3D enter(context_id, true);
722 if (enter.succeeded()) {
723 ToGles2Impl(&enter)->GetUniformfv(program, location, params);
727 void GetUniformiv(PP_Resource context_id,
728 GLuint program,
729 GLint location,
730 GLint* params) {
731 Enter3D enter(context_id, true);
732 if (enter.succeeded()) {
733 ToGles2Impl(&enter)->GetUniformiv(program, location, params);
737 GLint GetUniformLocation(PP_Resource context_id,
738 GLuint program,
739 const char* name) {
740 Enter3D enter(context_id, true);
741 if (enter.succeeded()) {
742 return ToGles2Impl(&enter)->GetUniformLocation(program, name);
743 } else {
744 return -1;
748 void GetVertexAttribfv(PP_Resource context_id,
749 GLuint index,
750 GLenum pname,
751 GLfloat* params) {
752 Enter3D enter(context_id, true);
753 if (enter.succeeded()) {
754 ToGles2Impl(&enter)->GetVertexAttribfv(index, pname, params);
758 void GetVertexAttribiv(PP_Resource context_id,
759 GLuint index,
760 GLenum pname,
761 GLint* params) {
762 Enter3D enter(context_id, true);
763 if (enter.succeeded()) {
764 ToGles2Impl(&enter)->GetVertexAttribiv(index, pname, params);
768 void GetVertexAttribPointerv(PP_Resource context_id,
769 GLuint index,
770 GLenum pname,
771 void** pointer) {
772 Enter3D enter(context_id, true);
773 if (enter.succeeded()) {
774 ToGles2Impl(&enter)->GetVertexAttribPointerv(index, pname, pointer);
778 void Hint(PP_Resource context_id, GLenum target, GLenum mode) {
779 Enter3D enter(context_id, true);
780 if (enter.succeeded()) {
781 ToGles2Impl(&enter)->Hint(target, mode);
785 GLboolean IsBuffer(PP_Resource context_id, GLuint buffer) {
786 Enter3D enter(context_id, true);
787 if (enter.succeeded()) {
788 return ToGles2Impl(&enter)->IsBuffer(buffer);
789 } else {
790 return GL_FALSE;
794 GLboolean IsEnabled(PP_Resource context_id, GLenum cap) {
795 Enter3D enter(context_id, true);
796 if (enter.succeeded()) {
797 return ToGles2Impl(&enter)->IsEnabled(cap);
798 } else {
799 return GL_FALSE;
803 GLboolean IsFramebuffer(PP_Resource context_id, GLuint framebuffer) {
804 Enter3D enter(context_id, true);
805 if (enter.succeeded()) {
806 return ToGles2Impl(&enter)->IsFramebuffer(framebuffer);
807 } else {
808 return GL_FALSE;
812 GLboolean IsProgram(PP_Resource context_id, GLuint program) {
813 Enter3D enter(context_id, true);
814 if (enter.succeeded()) {
815 return ToGles2Impl(&enter)->IsProgram(program);
816 } else {
817 return GL_FALSE;
821 GLboolean IsRenderbuffer(PP_Resource context_id, GLuint renderbuffer) {
822 Enter3D enter(context_id, true);
823 if (enter.succeeded()) {
824 return ToGles2Impl(&enter)->IsRenderbuffer(renderbuffer);
825 } else {
826 return GL_FALSE;
830 GLboolean IsShader(PP_Resource context_id, GLuint shader) {
831 Enter3D enter(context_id, true);
832 if (enter.succeeded()) {
833 return ToGles2Impl(&enter)->IsShader(shader);
834 } else {
835 return GL_FALSE;
839 GLboolean IsTexture(PP_Resource context_id, GLuint texture) {
840 Enter3D enter(context_id, true);
841 if (enter.succeeded()) {
842 return ToGles2Impl(&enter)->IsTexture(texture);
843 } else {
844 return GL_FALSE;
848 void LineWidth(PP_Resource context_id, GLfloat width) {
849 Enter3D enter(context_id, true);
850 if (enter.succeeded()) {
851 ToGles2Impl(&enter)->LineWidth(width);
855 void LinkProgram(PP_Resource context_id, GLuint program) {
856 Enter3D enter(context_id, true);
857 if (enter.succeeded()) {
858 ToGles2Impl(&enter)->LinkProgram(program);
862 void PixelStorei(PP_Resource context_id, GLenum pname, GLint param) {
863 Enter3D enter(context_id, true);
864 if (enter.succeeded()) {
865 ToGles2Impl(&enter)->PixelStorei(pname, param);
869 void PolygonOffset(PP_Resource context_id, GLfloat factor, GLfloat units) {
870 Enter3D enter(context_id, true);
871 if (enter.succeeded()) {
872 ToGles2Impl(&enter)->PolygonOffset(factor, units);
876 void ReadPixels(PP_Resource context_id,
877 GLint x,
878 GLint y,
879 GLsizei width,
880 GLsizei height,
881 GLenum format,
882 GLenum type,
883 void* pixels) {
884 Enter3D enter(context_id, true);
885 if (enter.succeeded()) {
886 ToGles2Impl(&enter)->ReadPixels(x, y, width, height, format, type, pixels);
890 void ReleaseShaderCompiler(PP_Resource context_id) {
891 Enter3D enter(context_id, true);
892 if (enter.succeeded()) {
893 ToGles2Impl(&enter)->ReleaseShaderCompiler();
897 void RenderbufferStorage(PP_Resource context_id,
898 GLenum target,
899 GLenum internalformat,
900 GLsizei width,
901 GLsizei height) {
902 Enter3D enter(context_id, true);
903 if (enter.succeeded()) {
904 ToGles2Impl(&enter)
905 ->RenderbufferStorage(target, internalformat, width, height);
909 void SampleCoverage(PP_Resource context_id, GLclampf value, GLboolean invert) {
910 Enter3D enter(context_id, true);
911 if (enter.succeeded()) {
912 ToGles2Impl(&enter)->SampleCoverage(value, invert);
916 void Scissor(PP_Resource context_id,
917 GLint x,
918 GLint y,
919 GLsizei width,
920 GLsizei height) {
921 Enter3D enter(context_id, true);
922 if (enter.succeeded()) {
923 ToGles2Impl(&enter)->Scissor(x, y, width, height);
927 void ShaderBinary(PP_Resource context_id,
928 GLsizei n,
929 const GLuint* shaders,
930 GLenum binaryformat,
931 const void* binary,
932 GLsizei length) {
933 Enter3D enter(context_id, true);
934 if (enter.succeeded()) {
935 ToGles2Impl(&enter)->ShaderBinary(n, shaders, binaryformat, binary, length);
939 void ShaderSource(PP_Resource context_id,
940 GLuint shader,
941 GLsizei count,
942 const char** str,
943 const GLint* length) {
944 Enter3D enter(context_id, true);
945 if (enter.succeeded()) {
946 ToGles2Impl(&enter)->ShaderSource(shader, count, str, length);
950 void StencilFunc(PP_Resource context_id, GLenum func, GLint ref, GLuint mask) {
951 Enter3D enter(context_id, true);
952 if (enter.succeeded()) {
953 ToGles2Impl(&enter)->StencilFunc(func, ref, mask);
957 void StencilFuncSeparate(PP_Resource context_id,
958 GLenum face,
959 GLenum func,
960 GLint ref,
961 GLuint mask) {
962 Enter3D enter(context_id, true);
963 if (enter.succeeded()) {
964 ToGles2Impl(&enter)->StencilFuncSeparate(face, func, ref, mask);
968 void StencilMask(PP_Resource context_id, GLuint mask) {
969 Enter3D enter(context_id, true);
970 if (enter.succeeded()) {
971 ToGles2Impl(&enter)->StencilMask(mask);
975 void StencilMaskSeparate(PP_Resource context_id, GLenum face, GLuint mask) {
976 Enter3D enter(context_id, true);
977 if (enter.succeeded()) {
978 ToGles2Impl(&enter)->StencilMaskSeparate(face, mask);
982 void StencilOp(PP_Resource context_id,
983 GLenum fail,
984 GLenum zfail,
985 GLenum zpass) {
986 Enter3D enter(context_id, true);
987 if (enter.succeeded()) {
988 ToGles2Impl(&enter)->StencilOp(fail, zfail, zpass);
992 void StencilOpSeparate(PP_Resource context_id,
993 GLenum face,
994 GLenum fail,
995 GLenum zfail,
996 GLenum zpass) {
997 Enter3D enter(context_id, true);
998 if (enter.succeeded()) {
999 ToGles2Impl(&enter)->StencilOpSeparate(face, fail, zfail, zpass);
1003 void TexImage2D(PP_Resource context_id,
1004 GLenum target,
1005 GLint level,
1006 GLint internalformat,
1007 GLsizei width,
1008 GLsizei height,
1009 GLint border,
1010 GLenum format,
1011 GLenum type,
1012 const void* pixels) {
1013 Enter3D enter(context_id, true);
1014 if (enter.succeeded()) {
1015 ToGles2Impl(&enter)->TexImage2D(target, level, internalformat, width,
1016 height, border, format, type, pixels);
1020 void TexParameterf(PP_Resource context_id,
1021 GLenum target,
1022 GLenum pname,
1023 GLfloat param) {
1024 Enter3D enter(context_id, true);
1025 if (enter.succeeded()) {
1026 ToGles2Impl(&enter)->TexParameterf(target, pname, param);
1030 void TexParameterfv(PP_Resource context_id,
1031 GLenum target,
1032 GLenum pname,
1033 const GLfloat* params) {
1034 Enter3D enter(context_id, true);
1035 if (enter.succeeded()) {
1036 ToGles2Impl(&enter)->TexParameterfv(target, pname, params);
1040 void TexParameteri(PP_Resource context_id,
1041 GLenum target,
1042 GLenum pname,
1043 GLint param) {
1044 Enter3D enter(context_id, true);
1045 if (enter.succeeded()) {
1046 ToGles2Impl(&enter)->TexParameteri(target, pname, param);
1050 void TexParameteriv(PP_Resource context_id,
1051 GLenum target,
1052 GLenum pname,
1053 const GLint* params) {
1054 Enter3D enter(context_id, true);
1055 if (enter.succeeded()) {
1056 ToGles2Impl(&enter)->TexParameteriv(target, pname, params);
1060 void TexSubImage2D(PP_Resource context_id,
1061 GLenum target,
1062 GLint level,
1063 GLint xoffset,
1064 GLint yoffset,
1065 GLsizei width,
1066 GLsizei height,
1067 GLenum format,
1068 GLenum type,
1069 const void* pixels) {
1070 Enter3D enter(context_id, true);
1071 if (enter.succeeded()) {
1072 ToGles2Impl(&enter)->TexSubImage2D(target, level, xoffset, yoffset, width,
1073 height, format, type, pixels);
1077 void Uniform1f(PP_Resource context_id, GLint location, GLfloat x) {
1078 Enter3D enter(context_id, true);
1079 if (enter.succeeded()) {
1080 ToGles2Impl(&enter)->Uniform1f(location, x);
1084 void Uniform1fv(PP_Resource context_id,
1085 GLint location,
1086 GLsizei count,
1087 const GLfloat* v) {
1088 Enter3D enter(context_id, true);
1089 if (enter.succeeded()) {
1090 ToGles2Impl(&enter)->Uniform1fv(location, count, v);
1094 void Uniform1i(PP_Resource context_id, GLint location, GLint x) {
1095 Enter3D enter(context_id, true);
1096 if (enter.succeeded()) {
1097 ToGles2Impl(&enter)->Uniform1i(location, x);
1101 void Uniform1iv(PP_Resource context_id,
1102 GLint location,
1103 GLsizei count,
1104 const GLint* v) {
1105 Enter3D enter(context_id, true);
1106 if (enter.succeeded()) {
1107 ToGles2Impl(&enter)->Uniform1iv(location, count, v);
1111 void Uniform2f(PP_Resource context_id, GLint location, GLfloat x, GLfloat y) {
1112 Enter3D enter(context_id, true);
1113 if (enter.succeeded()) {
1114 ToGles2Impl(&enter)->Uniform2f(location, x, y);
1118 void Uniform2fv(PP_Resource context_id,
1119 GLint location,
1120 GLsizei count,
1121 const GLfloat* v) {
1122 Enter3D enter(context_id, true);
1123 if (enter.succeeded()) {
1124 ToGles2Impl(&enter)->Uniform2fv(location, count, v);
1128 void Uniform2i(PP_Resource context_id, GLint location, GLint x, GLint y) {
1129 Enter3D enter(context_id, true);
1130 if (enter.succeeded()) {
1131 ToGles2Impl(&enter)->Uniform2i(location, x, y);
1135 void Uniform2iv(PP_Resource context_id,
1136 GLint location,
1137 GLsizei count,
1138 const GLint* v) {
1139 Enter3D enter(context_id, true);
1140 if (enter.succeeded()) {
1141 ToGles2Impl(&enter)->Uniform2iv(location, count, v);
1145 void Uniform3f(PP_Resource context_id,
1146 GLint location,
1147 GLfloat x,
1148 GLfloat y,
1149 GLfloat z) {
1150 Enter3D enter(context_id, true);
1151 if (enter.succeeded()) {
1152 ToGles2Impl(&enter)->Uniform3f(location, x, y, z);
1156 void Uniform3fv(PP_Resource context_id,
1157 GLint location,
1158 GLsizei count,
1159 const GLfloat* v) {
1160 Enter3D enter(context_id, true);
1161 if (enter.succeeded()) {
1162 ToGles2Impl(&enter)->Uniform3fv(location, count, v);
1166 void Uniform3i(PP_Resource context_id,
1167 GLint location,
1168 GLint x,
1169 GLint y,
1170 GLint z) {
1171 Enter3D enter(context_id, true);
1172 if (enter.succeeded()) {
1173 ToGles2Impl(&enter)->Uniform3i(location, x, y, z);
1177 void Uniform3iv(PP_Resource context_id,
1178 GLint location,
1179 GLsizei count,
1180 const GLint* v) {
1181 Enter3D enter(context_id, true);
1182 if (enter.succeeded()) {
1183 ToGles2Impl(&enter)->Uniform3iv(location, count, v);
1187 void Uniform4f(PP_Resource context_id,
1188 GLint location,
1189 GLfloat x,
1190 GLfloat y,
1191 GLfloat z,
1192 GLfloat w) {
1193 Enter3D enter(context_id, true);
1194 if (enter.succeeded()) {
1195 ToGles2Impl(&enter)->Uniform4f(location, x, y, z, w);
1199 void Uniform4fv(PP_Resource context_id,
1200 GLint location,
1201 GLsizei count,
1202 const GLfloat* v) {
1203 Enter3D enter(context_id, true);
1204 if (enter.succeeded()) {
1205 ToGles2Impl(&enter)->Uniform4fv(location, count, v);
1209 void Uniform4i(PP_Resource context_id,
1210 GLint location,
1211 GLint x,
1212 GLint y,
1213 GLint z,
1214 GLint w) {
1215 Enter3D enter(context_id, true);
1216 if (enter.succeeded()) {
1217 ToGles2Impl(&enter)->Uniform4i(location, x, y, z, w);
1221 void Uniform4iv(PP_Resource context_id,
1222 GLint location,
1223 GLsizei count,
1224 const GLint* v) {
1225 Enter3D enter(context_id, true);
1226 if (enter.succeeded()) {
1227 ToGles2Impl(&enter)->Uniform4iv(location, count, v);
1231 void UniformMatrix2fv(PP_Resource context_id,
1232 GLint location,
1233 GLsizei count,
1234 GLboolean transpose,
1235 const GLfloat* value) {
1236 Enter3D enter(context_id, true);
1237 if (enter.succeeded()) {
1238 ToGles2Impl(&enter)->UniformMatrix2fv(location, count, transpose, value);
1242 void UniformMatrix3fv(PP_Resource context_id,
1243 GLint location,
1244 GLsizei count,
1245 GLboolean transpose,
1246 const GLfloat* value) {
1247 Enter3D enter(context_id, true);
1248 if (enter.succeeded()) {
1249 ToGles2Impl(&enter)->UniformMatrix3fv(location, count, transpose, value);
1253 void UniformMatrix4fv(PP_Resource context_id,
1254 GLint location,
1255 GLsizei count,
1256 GLboolean transpose,
1257 const GLfloat* value) {
1258 Enter3D enter(context_id, true);
1259 if (enter.succeeded()) {
1260 ToGles2Impl(&enter)->UniformMatrix4fv(location, count, transpose, value);
1264 void UseProgram(PP_Resource context_id, GLuint program) {
1265 Enter3D enter(context_id, true);
1266 if (enter.succeeded()) {
1267 ToGles2Impl(&enter)->UseProgram(program);
1271 void ValidateProgram(PP_Resource context_id, GLuint program) {
1272 Enter3D enter(context_id, true);
1273 if (enter.succeeded()) {
1274 ToGles2Impl(&enter)->ValidateProgram(program);
1278 void VertexAttrib1f(PP_Resource context_id, GLuint indx, GLfloat x) {
1279 Enter3D enter(context_id, true);
1280 if (enter.succeeded()) {
1281 ToGles2Impl(&enter)->VertexAttrib1f(indx, x);
1285 void VertexAttrib1fv(PP_Resource context_id,
1286 GLuint indx,
1287 const GLfloat* values) {
1288 Enter3D enter(context_id, true);
1289 if (enter.succeeded()) {
1290 ToGles2Impl(&enter)->VertexAttrib1fv(indx, values);
1294 void VertexAttrib2f(PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y) {
1295 Enter3D enter(context_id, true);
1296 if (enter.succeeded()) {
1297 ToGles2Impl(&enter)->VertexAttrib2f(indx, x, y);
1301 void VertexAttrib2fv(PP_Resource context_id,
1302 GLuint indx,
1303 const GLfloat* values) {
1304 Enter3D enter(context_id, true);
1305 if (enter.succeeded()) {
1306 ToGles2Impl(&enter)->VertexAttrib2fv(indx, values);
1310 void VertexAttrib3f(PP_Resource context_id,
1311 GLuint indx,
1312 GLfloat x,
1313 GLfloat y,
1314 GLfloat z) {
1315 Enter3D enter(context_id, true);
1316 if (enter.succeeded()) {
1317 ToGles2Impl(&enter)->VertexAttrib3f(indx, x, y, z);
1321 void VertexAttrib3fv(PP_Resource context_id,
1322 GLuint indx,
1323 const GLfloat* values) {
1324 Enter3D enter(context_id, true);
1325 if (enter.succeeded()) {
1326 ToGles2Impl(&enter)->VertexAttrib3fv(indx, values);
1330 void VertexAttrib4f(PP_Resource context_id,
1331 GLuint indx,
1332 GLfloat x,
1333 GLfloat y,
1334 GLfloat z,
1335 GLfloat w) {
1336 Enter3D enter(context_id, true);
1337 if (enter.succeeded()) {
1338 ToGles2Impl(&enter)->VertexAttrib4f(indx, x, y, z, w);
1342 void VertexAttrib4fv(PP_Resource context_id,
1343 GLuint indx,
1344 const GLfloat* values) {
1345 Enter3D enter(context_id, true);
1346 if (enter.succeeded()) {
1347 ToGles2Impl(&enter)->VertexAttrib4fv(indx, values);
1351 void VertexAttribPointer(PP_Resource context_id,
1352 GLuint indx,
1353 GLint size,
1354 GLenum type,
1355 GLboolean normalized,
1356 GLsizei stride,
1357 const void* ptr) {
1358 Enter3D enter(context_id, true);
1359 if (enter.succeeded()) {
1360 ToGles2Impl(&enter)
1361 ->VertexAttribPointer(indx, size, type, normalized, stride, ptr);
1365 void Viewport(PP_Resource context_id,
1366 GLint x,
1367 GLint y,
1368 GLsizei width,
1369 GLsizei height) {
1370 Enter3D enter(context_id, true);
1371 if (enter.succeeded()) {
1372 ToGles2Impl(&enter)->Viewport(x, y, width, height);
1376 void BlitFramebufferEXT(PP_Resource context_id,
1377 GLint srcX0,
1378 GLint srcY0,
1379 GLint srcX1,
1380 GLint srcY1,
1381 GLint dstX0,
1382 GLint dstY0,
1383 GLint dstX1,
1384 GLint dstY1,
1385 GLbitfield mask,
1386 GLenum filter) {
1387 Enter3D enter(context_id, true);
1388 if (enter.succeeded()) {
1389 ToGles2Impl(&enter)->BlitFramebufferCHROMIUM(
1390 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
1394 void RenderbufferStorageMultisampleEXT(PP_Resource context_id,
1395 GLenum target,
1396 GLsizei samples,
1397 GLenum internalformat,
1398 GLsizei width,
1399 GLsizei height) {
1400 Enter3D enter(context_id, true);
1401 if (enter.succeeded()) {
1402 ToGles2Impl(&enter)->RenderbufferStorageMultisampleCHROMIUM(
1403 target, samples, internalformat, width, height);
1407 void GenQueriesEXT(PP_Resource context_id, GLsizei n, GLuint* queries) {
1408 Enter3D enter(context_id, true);
1409 if (enter.succeeded()) {
1410 ToGles2Impl(&enter)->GenQueriesEXT(n, queries);
1414 void DeleteQueriesEXT(PP_Resource context_id,
1415 GLsizei n,
1416 const GLuint* queries) {
1417 Enter3D enter(context_id, true);
1418 if (enter.succeeded()) {
1419 ToGles2Impl(&enter)->DeleteQueriesEXT(n, queries);
1423 GLboolean IsQueryEXT(PP_Resource context_id, GLuint id) {
1424 Enter3D enter(context_id, true);
1425 if (enter.succeeded()) {
1426 return ToGles2Impl(&enter)->IsQueryEXT(id);
1427 } else {
1428 return GL_FALSE;
1432 void BeginQueryEXT(PP_Resource context_id, GLenum target, GLuint id) {
1433 Enter3D enter(context_id, true);
1434 if (enter.succeeded()) {
1435 ToGles2Impl(&enter)->BeginQueryEXT(target, id);
1439 void EndQueryEXT(PP_Resource context_id, GLenum target) {
1440 Enter3D enter(context_id, true);
1441 if (enter.succeeded()) {
1442 ToGles2Impl(&enter)->EndQueryEXT(target);
1446 void GetQueryivEXT(PP_Resource context_id,
1447 GLenum target,
1448 GLenum pname,
1449 GLint* params) {
1450 Enter3D enter(context_id, true);
1451 if (enter.succeeded()) {
1452 ToGles2Impl(&enter)->GetQueryivEXT(target, pname, params);
1456 void GetQueryObjectuivEXT(PP_Resource context_id,
1457 GLuint id,
1458 GLenum pname,
1459 GLuint* params) {
1460 Enter3D enter(context_id, true);
1461 if (enter.succeeded()) {
1462 ToGles2Impl(&enter)->GetQueryObjectuivEXT(id, pname, params);
1466 void GenVertexArraysOES(PP_Resource context_id, GLsizei n, GLuint* arrays) {
1467 Enter3D enter(context_id, true);
1468 if (enter.succeeded()) {
1469 ToGles2Impl(&enter)->GenVertexArraysOES(n, arrays);
1473 void DeleteVertexArraysOES(PP_Resource context_id,
1474 GLsizei n,
1475 const GLuint* arrays) {
1476 Enter3D enter(context_id, true);
1477 if (enter.succeeded()) {
1478 ToGles2Impl(&enter)->DeleteVertexArraysOES(n, arrays);
1482 GLboolean IsVertexArrayOES(PP_Resource context_id, GLuint array) {
1483 Enter3D enter(context_id, true);
1484 if (enter.succeeded()) {
1485 return ToGles2Impl(&enter)->IsVertexArrayOES(array);
1486 } else {
1487 return GL_FALSE;
1491 void BindVertexArrayOES(PP_Resource context_id, GLuint array) {
1492 Enter3D enter(context_id, true);
1493 if (enter.succeeded()) {
1494 ToGles2Impl(&enter)->BindVertexArrayOES(array);
1498 GLboolean EnableFeatureCHROMIUM(PP_Resource context_id, const char* feature) {
1499 Enter3D enter(context_id, true);
1500 if (enter.succeeded()) {
1501 return ToGles2Impl(&enter)->EnableFeatureCHROMIUM(feature);
1502 } else {
1503 return GL_FALSE;
1507 void* MapBufferSubDataCHROMIUM(PP_Resource context_id,
1508 GLuint target,
1509 GLintptr offset,
1510 GLsizeiptr size,
1511 GLenum access) {
1512 Enter3D enter(context_id, true);
1513 if (enter.succeeded()) {
1514 return ToGles2Impl(&enter)
1515 ->MapBufferSubDataCHROMIUM(target, offset, size, access);
1516 } else {
1517 return NULL;
1521 void UnmapBufferSubDataCHROMIUM(PP_Resource context_id, const void* mem) {
1522 Enter3D enter(context_id, true);
1523 if (enter.succeeded()) {
1524 ToGles2Impl(&enter)->UnmapBufferSubDataCHROMIUM(mem);
1528 void* MapTexSubImage2DCHROMIUM(PP_Resource context_id,
1529 GLenum target,
1530 GLint level,
1531 GLint xoffset,
1532 GLint yoffset,
1533 GLsizei width,
1534 GLsizei height,
1535 GLenum format,
1536 GLenum type,
1537 GLenum access) {
1538 Enter3D enter(context_id, true);
1539 if (enter.succeeded()) {
1540 return ToGles2Impl(&enter)->MapTexSubImage2DCHROMIUM(
1541 target, level, xoffset, yoffset, width, height, format, type, access);
1542 } else {
1543 return NULL;
1547 void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id, const void* mem) {
1548 Enter3D enter(context_id, true);
1549 if (enter.succeeded()) {
1550 ToGles2Impl(&enter)->UnmapTexSubImage2DCHROMIUM(mem);
1554 void DrawArraysInstancedANGLE(PP_Resource context_id,
1555 GLenum mode,
1556 GLint first,
1557 GLsizei count,
1558 GLsizei primcount) {
1559 Enter3D enter(context_id, true);
1560 if (enter.succeeded()) {
1561 ToGles2Impl(&enter)
1562 ->DrawArraysInstancedANGLE(mode, first, count, primcount);
1566 void DrawElementsInstancedANGLE(PP_Resource context_id,
1567 GLenum mode,
1568 GLsizei count,
1569 GLenum type,
1570 const void* indices,
1571 GLsizei primcount) {
1572 Enter3D enter(context_id, true);
1573 if (enter.succeeded()) {
1574 ToGles2Impl(&enter)
1575 ->DrawElementsInstancedANGLE(mode, count, type, indices, primcount);
1579 void VertexAttribDivisorANGLE(PP_Resource context_id,
1580 GLuint index,
1581 GLuint divisor) {
1582 Enter3D enter(context_id, true);
1583 if (enter.succeeded()) {
1584 ToGles2Impl(&enter)->VertexAttribDivisorANGLE(index, divisor);
1588 void DrawBuffersEXT(PP_Resource context_id, GLsizei count, const GLenum* bufs) {
1589 Enter3D enter(context_id, true);
1590 if (enter.succeeded()) {
1591 ToGles2Impl(&enter)->DrawBuffersEXT(count, bufs);
1595 } // namespace
1596 const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
1597 static const struct PPB_OpenGLES2 ppb_opengles2 = {
1598 &ActiveTexture,
1599 &AttachShader,
1600 &BindAttribLocation,
1601 &BindBuffer,
1602 &BindFramebuffer,
1603 &BindRenderbuffer,
1604 &BindTexture,
1605 &BlendColor,
1606 &BlendEquation,
1607 &BlendEquationSeparate,
1608 &BlendFunc,
1609 &BlendFuncSeparate,
1610 &BufferData,
1611 &BufferSubData,
1612 &CheckFramebufferStatus,
1613 &Clear,
1614 &ClearColor,
1615 &ClearDepthf,
1616 &ClearStencil,
1617 &ColorMask,
1618 &CompileShader,
1619 &CompressedTexImage2D,
1620 &CompressedTexSubImage2D,
1621 &CopyTexImage2D,
1622 &CopyTexSubImage2D,
1623 &CreateProgram,
1624 &CreateShader,
1625 &CullFace,
1626 &DeleteBuffers,
1627 &DeleteFramebuffers,
1628 &DeleteProgram,
1629 &DeleteRenderbuffers,
1630 &DeleteShader,
1631 &DeleteTextures,
1632 &DepthFunc,
1633 &DepthMask,
1634 &DepthRangef,
1635 &DetachShader,
1636 &Disable,
1637 &DisableVertexAttribArray,
1638 &DrawArrays,
1639 &DrawElements,
1640 &Enable,
1641 &EnableVertexAttribArray,
1642 &Finish,
1643 &Flush,
1644 &FramebufferRenderbuffer,
1645 &FramebufferTexture2D,
1646 &FrontFace,
1647 &GenBuffers,
1648 &GenerateMipmap,
1649 &GenFramebuffers,
1650 &GenRenderbuffers,
1651 &GenTextures,
1652 &GetActiveAttrib,
1653 &GetActiveUniform,
1654 &GetAttachedShaders,
1655 &GetAttribLocation,
1656 &GetBooleanv,
1657 &GetBufferParameteriv,
1658 &GetError,
1659 &GetFloatv,
1660 &GetFramebufferAttachmentParameteriv,
1661 &GetIntegerv,
1662 &GetProgramiv,
1663 &GetProgramInfoLog,
1664 &GetRenderbufferParameteriv,
1665 &GetShaderiv,
1666 &GetShaderInfoLog,
1667 &GetShaderPrecisionFormat,
1668 &GetShaderSource,
1669 &GetString,
1670 &GetTexParameterfv,
1671 &GetTexParameteriv,
1672 &GetUniformfv,
1673 &GetUniformiv,
1674 &GetUniformLocation,
1675 &GetVertexAttribfv,
1676 &GetVertexAttribiv,
1677 &GetVertexAttribPointerv,
1678 &Hint,
1679 &IsBuffer,
1680 &IsEnabled,
1681 &IsFramebuffer,
1682 &IsProgram,
1683 &IsRenderbuffer,
1684 &IsShader,
1685 &IsTexture,
1686 &LineWidth,
1687 &LinkProgram,
1688 &PixelStorei,
1689 &PolygonOffset,
1690 &ReadPixels,
1691 &ReleaseShaderCompiler,
1692 &RenderbufferStorage,
1693 &SampleCoverage,
1694 &Scissor,
1695 &ShaderBinary,
1696 &ShaderSource,
1697 &StencilFunc,
1698 &StencilFuncSeparate,
1699 &StencilMask,
1700 &StencilMaskSeparate,
1701 &StencilOp,
1702 &StencilOpSeparate,
1703 &TexImage2D,
1704 &TexParameterf,
1705 &TexParameterfv,
1706 &TexParameteri,
1707 &TexParameteriv,
1708 &TexSubImage2D,
1709 &Uniform1f,
1710 &Uniform1fv,
1711 &Uniform1i,
1712 &Uniform1iv,
1713 &Uniform2f,
1714 &Uniform2fv,
1715 &Uniform2i,
1716 &Uniform2iv,
1717 &Uniform3f,
1718 &Uniform3fv,
1719 &Uniform3i,
1720 &Uniform3iv,
1721 &Uniform4f,
1722 &Uniform4fv,
1723 &Uniform4i,
1724 &Uniform4iv,
1725 &UniformMatrix2fv,
1726 &UniformMatrix3fv,
1727 &UniformMatrix4fv,
1728 &UseProgram,
1729 &ValidateProgram,
1730 &VertexAttrib1f,
1731 &VertexAttrib1fv,
1732 &VertexAttrib2f,
1733 &VertexAttrib2fv,
1734 &VertexAttrib3f,
1735 &VertexAttrib3fv,
1736 &VertexAttrib4f,
1737 &VertexAttrib4fv,
1738 &VertexAttribPointer,
1739 &Viewport};
1740 return &ppb_opengles2;
1742 const PPB_OpenGLES2InstancedArrays*
1743 PPB_OpenGLES2_Shared::GetInstancedArraysInterface() {
1744 static const struct PPB_OpenGLES2InstancedArrays ppb_opengles2 = {
1745 &DrawArraysInstancedANGLE,
1746 &DrawElementsInstancedANGLE,
1747 &VertexAttribDivisorANGLE};
1748 return &ppb_opengles2;
1750 const PPB_OpenGLES2FramebufferBlit*
1751 PPB_OpenGLES2_Shared::GetFramebufferBlitInterface() {
1752 static const struct PPB_OpenGLES2FramebufferBlit ppb_opengles2 = {
1753 &BlitFramebufferEXT};
1754 return &ppb_opengles2;
1756 const PPB_OpenGLES2FramebufferMultisample*
1757 PPB_OpenGLES2_Shared::GetFramebufferMultisampleInterface() {
1758 static const struct PPB_OpenGLES2FramebufferMultisample ppb_opengles2 = {
1759 &RenderbufferStorageMultisampleEXT};
1760 return &ppb_opengles2;
1762 const PPB_OpenGLES2ChromiumEnableFeature*
1763 PPB_OpenGLES2_Shared::GetChromiumEnableFeatureInterface() {
1764 static const struct PPB_OpenGLES2ChromiumEnableFeature ppb_opengles2 = {
1765 &EnableFeatureCHROMIUM};
1766 return &ppb_opengles2;
1768 const PPB_OpenGLES2ChromiumMapSub*
1769 PPB_OpenGLES2_Shared::GetChromiumMapSubInterface() {
1770 static const struct PPB_OpenGLES2ChromiumMapSub ppb_opengles2 = {
1771 &MapBufferSubDataCHROMIUM,
1772 &UnmapBufferSubDataCHROMIUM,
1773 &MapTexSubImage2DCHROMIUM,
1774 &UnmapTexSubImage2DCHROMIUM};
1775 return &ppb_opengles2;
1777 const PPB_OpenGLES2Query* PPB_OpenGLES2_Shared::GetQueryInterface() {
1778 static const struct PPB_OpenGLES2Query ppb_opengles2 = {
1779 &GenQueriesEXT,
1780 &DeleteQueriesEXT,
1781 &IsQueryEXT,
1782 &BeginQueryEXT,
1783 &EndQueryEXT,
1784 &GetQueryivEXT,
1785 &GetQueryObjectuivEXT};
1786 return &ppb_opengles2;
1788 const PPB_OpenGLES2VertexArrayObject*
1789 PPB_OpenGLES2_Shared::GetVertexArrayObjectInterface() {
1790 static const struct PPB_OpenGLES2VertexArrayObject ppb_opengles2 = {
1791 &GenVertexArraysOES,
1792 &DeleteVertexArraysOES,
1793 &IsVertexArrayOES,
1794 &BindVertexArrayOES};
1795 return &ppb_opengles2;
1797 const PPB_OpenGLES2DrawBuffers_Dev*
1798 PPB_OpenGLES2_Shared::GetDrawBuffersInterface() {
1799 static const struct PPB_OpenGLES2DrawBuffers_Dev ppb_opengles2 = {
1800 &DrawBuffersEXT};
1801 return &ppb_opengles2;
1803 } // namespace ppapi