1 // Copyright (c) 2012 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
9 #include "ppapi/shared_impl/ppb_opengles2_shared.h"
11 #include "base/logging.h"
12 #include "gpu/command_buffer/client/gles2_implementation.h"
13 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
14 #include "ppapi/thunk/enter.h"
20 gpu::gles2::GLES2Implementation
* GetGLES(PP_Resource context
) {
21 thunk::EnterResource
<thunk::PPB_Graphics3D_API
> enter_g3d(context
, false);
22 DCHECK(enter_g3d
.succeeded());
23 return static_cast<PPB_Graphics3D_Shared
*>(enter_g3d
.object())->gles2_impl();
26 void ActiveTexture(PP_Resource context_id
, GLenum texture
) {
27 GetGLES(context_id
)->ActiveTexture(texture
);
30 void AttachShader(PP_Resource context_id
, GLuint program
, GLuint shader
) {
31 GetGLES(context_id
)->AttachShader(program
, shader
);
34 void BindAttribLocation(
35 PP_Resource context_id
, GLuint program
, GLuint index
, const char* name
) {
36 GetGLES(context_id
)->BindAttribLocation(program
, index
, name
);
39 void BindBuffer(PP_Resource context_id
, GLenum target
, GLuint buffer
) {
40 GetGLES(context_id
)->BindBuffer(target
, buffer
);
44 PP_Resource context_id
, GLenum target
, GLuint framebuffer
) {
45 GetGLES(context_id
)->BindFramebuffer(target
, framebuffer
);
48 void BindRenderbuffer(
49 PP_Resource context_id
, GLenum target
, GLuint renderbuffer
) {
50 GetGLES(context_id
)->BindRenderbuffer(target
, renderbuffer
);
53 void BindTexture(PP_Resource context_id
, GLenum target
, GLuint texture
) {
54 GetGLES(context_id
)->BindTexture(target
, texture
);
58 PP_Resource context_id
, GLclampf red
, GLclampf green
, GLclampf blue
,
60 GetGLES(context_id
)->BlendColor(red
, green
, blue
, alpha
);
63 void BlendEquation(PP_Resource context_id
, GLenum mode
) {
64 GetGLES(context_id
)->BlendEquation(mode
);
67 void BlendEquationSeparate(
68 PP_Resource context_id
, GLenum modeRGB
, GLenum modeAlpha
) {
69 GetGLES(context_id
)->BlendEquationSeparate(modeRGB
, modeAlpha
);
72 void BlendFunc(PP_Resource context_id
, GLenum sfactor
, GLenum dfactor
) {
73 GetGLES(context_id
)->BlendFunc(sfactor
, dfactor
);
76 void BlendFuncSeparate(
77 PP_Resource context_id
, GLenum srcRGB
, GLenum dstRGB
, GLenum srcAlpha
,
79 GetGLES(context_id
)->BlendFuncSeparate(srcRGB
, dstRGB
, srcAlpha
, dstAlpha
);
83 PP_Resource context_id
, GLenum target
, GLsizeiptr size
, const void* data
,
85 GetGLES(context_id
)->BufferData(target
, size
, data
, usage
);
89 PP_Resource context_id
, GLenum target
, GLintptr offset
, GLsizeiptr size
,
91 GetGLES(context_id
)->BufferSubData(target
, offset
, size
, data
);
94 GLenum
CheckFramebufferStatus(PP_Resource context_id
, GLenum target
) {
95 return GetGLES(context_id
)->CheckFramebufferStatus(target
);
98 void Clear(PP_Resource context_id
, GLbitfield mask
) {
99 GetGLES(context_id
)->Clear(mask
);
103 PP_Resource context_id
, GLclampf red
, GLclampf green
, GLclampf blue
,
105 GetGLES(context_id
)->ClearColor(red
, green
, blue
, alpha
);
108 void ClearDepthf(PP_Resource context_id
, GLclampf depth
) {
109 GetGLES(context_id
)->ClearDepthf(depth
);
112 void ClearStencil(PP_Resource context_id
, GLint s
) {
113 GetGLES(context_id
)->ClearStencil(s
);
117 PP_Resource context_id
, GLboolean red
, GLboolean green
, GLboolean blue
,
119 GetGLES(context_id
)->ColorMask(red
, green
, blue
, alpha
);
122 void CompileShader(PP_Resource context_id
, GLuint shader
) {
123 GetGLES(context_id
)->CompileShader(shader
);
126 void CompressedTexImage2D(
127 PP_Resource context_id
, GLenum target
, GLint level
, GLenum internalformat
,
128 GLsizei width
, GLsizei height
, GLint border
, GLsizei imageSize
,
131 context_id
)->CompressedTexImage2D(
132 target
, level
, internalformat
, width
, height
, border
, imageSize
,
136 void CompressedTexSubImage2D(
137 PP_Resource context_id
, GLenum target
, GLint level
, GLint xoffset
,
138 GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
,
139 GLsizei imageSize
, const void* data
) {
141 context_id
)->CompressedTexSubImage2D(
142 target
, level
, xoffset
, yoffset
, width
, height
, format
, imageSize
,
147 PP_Resource context_id
, GLenum target
, GLint level
, GLenum internalformat
,
148 GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLint border
) {
150 context_id
)->CopyTexImage2D(
151 target
, level
, internalformat
, x
, y
, width
, height
, border
);
154 void CopyTexSubImage2D(
155 PP_Resource context_id
, GLenum target
, GLint level
, GLint xoffset
,
156 GLint yoffset
, GLint x
, GLint y
, GLsizei width
, GLsizei height
) {
158 context_id
)->CopyTexSubImage2D(
159 target
, level
, xoffset
, yoffset
, x
, y
, width
, height
);
162 GLuint
CreateProgram(PP_Resource context_id
) {
163 return GetGLES(context_id
)->CreateProgram();
166 GLuint
CreateShader(PP_Resource context_id
, GLenum type
) {
167 return GetGLES(context_id
)->CreateShader(type
);
170 void CullFace(PP_Resource context_id
, GLenum mode
) {
171 GetGLES(context_id
)->CullFace(mode
);
174 void DeleteBuffers(PP_Resource context_id
, GLsizei n
, const GLuint
* buffers
) {
175 GetGLES(context_id
)->DeleteBuffers(n
, buffers
);
178 void DeleteFramebuffers(
179 PP_Resource context_id
, GLsizei n
, const GLuint
* framebuffers
) {
180 GetGLES(context_id
)->DeleteFramebuffers(n
, framebuffers
);
183 void DeleteProgram(PP_Resource context_id
, GLuint program
) {
184 GetGLES(context_id
)->DeleteProgram(program
);
187 void DeleteRenderbuffers(
188 PP_Resource context_id
, GLsizei n
, const GLuint
* renderbuffers
) {
189 GetGLES(context_id
)->DeleteRenderbuffers(n
, renderbuffers
);
192 void DeleteShader(PP_Resource context_id
, GLuint shader
) {
193 GetGLES(context_id
)->DeleteShader(shader
);
197 PP_Resource context_id
, GLsizei n
, const GLuint
* textures
) {
198 GetGLES(context_id
)->DeleteTextures(n
, textures
);
201 void DepthFunc(PP_Resource context_id
, GLenum func
) {
202 GetGLES(context_id
)->DepthFunc(func
);
205 void DepthMask(PP_Resource context_id
, GLboolean flag
) {
206 GetGLES(context_id
)->DepthMask(flag
);
209 void DepthRangef(PP_Resource context_id
, GLclampf zNear
, GLclampf zFar
) {
210 GetGLES(context_id
)->DepthRangef(zNear
, zFar
);
213 void DetachShader(PP_Resource context_id
, GLuint program
, GLuint shader
) {
214 GetGLES(context_id
)->DetachShader(program
, shader
);
217 void Disable(PP_Resource context_id
, GLenum cap
) {
218 GetGLES(context_id
)->Disable(cap
);
221 void DisableVertexAttribArray(PP_Resource context_id
, GLuint index
) {
222 GetGLES(context_id
)->DisableVertexAttribArray(index
);
226 PP_Resource context_id
, GLenum mode
, GLint first
, GLsizei count
) {
227 GetGLES(context_id
)->DrawArrays(mode
, first
, count
);
231 PP_Resource context_id
, GLenum mode
, GLsizei count
, GLenum type
,
232 const void* indices
) {
233 GetGLES(context_id
)->DrawElements(mode
, count
, type
, indices
);
236 void Enable(PP_Resource context_id
, GLenum cap
) {
237 GetGLES(context_id
)->Enable(cap
);
240 void EnableVertexAttribArray(PP_Resource context_id
, GLuint index
) {
241 GetGLES(context_id
)->EnableVertexAttribArray(index
);
244 void Finish(PP_Resource context_id
) {
245 GetGLES(context_id
)->Finish();
248 void Flush(PP_Resource context_id
) {
249 GetGLES(context_id
)->Flush();
252 void FramebufferRenderbuffer(
253 PP_Resource context_id
, GLenum target
, GLenum attachment
,
254 GLenum renderbuffertarget
, GLuint renderbuffer
) {
256 context_id
)->FramebufferRenderbuffer(
257 target
, attachment
, renderbuffertarget
, renderbuffer
);
260 void FramebufferTexture2D(
261 PP_Resource context_id
, GLenum target
, GLenum attachment
, GLenum textarget
,
262 GLuint texture
, GLint level
) {
264 context_id
)->FramebufferTexture2D(
265 target
, attachment
, textarget
, texture
, level
);
268 void FrontFace(PP_Resource context_id
, GLenum mode
) {
269 GetGLES(context_id
)->FrontFace(mode
);
272 void GenBuffers(PP_Resource context_id
, GLsizei n
, GLuint
* buffers
) {
273 GetGLES(context_id
)->GenBuffers(n
, buffers
);
276 void GenerateMipmap(PP_Resource context_id
, GLenum target
) {
277 GetGLES(context_id
)->GenerateMipmap(target
);
280 void GenFramebuffers(PP_Resource context_id
, GLsizei n
, GLuint
* framebuffers
) {
281 GetGLES(context_id
)->GenFramebuffers(n
, framebuffers
);
284 void GenRenderbuffers(
285 PP_Resource context_id
, GLsizei n
, GLuint
* renderbuffers
) {
286 GetGLES(context_id
)->GenRenderbuffers(n
, renderbuffers
);
289 void GenTextures(PP_Resource context_id
, GLsizei n
, GLuint
* textures
) {
290 GetGLES(context_id
)->GenTextures(n
, textures
);
293 void GetActiveAttrib(
294 PP_Resource context_id
, GLuint program
, GLuint index
, GLsizei bufsize
,
295 GLsizei
* length
, GLint
* size
, GLenum
* type
, char* name
) {
297 context_id
)->GetActiveAttrib(
298 program
, index
, bufsize
, length
, size
, type
, name
);
301 void GetActiveUniform(
302 PP_Resource context_id
, GLuint program
, GLuint index
, GLsizei bufsize
,
303 GLsizei
* length
, GLint
* size
, GLenum
* type
, char* name
) {
305 context_id
)->GetActiveUniform(
306 program
, index
, bufsize
, length
, size
, type
, name
);
309 void GetAttachedShaders(
310 PP_Resource context_id
, GLuint program
, GLsizei maxcount
, GLsizei
* count
,
312 GetGLES(context_id
)->GetAttachedShaders(program
, maxcount
, count
, shaders
);
315 GLint
GetAttribLocation(
316 PP_Resource context_id
, GLuint program
, const char* name
) {
317 return GetGLES(context_id
)->GetAttribLocation(program
, name
);
320 void GetBooleanv(PP_Resource context_id
, GLenum pname
, GLboolean
* params
) {
321 GetGLES(context_id
)->GetBooleanv(pname
, params
);
324 void GetBufferParameteriv(
325 PP_Resource context_id
, GLenum target
, GLenum pname
, GLint
* params
) {
326 GetGLES(context_id
)->GetBufferParameteriv(target
, pname
, params
);
329 GLenum
GetError(PP_Resource context_id
) {
330 return GetGLES(context_id
)->GetError();
333 void GetFloatv(PP_Resource context_id
, GLenum pname
, GLfloat
* params
) {
334 GetGLES(context_id
)->GetFloatv(pname
, params
);
337 void GetFramebufferAttachmentParameteriv(
338 PP_Resource context_id
, GLenum target
, GLenum attachment
, GLenum pname
,
341 context_id
)->GetFramebufferAttachmentParameteriv(
342 target
, attachment
, pname
, params
);
345 void GetIntegerv(PP_Resource context_id
, GLenum pname
, GLint
* params
) {
346 GetGLES(context_id
)->GetIntegerv(pname
, params
);
350 PP_Resource context_id
, GLuint program
, GLenum pname
, GLint
* params
) {
351 GetGLES(context_id
)->GetProgramiv(program
, pname
, params
);
354 void GetProgramInfoLog(
355 PP_Resource context_id
, GLuint program
, GLsizei bufsize
, GLsizei
* length
,
357 GetGLES(context_id
)->GetProgramInfoLog(program
, bufsize
, length
, infolog
);
360 void GetRenderbufferParameteriv(
361 PP_Resource context_id
, GLenum target
, GLenum pname
, GLint
* params
) {
362 GetGLES(context_id
)->GetRenderbufferParameteriv(target
, pname
, params
);
366 PP_Resource context_id
, GLuint shader
, GLenum pname
, GLint
* params
) {
367 GetGLES(context_id
)->GetShaderiv(shader
, pname
, params
);
370 void GetShaderInfoLog(
371 PP_Resource context_id
, GLuint shader
, GLsizei bufsize
, GLsizei
* length
,
373 GetGLES(context_id
)->GetShaderInfoLog(shader
, bufsize
, length
, infolog
);
376 void GetShaderPrecisionFormat(
377 PP_Resource context_id
, GLenum shadertype
, GLenum precisiontype
,
378 GLint
* range
, GLint
* precision
) {
380 context_id
)->GetShaderPrecisionFormat(
381 shadertype
, precisiontype
, range
, precision
);
384 void GetShaderSource(
385 PP_Resource context_id
, GLuint shader
, GLsizei bufsize
, GLsizei
* length
,
387 GetGLES(context_id
)->GetShaderSource(shader
, bufsize
, length
, source
);
390 const GLubyte
* GetString(PP_Resource context_id
, GLenum name
) {
391 return GetGLES(context_id
)->GetString(name
);
394 void GetTexParameterfv(
395 PP_Resource context_id
, GLenum target
, GLenum pname
, GLfloat
* params
) {
396 GetGLES(context_id
)->GetTexParameterfv(target
, pname
, params
);
399 void GetTexParameteriv(
400 PP_Resource context_id
, GLenum target
, GLenum pname
, GLint
* params
) {
401 GetGLES(context_id
)->GetTexParameteriv(target
, pname
, params
);
405 PP_Resource context_id
, GLuint program
, GLint location
, GLfloat
* params
) {
406 GetGLES(context_id
)->GetUniformfv(program
, location
, params
);
410 PP_Resource context_id
, GLuint program
, GLint location
, GLint
* params
) {
411 GetGLES(context_id
)->GetUniformiv(program
, location
, params
);
414 GLint
GetUniformLocation(
415 PP_Resource context_id
, GLuint program
, const char* name
) {
416 return GetGLES(context_id
)->GetUniformLocation(program
, name
);
419 void GetVertexAttribfv(
420 PP_Resource context_id
, GLuint index
, GLenum pname
, GLfloat
* params
) {
421 GetGLES(context_id
)->GetVertexAttribfv(index
, pname
, params
);
424 void GetVertexAttribiv(
425 PP_Resource context_id
, GLuint index
, GLenum pname
, GLint
* params
) {
426 GetGLES(context_id
)->GetVertexAttribiv(index
, pname
, params
);
429 void GetVertexAttribPointerv(
430 PP_Resource context_id
, GLuint index
, GLenum pname
, void** pointer
) {
431 GetGLES(context_id
)->GetVertexAttribPointerv(index
, pname
, pointer
);
434 void Hint(PP_Resource context_id
, GLenum target
, GLenum mode
) {
435 GetGLES(context_id
)->Hint(target
, mode
);
438 GLboolean
IsBuffer(PP_Resource context_id
, GLuint buffer
) {
439 return GetGLES(context_id
)->IsBuffer(buffer
);
442 GLboolean
IsEnabled(PP_Resource context_id
, GLenum cap
) {
443 return GetGLES(context_id
)->IsEnabled(cap
);
446 GLboolean
IsFramebuffer(PP_Resource context_id
, GLuint framebuffer
) {
447 return GetGLES(context_id
)->IsFramebuffer(framebuffer
);
450 GLboolean
IsProgram(PP_Resource context_id
, GLuint program
) {
451 return GetGLES(context_id
)->IsProgram(program
);
454 GLboolean
IsRenderbuffer(PP_Resource context_id
, GLuint renderbuffer
) {
455 return GetGLES(context_id
)->IsRenderbuffer(renderbuffer
);
458 GLboolean
IsShader(PP_Resource context_id
, GLuint shader
) {
459 return GetGLES(context_id
)->IsShader(shader
);
462 GLboolean
IsTexture(PP_Resource context_id
, GLuint texture
) {
463 return GetGLES(context_id
)->IsTexture(texture
);
466 void LineWidth(PP_Resource context_id
, GLfloat width
) {
467 GetGLES(context_id
)->LineWidth(width
);
470 void LinkProgram(PP_Resource context_id
, GLuint program
) {
471 GetGLES(context_id
)->LinkProgram(program
);
474 void PixelStorei(PP_Resource context_id
, GLenum pname
, GLint param
) {
475 GetGLES(context_id
)->PixelStorei(pname
, param
);
478 void PolygonOffset(PP_Resource context_id
, GLfloat factor
, GLfloat units
) {
479 GetGLES(context_id
)->PolygonOffset(factor
, units
);
483 PP_Resource context_id
, GLint x
, GLint y
, GLsizei width
, GLsizei height
,
484 GLenum format
, GLenum type
, void* pixels
) {
485 GetGLES(context_id
)->ReadPixels(x
, y
, width
, height
, format
, type
, pixels
);
488 void ReleaseShaderCompiler(PP_Resource context_id
) {
489 GetGLES(context_id
)->ReleaseShaderCompiler();
492 void RenderbufferStorage(
493 PP_Resource context_id
, GLenum target
, GLenum internalformat
, GLsizei width
,
496 context_id
)->RenderbufferStorage(target
, internalformat
, width
, height
);
499 void SampleCoverage(PP_Resource context_id
, GLclampf value
, GLboolean invert
) {
500 GetGLES(context_id
)->SampleCoverage(value
, invert
);
504 PP_Resource context_id
, GLint x
, GLint y
, GLsizei width
, GLsizei height
) {
505 GetGLES(context_id
)->Scissor(x
, y
, width
, height
);
509 PP_Resource context_id
, GLsizei n
, const GLuint
* shaders
,
510 GLenum binaryformat
, const void* binary
, GLsizei length
) {
511 GetGLES(context_id
)->ShaderBinary(n
, shaders
, binaryformat
, binary
, length
);
515 PP_Resource context_id
, GLuint shader
, GLsizei count
, const char** str
,
516 const GLint
* length
) {
517 GetGLES(context_id
)->ShaderSource(shader
, count
, str
, length
);
520 void StencilFunc(PP_Resource context_id
, GLenum func
, GLint ref
, GLuint mask
) {
521 GetGLES(context_id
)->StencilFunc(func
, ref
, mask
);
524 void StencilFuncSeparate(
525 PP_Resource context_id
, GLenum face
, GLenum func
, GLint ref
, GLuint mask
) {
526 GetGLES(context_id
)->StencilFuncSeparate(face
, func
, ref
, mask
);
529 void StencilMask(PP_Resource context_id
, GLuint mask
) {
530 GetGLES(context_id
)->StencilMask(mask
);
533 void StencilMaskSeparate(PP_Resource context_id
, GLenum face
, GLuint mask
) {
534 GetGLES(context_id
)->StencilMaskSeparate(face
, mask
);
538 PP_Resource context_id
, GLenum fail
, GLenum zfail
, GLenum zpass
) {
539 GetGLES(context_id
)->StencilOp(fail
, zfail
, zpass
);
542 void StencilOpSeparate(
543 PP_Resource context_id
, GLenum face
, GLenum fail
, GLenum zfail
,
545 GetGLES(context_id
)->StencilOpSeparate(face
, fail
, zfail
, zpass
);
549 PP_Resource context_id
, GLenum target
, GLint level
, GLint internalformat
,
550 GLsizei width
, GLsizei height
, GLint border
, GLenum format
, GLenum type
,
551 const void* pixels
) {
553 context_id
)->TexImage2D(
554 target
, level
, internalformat
, width
, height
, border
, format
, type
,
559 PP_Resource context_id
, GLenum target
, GLenum pname
, GLfloat param
) {
560 GetGLES(context_id
)->TexParameterf(target
, pname
, param
);
564 PP_Resource context_id
, GLenum target
, GLenum pname
,
565 const GLfloat
* params
) {
566 GetGLES(context_id
)->TexParameterfv(target
, pname
, params
);
570 PP_Resource context_id
, GLenum target
, GLenum pname
, GLint param
) {
571 GetGLES(context_id
)->TexParameteri(target
, pname
, param
);
575 PP_Resource context_id
, GLenum target
, GLenum pname
, const GLint
* params
) {
576 GetGLES(context_id
)->TexParameteriv(target
, pname
, params
);
580 PP_Resource context_id
, GLenum target
, GLint level
, GLint xoffset
,
581 GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
,
582 const void* pixels
) {
584 context_id
)->TexSubImage2D(
585 target
, level
, xoffset
, yoffset
, width
, height
, format
, type
,
589 void Uniform1f(PP_Resource context_id
, GLint location
, GLfloat x
) {
590 GetGLES(context_id
)->Uniform1f(location
, x
);
594 PP_Resource context_id
, GLint location
, GLsizei count
, const GLfloat
* v
) {
595 GetGLES(context_id
)->Uniform1fv(location
, count
, v
);
598 void Uniform1i(PP_Resource context_id
, GLint location
, GLint x
) {
599 GetGLES(context_id
)->Uniform1i(location
, x
);
603 PP_Resource context_id
, GLint location
, GLsizei count
, const GLint
* v
) {
604 GetGLES(context_id
)->Uniform1iv(location
, count
, v
);
607 void Uniform2f(PP_Resource context_id
, GLint location
, GLfloat x
, GLfloat y
) {
608 GetGLES(context_id
)->Uniform2f(location
, x
, y
);
612 PP_Resource context_id
, GLint location
, GLsizei count
, const GLfloat
* v
) {
613 GetGLES(context_id
)->Uniform2fv(location
, count
, v
);
616 void Uniform2i(PP_Resource context_id
, GLint location
, GLint x
, GLint y
) {
617 GetGLES(context_id
)->Uniform2i(location
, x
, y
);
621 PP_Resource context_id
, GLint location
, GLsizei count
, const GLint
* v
) {
622 GetGLES(context_id
)->Uniform2iv(location
, count
, v
);
626 PP_Resource context_id
, GLint location
, GLfloat x
, GLfloat y
, GLfloat z
) {
627 GetGLES(context_id
)->Uniform3f(location
, x
, y
, z
);
631 PP_Resource context_id
, GLint location
, GLsizei count
, const GLfloat
* v
) {
632 GetGLES(context_id
)->Uniform3fv(location
, count
, v
);
636 PP_Resource context_id
, GLint location
, GLint x
, GLint y
, GLint z
) {
637 GetGLES(context_id
)->Uniform3i(location
, x
, y
, z
);
641 PP_Resource context_id
, GLint location
, GLsizei count
, const GLint
* v
) {
642 GetGLES(context_id
)->Uniform3iv(location
, count
, v
);
646 PP_Resource context_id
, GLint location
, GLfloat x
, GLfloat y
, GLfloat z
,
648 GetGLES(context_id
)->Uniform4f(location
, x
, y
, z
, w
);
652 PP_Resource context_id
, GLint location
, GLsizei count
, const GLfloat
* v
) {
653 GetGLES(context_id
)->Uniform4fv(location
, count
, v
);
657 PP_Resource context_id
, GLint location
, GLint x
, GLint y
, GLint z
,
659 GetGLES(context_id
)->Uniform4i(location
, x
, y
, z
, w
);
663 PP_Resource context_id
, GLint location
, GLsizei count
, const GLint
* v
) {
664 GetGLES(context_id
)->Uniform4iv(location
, count
, v
);
667 void UniformMatrix2fv(
668 PP_Resource context_id
, GLint location
, GLsizei count
, GLboolean transpose
,
669 const GLfloat
* value
) {
670 GetGLES(context_id
)->UniformMatrix2fv(location
, count
, transpose
, value
);
673 void UniformMatrix3fv(
674 PP_Resource context_id
, GLint location
, GLsizei count
, GLboolean transpose
,
675 const GLfloat
* value
) {
676 GetGLES(context_id
)->UniformMatrix3fv(location
, count
, transpose
, value
);
679 void UniformMatrix4fv(
680 PP_Resource context_id
, GLint location
, GLsizei count
, GLboolean transpose
,
681 const GLfloat
* value
) {
682 GetGLES(context_id
)->UniformMatrix4fv(location
, count
, transpose
, value
);
685 void UseProgram(PP_Resource context_id
, GLuint program
) {
686 GetGLES(context_id
)->UseProgram(program
);
689 void ValidateProgram(PP_Resource context_id
, GLuint program
) {
690 GetGLES(context_id
)->ValidateProgram(program
);
693 void VertexAttrib1f(PP_Resource context_id
, GLuint indx
, GLfloat x
) {
694 GetGLES(context_id
)->VertexAttrib1f(indx
, x
);
697 void VertexAttrib1fv(
698 PP_Resource context_id
, GLuint indx
, const GLfloat
* values
) {
699 GetGLES(context_id
)->VertexAttrib1fv(indx
, values
);
703 PP_Resource context_id
, GLuint indx
, GLfloat x
, GLfloat y
) {
704 GetGLES(context_id
)->VertexAttrib2f(indx
, x
, y
);
707 void VertexAttrib2fv(
708 PP_Resource context_id
, GLuint indx
, const GLfloat
* values
) {
709 GetGLES(context_id
)->VertexAttrib2fv(indx
, values
);
713 PP_Resource context_id
, GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
) {
714 GetGLES(context_id
)->VertexAttrib3f(indx
, x
, y
, z
);
717 void VertexAttrib3fv(
718 PP_Resource context_id
, GLuint indx
, const GLfloat
* values
) {
719 GetGLES(context_id
)->VertexAttrib3fv(indx
, values
);
723 PP_Resource context_id
, GLuint indx
, GLfloat x
, GLfloat y
, GLfloat z
,
725 GetGLES(context_id
)->VertexAttrib4f(indx
, x
, y
, z
, w
);
728 void VertexAttrib4fv(
729 PP_Resource context_id
, GLuint indx
, const GLfloat
* values
) {
730 GetGLES(context_id
)->VertexAttrib4fv(indx
, values
);
733 void VertexAttribPointer(
734 PP_Resource context_id
, GLuint indx
, GLint size
, GLenum type
,
735 GLboolean normalized
, GLsizei stride
, const void* ptr
) {
737 context_id
)->VertexAttribPointer(
738 indx
, size
, type
, normalized
, stride
, ptr
);
742 PP_Resource context_id
, GLint x
, GLint y
, GLsizei width
, GLsizei height
) {
743 GetGLES(context_id
)->Viewport(x
, y
, width
, height
);
746 void BlitFramebufferEXT(
747 PP_Resource context_id
, GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
748 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
, GLbitfield mask
,
751 context_id
)->BlitFramebufferEXT(
752 srcX0
, srcY0
, srcX1
, srcY1
, dstX0
, dstY0
, dstX1
, dstY1
, mask
,
756 void RenderbufferStorageMultisampleEXT(
757 PP_Resource context_id
, GLenum target
, GLsizei samples
,
758 GLenum internalformat
, GLsizei width
, GLsizei height
) {
760 context_id
)->RenderbufferStorageMultisampleEXT(
761 target
, samples
, internalformat
, width
, height
);
764 void GenQueriesEXT(PP_Resource context_id
, GLsizei n
, GLuint
* queries
) {
765 GetGLES(context_id
)->GenQueriesEXT(n
, queries
);
768 void DeleteQueriesEXT(
769 PP_Resource context_id
, GLsizei n
, const GLuint
* queries
) {
770 GetGLES(context_id
)->DeleteQueriesEXT(n
, queries
);
773 GLboolean
IsQueryEXT(PP_Resource context_id
, GLuint id
) {
774 return GetGLES(context_id
)->IsQueryEXT(id
);
777 void BeginQueryEXT(PP_Resource context_id
, GLenum target
, GLuint id
) {
778 GetGLES(context_id
)->BeginQueryEXT(target
, id
);
781 void EndQueryEXT(PP_Resource context_id
, GLenum target
) {
782 GetGLES(context_id
)->EndQueryEXT(target
);
786 PP_Resource context_id
, GLenum target
, GLenum pname
, GLint
* params
) {
787 GetGLES(context_id
)->GetQueryivEXT(target
, pname
, params
);
790 void GetQueryObjectuivEXT(
791 PP_Resource context_id
, GLuint id
, GLenum pname
, GLuint
* params
) {
792 GetGLES(context_id
)->GetQueryObjectuivEXT(id
, pname
, params
);
795 GLboolean
EnableFeatureCHROMIUM(PP_Resource context_id
, const char* feature
) {
796 return GetGLES(context_id
)->EnableFeatureCHROMIUM(feature
);
799 void* MapBufferSubDataCHROMIUM(
800 PP_Resource context_id
, GLuint target
, GLintptr offset
, GLsizeiptr size
,
803 context_id
)->MapBufferSubDataCHROMIUM(target
, offset
, size
, access
);
806 void UnmapBufferSubDataCHROMIUM(PP_Resource context_id
, const void* mem
) {
807 GetGLES(context_id
)->UnmapBufferSubDataCHROMIUM(mem
);
810 void* MapTexSubImage2DCHROMIUM(
811 PP_Resource context_id
, GLenum target
, GLint level
, GLint xoffset
,
812 GLint yoffset
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
,
815 context_id
)->MapTexSubImage2DCHROMIUM(
816 target
, level
, xoffset
, yoffset
, width
, height
, format
, type
,
820 void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id
, const void* mem
) {
821 GetGLES(context_id
)->UnmapTexSubImage2DCHROMIUM(mem
);
824 void DrawArraysInstancedANGLE(
825 PP_Resource context_id
, GLenum mode
, GLint first
, GLsizei count
,
827 GetGLES(context_id
)->DrawArraysInstancedANGLE(mode
, first
, count
, primcount
);
830 void DrawElementsInstancedANGLE(
831 PP_Resource context_id
, GLenum mode
, GLsizei count
, GLenum type
,
832 const void* indices
, GLsizei primcount
) {
834 context_id
)->DrawElementsInstancedANGLE(
835 mode
, count
, type
, indices
, primcount
);
838 void VertexAttribDivisorANGLE(
839 PP_Resource context_id
, GLuint index
, GLuint divisor
) {
840 GetGLES(context_id
)->VertexAttribDivisorANGLE(index
, divisor
);
844 const PPB_OpenGLES2
* PPB_OpenGLES2_Shared::GetInterface() {
845 static const struct PPB_OpenGLES2 ppb_opengles2
= {
855 &BlendEquationSeparate
,
860 &CheckFramebufferStatus
,
867 &CompressedTexImage2D
,
868 &CompressedTexSubImage2D
,
877 &DeleteRenderbuffers
,
885 &DisableVertexAttribArray
,
889 &EnableVertexAttribArray
,
892 &FramebufferRenderbuffer
,
893 &FramebufferTexture2D
,
905 &GetBufferParameteriv
,
908 &GetFramebufferAttachmentParameteriv
,
912 &GetRenderbufferParameteriv
,
915 &GetShaderPrecisionFormat
,
925 &GetVertexAttribPointerv
,
939 &ReleaseShaderCompiler
,
940 &RenderbufferStorage
,
946 &StencilFuncSeparate
,
948 &StencilMaskSeparate
,
986 &VertexAttribPointer
,
989 return &ppb_opengles2
;
991 const PPB_OpenGLES2InstancedArrays
* PPB_OpenGLES2_Shared::GetInstancedArraysInterface() { // NOLINT
992 static const struct PPB_OpenGLES2InstancedArrays ppb_opengles2
= {
993 &DrawArraysInstancedANGLE
,
994 &DrawElementsInstancedANGLE
,
995 &VertexAttribDivisorANGLE
997 return &ppb_opengles2
;
999 const PPB_OpenGLES2FramebufferBlit
* PPB_OpenGLES2_Shared::GetFramebufferBlitInterface() { // NOLINT
1000 static const struct PPB_OpenGLES2FramebufferBlit ppb_opengles2
= {
1003 return &ppb_opengles2
;
1005 const PPB_OpenGLES2FramebufferMultisample
* PPB_OpenGLES2_Shared::GetFramebufferMultisampleInterface() { // NOLINT
1006 static const struct PPB_OpenGLES2FramebufferMultisample ppb_opengles2
= {
1007 &RenderbufferStorageMultisampleEXT
1009 return &ppb_opengles2
;
1011 const PPB_OpenGLES2ChromiumEnableFeature
* PPB_OpenGLES2_Shared::GetChromiumEnableFeatureInterface() { // NOLINT
1012 static const struct PPB_OpenGLES2ChromiumEnableFeature ppb_opengles2
= {
1013 &EnableFeatureCHROMIUM
1015 return &ppb_opengles2
;
1017 const PPB_OpenGLES2ChromiumMapSub
* PPB_OpenGLES2_Shared::GetChromiumMapSubInterface() { // NOLINT
1018 static const struct PPB_OpenGLES2ChromiumMapSub ppb_opengles2
= {
1019 &MapBufferSubDataCHROMIUM
,
1020 &UnmapBufferSubDataCHROMIUM
,
1021 &MapTexSubImage2DCHROMIUM
,
1022 &UnmapTexSubImage2DCHROMIUM
1024 return &ppb_opengles2
;
1026 const PPB_OpenGLES2Query
* PPB_OpenGLES2_Shared::GetQueryInterface() {
1027 static const struct PPB_OpenGLES2Query ppb_opengles2
= {
1034 &GetQueryObjectuivEXT
1036 return &ppb_opengles2
;
1038 } // namespace ppapi