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