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