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