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