summaryrefslogtreecommitdiffstats
path: root/ppapi/lib/gl/gles2/gles2.c
blob: 430a2cfd19d418a90e9531493c96de7dd4e7e28b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is auto-generated from
// gpu/command_buffer/build_gles2_cmd_buffer.py
// DO NOT EDIT!

#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#endif
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include "ppapi/lib/gl/gles2/gl2ext_ppapi.h"

void GL_APIENTRY glActiveTexture(GLenum texture) {
  glGetInterfacePPAPI()->ActiveTexture(glGetCurrentContextPPAPI(), texture);
}

void GL_APIENTRY glAttachShader(GLuint program, GLuint shader) {
  glGetInterfacePPAPI()->AttachShader(
      glGetCurrentContextPPAPI(), program, shader);
}

void GL_APIENTRY glBindAttribLocation(
    GLuint program, GLuint index, const char* name) {
  glGetInterfacePPAPI()->BindAttribLocation(
      glGetCurrentContextPPAPI(), program, index, name);
}

void GL_APIENTRY glBindBuffer(GLenum target, GLuint buffer) {
  glGetInterfacePPAPI()->BindBuffer(
      glGetCurrentContextPPAPI(), target, buffer);
}

void GL_APIENTRY glBindFramebuffer(GLenum target, GLuint framebuffer) {
  glGetInterfacePPAPI()->BindFramebuffer(
      glGetCurrentContextPPAPI(), target, framebuffer);
}

void GL_APIENTRY glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
  glGetInterfacePPAPI()->BindRenderbuffer(
      glGetCurrentContextPPAPI(), target, renderbuffer);
}

void GL_APIENTRY glBindTexture(GLenum target, GLuint texture) {
  glGetInterfacePPAPI()->BindTexture(
      glGetCurrentContextPPAPI(), target, texture);
}

void GL_APIENTRY glBlendColor(
    GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
  glGetInterfacePPAPI()->BlendColor(
      glGetCurrentContextPPAPI(), red, green, blue, alpha);
}

void GL_APIENTRY glBlendEquation(GLenum mode) {
  glGetInterfacePPAPI()->BlendEquation(glGetCurrentContextPPAPI(), mode);
}

void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
  glGetInterfacePPAPI()->BlendEquationSeparate(
      glGetCurrentContextPPAPI(), modeRGB, modeAlpha);
}

void GL_APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor) {
  glGetInterfacePPAPI()->BlendFunc(
      glGetCurrentContextPPAPI(), sfactor, dfactor);
}

void GL_APIENTRY glBlendFuncSeparate(
    GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
  glGetInterfacePPAPI()->BlendFuncSeparate(
      glGetCurrentContextPPAPI(), srcRGB, dstRGB, srcAlpha, dstAlpha);
}

void GL_APIENTRY glBufferData(
    GLenum target, GLsizeiptr size, const void* data, GLenum usage) {
  glGetInterfacePPAPI()->BufferData(
      glGetCurrentContextPPAPI(), target, size, data, usage);
}

void GL_APIENTRY glBufferSubData(
    GLenum target, GLintptr offset, GLsizeiptr size, const void* data) {
  glGetInterfacePPAPI()->BufferSubData(
      glGetCurrentContextPPAPI(), target, offset, size, data);
}

GLenum GL_APIENTRY glCheckFramebufferStatus(GLenum target) {
  return glGetInterfacePPAPI()->CheckFramebufferStatus(
      glGetCurrentContextPPAPI(), target);
}

void GL_APIENTRY glClear(GLbitfield mask) {
  glGetInterfacePPAPI()->Clear(glGetCurrentContextPPAPI(), mask);
}

void GL_APIENTRY glClearColor(
    GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
  glGetInterfacePPAPI()->ClearColor(
      glGetCurrentContextPPAPI(), red, green, blue, alpha);
}

void GL_APIENTRY glClearDepthf(GLclampf depth) {
  glGetInterfacePPAPI()->ClearDepthf(glGetCurrentContextPPAPI(), depth);
}

void GL_APIENTRY glClearStencil(GLint s) {
  glGetInterfacePPAPI()->ClearStencil(glGetCurrentContextPPAPI(), s);
}

void GL_APIENTRY glColorMask(
    GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
  glGetInterfacePPAPI()->ColorMask(
      glGetCurrentContextPPAPI(), red, green, blue, alpha);
}

void GL_APIENTRY glCompileShader(GLuint shader) {
  glGetInterfacePPAPI()->CompileShader(glGetCurrentContextPPAPI(), shader);
}

void GL_APIENTRY glCompressedTexImage2D(
    GLenum target, GLint level, GLenum internalformat, GLsizei width,
    GLsizei height, GLint border, GLsizei imageSize, const void* data) {
  glGetInterfacePPAPI()->CompressedTexImage2D(
      glGetCurrentContextPPAPI(), target, level, internalformat, width, height,
      border, imageSize, data);
}

void GL_APIENTRY glCompressedTexSubImage2D(
    GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
    GLsizei height, GLenum format, GLsizei imageSize, const void* data) {
  glGetInterfacePPAPI()->CompressedTexSubImage2D(
      glGetCurrentContextPPAPI(), target, level, xoffset, yoffset, width,
      height, format, imageSize, data);
}

void GL_APIENTRY glCopyTexImage2D(
    GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
    GLsizei width, GLsizei height, GLint border) {
  glGetInterfacePPAPI()->CopyTexImage2D(
      glGetCurrentContextPPAPI(), target, level, internalformat, x, y, width,
      height, border);
}

void GL_APIENTRY glCopyTexSubImage2D(
    GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y,
    GLsizei width, GLsizei height) {
  glGetInterfacePPAPI()->CopyTexSubImage2D(
      glGetCurrentContextPPAPI(), target, level, xoffset, yoffset, x, y, width,
      height);
}

GLuint GL_APIENTRY glCreateProgram() {
  return glGetInterfacePPAPI()->CreateProgram(glGetCurrentContextPPAPI());
}

GLuint GL_APIENTRY glCreateShader(GLenum type) {
  return glGetInterfacePPAPI()->CreateShader(glGetCurrentContextPPAPI(), type);
}

void GL_APIENTRY glCullFace(GLenum mode) {
  glGetInterfacePPAPI()->CullFace(glGetCurrentContextPPAPI(), mode);
}

void GL_APIENTRY glDeleteBuffers(GLsizei n, const GLuint* buffers) {
  glGetInterfacePPAPI()->DeleteBuffers(glGetCurrentContextPPAPI(), n, buffers);
}

void GL_APIENTRY glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) {
  glGetInterfacePPAPI()->DeleteFramebuffers(
      glGetCurrentContextPPAPI(), n, framebuffers);
}

void GL_APIENTRY glDeleteProgram(GLuint program) {
  glGetInterfacePPAPI()->DeleteProgram(glGetCurrentContextPPAPI(), program);
}

void GL_APIENTRY glDeleteRenderbuffers(
    GLsizei n, const GLuint* renderbuffers) {
  glGetInterfacePPAPI()->DeleteRenderbuffers(
      glGetCurrentContextPPAPI(), n, renderbuffers);
}

void GL_APIENTRY glDeleteShader(GLuint shader) {
  glGetInterfacePPAPI()->DeleteShader(glGetCurrentContextPPAPI(), shader);
}

void GL_APIENTRY glDeleteTextures(GLsizei n, const GLuint* textures) {
  glGetInterfacePPAPI()->DeleteTextures(
      glGetCurrentContextPPAPI(), n, textures);
}

void GL_APIENTRY glDepthFunc(GLenum func) {
  glGetInterfacePPAPI()->DepthFunc(glGetCurrentContextPPAPI(), func);
}

void GL_APIENTRY glDepthMask(GLboolean flag) {
  glGetInterfacePPAPI()->DepthMask(glGetCurrentContextPPAPI(), flag);
}

void GL_APIENTRY glDepthRangef(GLclampf zNear, GLclampf zFar) {
  glGetInterfacePPAPI()->DepthRangef(glGetCurrentContextPPAPI(), zNear, zFar);
}

void GL_APIENTRY glDetachShader(GLuint program, GLuint shader) {
  glGetInterfacePPAPI()->DetachShader(
      glGetCurrentContextPPAPI(), program, shader);
}

void GL_APIENTRY glDisable(GLenum cap) {
  glGetInterfacePPAPI()->Disable(glGetCurrentContextPPAPI(), cap);
}

void GL_APIENTRY glDisableVertexAttribArray(GLuint index) {
  glGetInterfacePPAPI()->DisableVertexAttribArray(
      glGetCurrentContextPPAPI(), index);
}

void GL_APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count) {
  glGetInterfacePPAPI()->DrawArrays(
      glGetCurrentContextPPAPI(), mode, first, count);
}

void GL_APIENTRY glDrawElements(
    GLenum mode, GLsizei count, GLenum type, const void* indices) {
  glGetInterfacePPAPI()->DrawElements(
      glGetCurrentContextPPAPI(), mode, count, type, indices);
}

void GL_APIENTRY glEnable(GLenum cap) {
  glGetInterfacePPAPI()->Enable(glGetCurrentContextPPAPI(), cap);
}

void GL_APIENTRY glEnableVertexAttribArray(GLuint index) {
  glGetInterfacePPAPI()->EnableVertexAttribArray(
      glGetCurrentContextPPAPI(), index);
}

void GL_APIENTRY glFinish() {
  glGetInterfacePPAPI()->Finish(glGetCurrentContextPPAPI());
}

void GL_APIENTRY glFlush() {
  glGetInterfacePPAPI()->Flush(glGetCurrentContextPPAPI());
}

void GL_APIENTRY glFramebufferRenderbuffer(
    GLenum target, GLenum attachment, GLenum renderbuffertarget,
    GLuint renderbuffer) {
  glGetInterfacePPAPI()->FramebufferRenderbuffer(
      glGetCurrentContextPPAPI(), target, attachment, renderbuffertarget,
      renderbuffer);
}

void GL_APIENTRY glFramebufferTexture2D(
    GLenum target, GLenum attachment, GLenum textarget, GLuint texture,
    GLint level) {
  glGetInterfacePPAPI()->FramebufferTexture2D(
      glGetCurrentContextPPAPI(), target, attachment, textarget, texture,
      level);
}

void GL_APIENTRY glFrontFace(GLenum mode) {
  glGetInterfacePPAPI()->FrontFace(glGetCurrentContextPPAPI(), mode);
}

void GL_APIENTRY glGenBuffers(GLsizei n, GLuint* buffers) {
  glGetInterfacePPAPI()->GenBuffers(glGetCurrentContextPPAPI(), n, buffers);
}

void GL_APIENTRY glGenerateMipmap(GLenum target) {
  glGetInterfacePPAPI()->GenerateMipmap(glGetCurrentContextPPAPI(), target);
}

void GL_APIENTRY glGenFramebuffers(GLsizei n, GLuint* framebuffers) {
  glGetInterfacePPAPI()->GenFramebuffers(
      glGetCurrentContextPPAPI(), n, framebuffers);
}

void GL_APIENTRY glGenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
  glGetInterfacePPAPI()->GenRenderbuffers(
      glGetCurrentContextPPAPI(), n, renderbuffers);
}

void GL_APIENTRY glGenTextures(GLsizei n, GLuint* textures) {
  glGetInterfacePPAPI()->GenTextures(glGetCurrentContextPPAPI(), n, textures);
}

void GL_APIENTRY glGetActiveAttrib(
    GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
    GLenum* type, char* name) {
  glGetInterfacePPAPI()->GetActiveAttrib(
      glGetCurrentContextPPAPI(), program, index, bufsize, length, size, type,
      name);
}

void GL_APIENTRY glGetActiveUniform(
    GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
    GLenum* type, char* name) {
  glGetInterfacePPAPI()->GetActiveUniform(
      glGetCurrentContextPPAPI(), program, index, bufsize, length, size, type,
      name);
}

void GL_APIENTRY glGetAttachedShaders(
    GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
  glGetInterfacePPAPI()->GetAttachedShaders(
      glGetCurrentContextPPAPI(), program, maxcount, count, shaders);
}

GLint GL_APIENTRY glGetAttribLocation(GLuint program, const char* name) {
  return glGetInterfacePPAPI()->GetAttribLocation(
      glGetCurrentContextPPAPI(), program, name);
}

void GL_APIENTRY glGetBooleanv(GLenum pname, GLboolean* params) {
  glGetInterfacePPAPI()->GetBooleanv(
      glGetCurrentContextPPAPI(), pname, params);
}

void GL_APIENTRY glGetBufferParameteriv(
    GLenum target, GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetBufferParameteriv(
      glGetCurrentContextPPAPI(), target, pname, params);
}

GLenum GL_APIENTRY glGetError() {
  return glGetInterfacePPAPI()->GetError(glGetCurrentContextPPAPI());
}

void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat* params) {
  glGetInterfacePPAPI()->GetFloatv(glGetCurrentContextPPAPI(), pname, params);
}

void GL_APIENTRY glGetFramebufferAttachmentParameteriv(
    GLenum target, GLenum attachment, GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetFramebufferAttachmentParameteriv(
      glGetCurrentContextPPAPI(), target, attachment, pname, params);
}

void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetIntegerv(
      glGetCurrentContextPPAPI(), pname, params);
}

void GL_APIENTRY glGetProgramiv(GLuint program, GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetProgramiv(
      glGetCurrentContextPPAPI(), program, pname, params);
}

void GL_APIENTRY glGetProgramInfoLog(
    GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) {
  glGetInterfacePPAPI()->GetProgramInfoLog(
      glGetCurrentContextPPAPI(), program, bufsize, length, infolog);
}

void GL_APIENTRY glGetRenderbufferParameteriv(
    GLenum target, GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetRenderbufferParameteriv(
      glGetCurrentContextPPAPI(), target, pname, params);
}

void GL_APIENTRY glGetShaderiv(GLuint shader, GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetShaderiv(
      glGetCurrentContextPPAPI(), shader, pname, params);
}

void GL_APIENTRY glGetShaderInfoLog(
    GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) {
  glGetInterfacePPAPI()->GetShaderInfoLog(
      glGetCurrentContextPPAPI(), shader, bufsize, length, infolog);
}

void GL_APIENTRY glGetShaderPrecisionFormat(
    GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
  glGetInterfacePPAPI()->GetShaderPrecisionFormat(
      glGetCurrentContextPPAPI(), shadertype, precisiontype, range, precision);
}

void GL_APIENTRY glGetShaderSource(
    GLuint shader, GLsizei bufsize, GLsizei* length, char* source) {
  glGetInterfacePPAPI()->GetShaderSource(
      glGetCurrentContextPPAPI(), shader, bufsize, length, source);
}

const GLubyte* GL_APIENTRY glGetString(GLenum name) {
  return glGetInterfacePPAPI()->GetString(glGetCurrentContextPPAPI(), name);
}

void GL_APIENTRY glGetTexParameterfv(
    GLenum target, GLenum pname, GLfloat* params) {
  glGetInterfacePPAPI()->GetTexParameterfv(
      glGetCurrentContextPPAPI(), target, pname, params);
}

void GL_APIENTRY glGetTexParameteriv(
    GLenum target, GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetTexParameteriv(
      glGetCurrentContextPPAPI(), target, pname, params);
}

void GL_APIENTRY glGetUniformfv(
    GLuint program, GLint location, GLfloat* params) {
  glGetInterfacePPAPI()->GetUniformfv(
      glGetCurrentContextPPAPI(), program, location, params);
}

void GL_APIENTRY glGetUniformiv(
    GLuint program, GLint location, GLint* params) {
  glGetInterfacePPAPI()->GetUniformiv(
      glGetCurrentContextPPAPI(), program, location, params);
}

GLint GL_APIENTRY glGetUniformLocation(GLuint program, const char* name) {
  return glGetInterfacePPAPI()->GetUniformLocation(
      glGetCurrentContextPPAPI(), program, name);
}

void GL_APIENTRY glGetVertexAttribfv(
    GLuint index, GLenum pname, GLfloat* params) {
  glGetInterfacePPAPI()->GetVertexAttribfv(
      glGetCurrentContextPPAPI(), index, pname, params);
}

void GL_APIENTRY glGetVertexAttribiv(
    GLuint index, GLenum pname, GLint* params) {
  glGetInterfacePPAPI()->GetVertexAttribiv(
      glGetCurrentContextPPAPI(), index, pname, params);
}

void GL_APIENTRY glGetVertexAttribPointerv(
    GLuint index, GLenum pname, void** pointer) {
  glGetInterfacePPAPI()->GetVertexAttribPointerv(
      glGetCurrentContextPPAPI(), index, pname, pointer);
}

void GL_APIENTRY glHint(GLenum target, GLenum mode) {
  glGetInterfacePPAPI()->Hint(glGetCurrentContextPPAPI(), target, mode);
}

GLboolean GL_APIENTRY glIsBuffer(GLuint buffer) {
  return glGetInterfacePPAPI()->IsBuffer(glGetCurrentContextPPAPI(), buffer);
}

GLboolean GL_APIENTRY glIsEnabled(GLenum cap) {
  return glGetInterfacePPAPI()->IsEnabled(glGetCurrentContextPPAPI(), cap);
}

GLboolean GL_APIENTRY glIsFramebuffer(GLuint framebuffer) {
  return glGetInterfacePPAPI()->IsFramebuffer(
      glGetCurrentContextPPAPI(), framebuffer);
}

GLboolean GL_APIENTRY glIsProgram(GLuint program) {
  return glGetInterfacePPAPI()->IsProgram(glGetCurrentContextPPAPI(), program);
}

GLboolean GL_APIENTRY glIsRenderbuffer(GLuint renderbuffer) {
  return glGetInterfacePPAPI()->IsRenderbuffer(
      glGetCurrentContextPPAPI(), renderbuffer);
}

GLboolean GL_APIENTRY glIsShader(GLuint shader) {
  return glGetInterfacePPAPI()->IsShader(glGetCurrentContextPPAPI(), shader);
}

GLboolean GL_APIENTRY glIsTexture(GLuint texture) {
  return glGetInterfacePPAPI()->IsTexture(glGetCurrentContextPPAPI(), texture);
}

void GL_APIENTRY glLineWidth(GLfloat width) {
  glGetInterfacePPAPI()->LineWidth(glGetCurrentContextPPAPI(), width);
}

void GL_APIENTRY glLinkProgram(GLuint program) {
  glGetInterfacePPAPI()->LinkProgram(glGetCurrentContextPPAPI(), program);
}

void GL_APIENTRY glPixelStorei(GLenum pname, GLint param) {
  glGetInterfacePPAPI()->PixelStorei(glGetCurrentContextPPAPI(), pname, param);
}

void GL_APIENTRY glPolygonOffset(GLfloat factor, GLfloat units) {
  glGetInterfacePPAPI()->PolygonOffset(
      glGetCurrentContextPPAPI(), factor, units);
}

void GL_APIENTRY glReadPixels(
    GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
    void* pixels) {
  glGetInterfacePPAPI()->ReadPixels(
      glGetCurrentContextPPAPI(), x, y, width, height, format, type, pixels);
}

void GL_APIENTRY glReleaseShaderCompiler() {
  glGetInterfacePPAPI()->ReleaseShaderCompiler(glGetCurrentContextPPAPI());
}

void GL_APIENTRY glRenderbufferStorage(
    GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
  glGetInterfacePPAPI()->RenderbufferStorage(
      glGetCurrentContextPPAPI(), target, internalformat, width, height);
}

void GL_APIENTRY glSampleCoverage(GLclampf value, GLboolean invert) {
  glGetInterfacePPAPI()->SampleCoverage(
      glGetCurrentContextPPAPI(), value, invert);
}

void GL_APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
  glGetInterfacePPAPI()->Scissor(
      glGetCurrentContextPPAPI(), x, y, width, height);
}

void GL_APIENTRY glShaderBinary(
    GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary,
    GLsizei length) {
  glGetInterfacePPAPI()->ShaderBinary(
      glGetCurrentContextPPAPI(), n, shaders, binaryformat, binary, length);
}

void GL_APIENTRY glShaderSource(
    GLuint shader, GLsizei count, const char** str, const GLint* length) {
  glGetInterfacePPAPI()->ShaderSource(
      glGetCurrentContextPPAPI(), shader, count, str, length);
}

void GL_APIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask) {
  glGetInterfacePPAPI()->StencilFunc(
      glGetCurrentContextPPAPI(), func, ref, mask);
}

void GL_APIENTRY glStencilFuncSeparate(
    GLenum face, GLenum func, GLint ref, GLuint mask) {
  glGetInterfacePPAPI()->StencilFuncSeparate(
      glGetCurrentContextPPAPI(), face, func, ref, mask);
}

void GL_APIENTRY glStencilMask(GLuint mask) {
  glGetInterfacePPAPI()->StencilMask(glGetCurrentContextPPAPI(), mask);
}

void GL_APIENTRY glStencilMaskSeparate(GLenum face, GLuint mask) {
  glGetInterfacePPAPI()->StencilMaskSeparate(
      glGetCurrentContextPPAPI(), face, mask);
}

void GL_APIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
  glGetInterfacePPAPI()->StencilOp(
      glGetCurrentContextPPAPI(), fail, zfail, zpass);
}

void GL_APIENTRY glStencilOpSeparate(
    GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
  glGetInterfacePPAPI()->StencilOpSeparate(
      glGetCurrentContextPPAPI(), face, fail, zfail, zpass);
}

void GL_APIENTRY glTexImage2D(
    GLenum target, GLint level, GLint internalformat, GLsizei width,
    GLsizei height, GLint border, GLenum format, GLenum type,
    const void* pixels) {
  glGetInterfacePPAPI()->TexImage2D(
      glGetCurrentContextPPAPI(), target, level, internalformat, width, height,
      border, format, type, pixels);
}

void GL_APIENTRY glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
  glGetInterfacePPAPI()->TexParameterf(
      glGetCurrentContextPPAPI(), target, pname, param);
}

void GL_APIENTRY glTexParameterfv(
    GLenum target, GLenum pname, const GLfloat* params) {
  glGetInterfacePPAPI()->TexParameterfv(
      glGetCurrentContextPPAPI(), target, pname, params);
}

void GL_APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) {
  glGetInterfacePPAPI()->TexParameteri(
      glGetCurrentContextPPAPI(), target, pname, param);
}

void GL_APIENTRY glTexParameteriv(
    GLenum target, GLenum pname, const GLint* params) {
  glGetInterfacePPAPI()->TexParameteriv(
      glGetCurrentContextPPAPI(), target, pname, params);
}

void GL_APIENTRY glTexSubImage2D(
    GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
    GLsizei height, GLenum format, GLenum type, const void* pixels) {
  glGetInterfacePPAPI()->TexSubImage2D(
      glGetCurrentContextPPAPI(), target, level, xoffset, yoffset, width,
      height, format, type, pixels);
}

void GL_APIENTRY glUniform1f(GLint location, GLfloat x) {
  glGetInterfacePPAPI()->Uniform1f(glGetCurrentContextPPAPI(), location, x);
}

void GL_APIENTRY glUniform1fv(
    GLint location, GLsizei count, const GLfloat* v) {
  glGetInterfacePPAPI()->Uniform1fv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniform1i(GLint location, GLint x) {
  glGetInterfacePPAPI()->Uniform1i(glGetCurrentContextPPAPI(), location, x);
}

void GL_APIENTRY glUniform1iv(GLint location, GLsizei count, const GLint* v) {
  glGetInterfacePPAPI()->Uniform1iv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniform2f(GLint location, GLfloat x, GLfloat y) {
  glGetInterfacePPAPI()->Uniform2f(glGetCurrentContextPPAPI(), location, x, y);
}

void GL_APIENTRY glUniform2fv(
    GLint location, GLsizei count, const GLfloat* v) {
  glGetInterfacePPAPI()->Uniform2fv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniform2i(GLint location, GLint x, GLint y) {
  glGetInterfacePPAPI()->Uniform2i(glGetCurrentContextPPAPI(), location, x, y);
}

void GL_APIENTRY glUniform2iv(GLint location, GLsizei count, const GLint* v) {
  glGetInterfacePPAPI()->Uniform2iv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) {
  glGetInterfacePPAPI()->Uniform3f(
      glGetCurrentContextPPAPI(), location, x, y, z);
}

void GL_APIENTRY glUniform3fv(
    GLint location, GLsizei count, const GLfloat* v) {
  glGetInterfacePPAPI()->Uniform3fv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniform3i(GLint location, GLint x, GLint y, GLint z) {
  glGetInterfacePPAPI()->Uniform3i(
      glGetCurrentContextPPAPI(), location, x, y, z);
}

void GL_APIENTRY glUniform3iv(GLint location, GLsizei count, const GLint* v) {
  glGetInterfacePPAPI()->Uniform3iv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniform4f(
    GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
  glGetInterfacePPAPI()->Uniform4f(
      glGetCurrentContextPPAPI(), location, x, y, z, w);
}

void GL_APIENTRY glUniform4fv(
    GLint location, GLsizei count, const GLfloat* v) {
  glGetInterfacePPAPI()->Uniform4fv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniform4i(
    GLint location, GLint x, GLint y, GLint z, GLint w) {
  glGetInterfacePPAPI()->Uniform4i(
      glGetCurrentContextPPAPI(), location, x, y, z, w);
}

void GL_APIENTRY glUniform4iv(GLint location, GLsizei count, const GLint* v) {
  glGetInterfacePPAPI()->Uniform4iv(
      glGetCurrentContextPPAPI(), location, count, v);
}

void GL_APIENTRY glUniformMatrix2fv(
    GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
  glGetInterfacePPAPI()->UniformMatrix2fv(
      glGetCurrentContextPPAPI(), location, count, transpose, value);
}

void GL_APIENTRY glUniformMatrix3fv(
    GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
  glGetInterfacePPAPI()->UniformMatrix3fv(
      glGetCurrentContextPPAPI(), location, count, transpose, value);
}

void GL_APIENTRY glUniformMatrix4fv(
    GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
  glGetInterfacePPAPI()->UniformMatrix4fv(
      glGetCurrentContextPPAPI(), location, count, transpose, value);
}

void GL_APIENTRY glUseProgram(GLuint program) {
  glGetInterfacePPAPI()->UseProgram(glGetCurrentContextPPAPI(), program);
}

void GL_APIENTRY glValidateProgram(GLuint program) {
  glGetInterfacePPAPI()->ValidateProgram(glGetCurrentContextPPAPI(), program);
}

void GL_APIENTRY glVertexAttrib1f(GLuint indx, GLfloat x) {
  glGetInterfacePPAPI()->VertexAttrib1f(glGetCurrentContextPPAPI(), indx, x);
}

void GL_APIENTRY glVertexAttrib1fv(GLuint indx, const GLfloat* values) {
  glGetInterfacePPAPI()->VertexAttrib1fv(
      glGetCurrentContextPPAPI(), indx, values);
}

void GL_APIENTRY glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) {
  glGetInterfacePPAPI()->VertexAttrib2f(
      glGetCurrentContextPPAPI(), indx, x, y);
}

void GL_APIENTRY glVertexAttrib2fv(GLuint indx, const GLfloat* values) {
  glGetInterfacePPAPI()->VertexAttrib2fv(
      glGetCurrentContextPPAPI(), indx, values);
}

void GL_APIENTRY glVertexAttrib3f(
    GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
  glGetInterfacePPAPI()->VertexAttrib3f(
      glGetCurrentContextPPAPI(), indx, x, y, z);
}

void GL_APIENTRY glVertexAttrib3fv(GLuint indx, const GLfloat* values) {
  glGetInterfacePPAPI()->VertexAttrib3fv(
      glGetCurrentContextPPAPI(), indx, values);
}

void GL_APIENTRY glVertexAttrib4f(
    GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
  glGetInterfacePPAPI()->VertexAttrib4f(
      glGetCurrentContextPPAPI(), indx, x, y, z, w);
}

void GL_APIENTRY glVertexAttrib4fv(GLuint indx, const GLfloat* values) {
  glGetInterfacePPAPI()->VertexAttrib4fv(
      glGetCurrentContextPPAPI(), indx, values);
}

void GL_APIENTRY glVertexAttribPointer(
    GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride,
    const void* ptr) {
  glGetInterfacePPAPI()->VertexAttribPointer(
      glGetCurrentContextPPAPI(), indx, size, type, normalized, stride, ptr);
}

void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
  glGetInterfacePPAPI()->Viewport(
      glGetCurrentContextPPAPI(), x, y, width, height);
}

void GL_APIENTRY glBlitFramebufferEXT(
    GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0,
    GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
  const struct PPB_OpenGLES2FramebufferBlit* ext =
      glGetFramebufferBlitInterfacePPAPI();
  if (ext)
    ext->BlitFramebufferEXT(
        glGetCurrentContextPPAPI(), srcX0, srcY0, srcX1, srcY1, dstX0, dstY0,
        dstX1, dstY1, mask, filter);
}

void GL_APIENTRY glRenderbufferStorageMultisampleEXT(
    GLenum target, GLsizei samples, GLenum internalformat, GLsizei width,
    GLsizei height) {
  const struct PPB_OpenGLES2FramebufferMultisample* ext =
      glGetFramebufferMultisampleInterfacePPAPI();
  if (ext)
    ext->RenderbufferStorageMultisampleEXT(
        glGetCurrentContextPPAPI(), target, samples, internalformat, width,
        height);
}

void GL_APIENTRY glGenQueriesEXT(GLsizei n, GLuint* queries) {
  const struct PPB_OpenGLES2Query* ext = glGetQueryInterfacePPAPI();
  if (ext)
    ext->GenQueriesEXT(glGetCurrentContextPPAPI(), n, queries);
}

void GL_APIENTRY glDeleteQueriesEXT(GLsizei n, const GLuint* queries) {
  const struct PPB_OpenGLES2Query* ext = glGetQueryInterfacePPAPI();
  if (ext)
    ext->DeleteQueriesEXT(glGetCurrentContextPPAPI(), n, queries);
}

GLboolean GL_APIENTRY glIsQueryEXT(GLuint id) {
  const struct PPB_OpenGLES2Query* ext = glGetQueryInterfacePPAPI();
  if (ext)
    return ext->IsQueryEXT(glGetCurrentContextPPAPI(), id);
  return 0;
}

void GL_APIENTRY glBeginQueryEXT(GLenum target, GLuint id) {
  const struct PPB_OpenGLES2Query* ext = glGetQueryInterfacePPAPI();
  if (ext)
    ext->BeginQueryEXT(glGetCurrentContextPPAPI(), target, id);
}

void GL_APIENTRY glEndQueryEXT(GLenum target) {
  const struct PPB_OpenGLES2Query* ext = glGetQueryInterfacePPAPI();
  if (ext)
    ext->EndQueryEXT(glGetCurrentContextPPAPI(), target);
}

void GL_APIENTRY glGetQueryivEXT(GLenum target, GLenum pname, GLint* params) {
  const struct PPB_OpenGLES2Query* ext = glGetQueryInterfacePPAPI();
  if (ext)
    ext->GetQueryivEXT(glGetCurrentContextPPAPI(), target, pname, params);
}

void GL_APIENTRY glGetQueryObjectuivEXT(
    GLuint id, GLenum pname, GLuint* params) {
  const struct PPB_OpenGLES2Query* ext = glGetQueryInterfacePPAPI();
  if (ext)
    ext->GetQueryObjectuivEXT(glGetCurrentContextPPAPI(), id, pname, params);
}

GLboolean GL_APIENTRY glEnableFeatureCHROMIUM(const char* feature) {
  const struct PPB_OpenGLES2ChromiumEnableFeature* ext =
      glGetChromiumEnableFeatureInterfacePPAPI();
  if (ext)
    return ext->EnableFeatureCHROMIUM(glGetCurrentContextPPAPI(), feature);
  return 0;
}

void* GL_APIENTRY glMapBufferSubDataCHROMIUM(
    GLuint target, GLintptr offset, GLsizeiptr size, GLenum access) {
  const struct PPB_OpenGLES2ChromiumMapSub* ext =
      glGetChromiumMapSubInterfacePPAPI();
  if (ext)
    return ext->MapBufferSubDataCHROMIUM(
        glGetCurrentContextPPAPI(), target, offset, size, access);
  return 0;
}

void GL_APIENTRY glUnmapBufferSubDataCHROMIUM(const void* mem) {
  const struct PPB_OpenGLES2ChromiumMapSub* ext =
      glGetChromiumMapSubInterfacePPAPI();
  if (ext)
    ext->UnmapBufferSubDataCHROMIUM(glGetCurrentContextPPAPI(), mem);
}

void* GL_APIENTRY glMapTexSubImage2DCHROMIUM(
    GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
    GLsizei height, GLenum format, GLenum type, GLenum access) {
  const struct PPB_OpenGLES2ChromiumMapSub* ext =
      glGetChromiumMapSubInterfacePPAPI();
  if (ext)
    return ext->MapTexSubImage2DCHROMIUM(
        glGetCurrentContextPPAPI(), target, level, xoffset, yoffset, width,
        height, format, type, access);
  return 0;
}

void GL_APIENTRY glUnmapTexSubImage2DCHROMIUM(const void* mem) {
  const struct PPB_OpenGLES2ChromiumMapSub* ext =
      glGetChromiumMapSubInterfacePPAPI();
  if (ext)
    ext->UnmapTexSubImage2DCHROMIUM(glGetCurrentContextPPAPI(), mem);
}

void GL_APIENTRY glDrawArraysInstancedANGLE(
    GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
  const struct PPB_OpenGLES2InstancedArrays* ext =
      glGetInstancedArraysInterfacePPAPI();
  if (ext)
    ext->DrawArraysInstancedANGLE(
        glGetCurrentContextPPAPI(), mode, first, count, primcount);
}

void GL_APIENTRY glDrawElementsInstancedANGLE(
    GLenum mode, GLsizei count, GLenum type, const void* indices,
    GLsizei primcount) {
  const struct PPB_OpenGLES2InstancedArrays* ext =
      glGetInstancedArraysInterfacePPAPI();
  if (ext)
    ext->DrawElementsInstancedANGLE(
        glGetCurrentContextPPAPI(), mode, count, type, indices, primcount);
}

void GL_APIENTRY glVertexAttribDivisorANGLE(GLuint index, GLuint divisor) {
  const struct PPB_OpenGLES2InstancedArrays* ext =
      glGetInstancedArraysInterfacePPAPI();
  if (ext)
    ext->VertexAttribDivisorANGLE(glGetCurrentContextPPAPI(), index, divisor);
}