Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 | 5 // This file is auto-generated from |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
| 7 // DO NOT EDIT! | 7 // DO NOT EDIT! |
| 8 | 8 |
| 9 #include "ppapi/shared_impl/ppb_opengles2_shared.h" | 9 #include "ppapi/shared_impl/ppb_opengles2_shared.h" |
|
bajones
2014/03/04 00:47:15
Does this file contain anything other than style t
Zhenyao Mo
2014/03/04 01:59:31
I didn't touch this file at all. It's all auto-ge
| |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "gpu/command_buffer/client/gles2_implementation.h" | 12 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 13 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" | 13 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" |
| 14 #include "ppapi/thunk/enter.h" | 14 #include "ppapi/thunk/enter.h" |
| 15 | 15 |
| 16 namespace ppapi { | 16 namespace ppapi { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 void AttachShader(PP_Resource context_id, GLuint program, GLuint shader) { | 35 void AttachShader(PP_Resource context_id, GLuint program, GLuint shader) { |
| 36 Enter3D enter(context_id, true); | 36 Enter3D enter(context_id, true); |
| 37 if (enter.succeeded()) { | 37 if (enter.succeeded()) { |
| 38 ToGles2Impl(&enter)->AttachShader(program, shader); | 38 ToGles2Impl(&enter)->AttachShader(program, shader); |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 void BindAttribLocation(PP_Resource context_id, | 42 void BindAttribLocation( |
| 43 GLuint program, | 43 PP_Resource context_id, GLuint program, GLuint index, const char* name) { |
| 44 GLuint index, | |
| 45 const char* name) { | |
| 46 Enter3D enter(context_id, true); | 44 Enter3D enter(context_id, true); |
| 47 if (enter.succeeded()) { | 45 if (enter.succeeded()) { |
| 48 ToGles2Impl(&enter)->BindAttribLocation(program, index, name); | 46 ToGles2Impl(&enter)->BindAttribLocation(program, index, name); |
| 49 } | 47 } |
| 50 } | 48 } |
| 51 | 49 |
| 52 void BindBuffer(PP_Resource context_id, GLenum target, GLuint buffer) { | 50 void BindBuffer(PP_Resource context_id, GLenum target, GLuint buffer) { |
| 53 Enter3D enter(context_id, true); | 51 Enter3D enter(context_id, true); |
| 54 if (enter.succeeded()) { | 52 if (enter.succeeded()) { |
| 55 ToGles2Impl(&enter)->BindBuffer(target, buffer); | 53 ToGles2Impl(&enter)->BindBuffer(target, buffer); |
| 56 } | 54 } |
| 57 } | 55 } |
| 58 | 56 |
| 59 void BindFramebuffer(PP_Resource context_id, | 57 void BindFramebuffer( |
| 60 GLenum target, | 58 PP_Resource context_id, GLenum target, GLuint framebuffer) { |
| 61 GLuint framebuffer) { | |
| 62 Enter3D enter(context_id, true); | 59 Enter3D enter(context_id, true); |
| 63 if (enter.succeeded()) { | 60 if (enter.succeeded()) { |
| 64 ToGles2Impl(&enter)->BindFramebuffer(target, framebuffer); | 61 ToGles2Impl(&enter)->BindFramebuffer(target, framebuffer); |
| 65 } | 62 } |
| 66 } | 63 } |
| 67 | 64 |
| 68 void BindRenderbuffer(PP_Resource context_id, | 65 void BindRenderbuffer( |
| 69 GLenum target, | 66 PP_Resource context_id, GLenum target, GLuint renderbuffer) { |
| 70 GLuint renderbuffer) { | |
| 71 Enter3D enter(context_id, true); | 67 Enter3D enter(context_id, true); |
| 72 if (enter.succeeded()) { | 68 if (enter.succeeded()) { |
| 73 ToGles2Impl(&enter)->BindRenderbuffer(target, renderbuffer); | 69 ToGles2Impl(&enter)->BindRenderbuffer(target, renderbuffer); |
| 74 } | 70 } |
| 75 } | 71 } |
| 76 | 72 |
| 77 void BindTexture(PP_Resource context_id, GLenum target, GLuint texture) { | 73 void BindTexture(PP_Resource context_id, GLenum target, GLuint texture) { |
| 78 Enter3D enter(context_id, true); | 74 Enter3D enter(context_id, true); |
| 79 if (enter.succeeded()) { | 75 if (enter.succeeded()) { |
| 80 ToGles2Impl(&enter)->BindTexture(target, texture); | 76 ToGles2Impl(&enter)->BindTexture(target, texture); |
| 81 } | 77 } |
| 82 } | 78 } |
| 83 | 79 |
| 84 void BlendColor(PP_Resource context_id, | 80 void BlendColor( |
| 85 GLclampf red, | 81 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, |
| 86 GLclampf green, | 82 GLclampf alpha) { |
| 87 GLclampf blue, | |
| 88 GLclampf alpha) { | |
| 89 Enter3D enter(context_id, true); | 83 Enter3D enter(context_id, true); |
| 90 if (enter.succeeded()) { | 84 if (enter.succeeded()) { |
| 91 ToGles2Impl(&enter)->BlendColor(red, green, blue, alpha); | 85 ToGles2Impl(&enter)->BlendColor(red, green, blue, alpha); |
| 92 } | 86 } |
| 93 } | 87 } |
| 94 | 88 |
| 95 void BlendEquation(PP_Resource context_id, GLenum mode) { | 89 void BlendEquation(PP_Resource context_id, GLenum mode) { |
| 96 Enter3D enter(context_id, true); | 90 Enter3D enter(context_id, true); |
| 97 if (enter.succeeded()) { | 91 if (enter.succeeded()) { |
| 98 ToGles2Impl(&enter)->BlendEquation(mode); | 92 ToGles2Impl(&enter)->BlendEquation(mode); |
| 99 } | 93 } |
| 100 } | 94 } |
| 101 | 95 |
| 102 void BlendEquationSeparate(PP_Resource context_id, | 96 void BlendEquationSeparate( |
| 103 GLenum modeRGB, | 97 PP_Resource context_id, GLenum modeRGB, GLenum modeAlpha) { |
| 104 GLenum modeAlpha) { | |
| 105 Enter3D enter(context_id, true); | 98 Enter3D enter(context_id, true); |
| 106 if (enter.succeeded()) { | 99 if (enter.succeeded()) { |
| 107 ToGles2Impl(&enter)->BlendEquationSeparate(modeRGB, modeAlpha); | 100 ToGles2Impl(&enter)->BlendEquationSeparate(modeRGB, modeAlpha); |
| 108 } | 101 } |
| 109 } | 102 } |
| 110 | 103 |
| 111 void BlendFunc(PP_Resource context_id, GLenum sfactor, GLenum dfactor) { | 104 void BlendFunc(PP_Resource context_id, GLenum sfactor, GLenum dfactor) { |
| 112 Enter3D enter(context_id, true); | 105 Enter3D enter(context_id, true); |
| 113 if (enter.succeeded()) { | 106 if (enter.succeeded()) { |
| 114 ToGles2Impl(&enter)->BlendFunc(sfactor, dfactor); | 107 ToGles2Impl(&enter)->BlendFunc(sfactor, dfactor); |
| 115 } | 108 } |
| 116 } | 109 } |
| 117 | 110 |
| 118 void BlendFuncSeparate(PP_Resource context_id, | 111 void BlendFuncSeparate( |
| 119 GLenum srcRGB, | 112 PP_Resource context_id, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, |
|
yzshen1
2014/03/04 05:51:15
Please note that the old code conforms to Chromium
Zhenyao Mo
2014/03/04 15:58:08
Which part? The new code also conforms I think.
| |
| 120 GLenum dstRGB, | 113 GLenum dstAlpha) { |
| 121 GLenum srcAlpha, | |
| 122 GLenum dstAlpha) { | |
| 123 Enter3D enter(context_id, true); | 114 Enter3D enter(context_id, true); |
| 124 if (enter.succeeded()) { | 115 if (enter.succeeded()) { |
| 125 ToGles2Impl(&enter)->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); | 116 ToGles2Impl(&enter)->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| 126 } | 117 } |
| 127 } | 118 } |
| 128 | 119 |
| 129 void BufferData(PP_Resource context_id, | 120 void BufferData( |
| 130 GLenum target, | 121 PP_Resource context_id, GLenum target, GLsizeiptr size, const void* data, |
| 131 GLsizeiptr size, | 122 GLenum usage) { |
| 132 const void* data, | |
| 133 GLenum usage) { | |
| 134 Enter3D enter(context_id, true); | 123 Enter3D enter(context_id, true); |
| 135 if (enter.succeeded()) { | 124 if (enter.succeeded()) { |
| 136 ToGles2Impl(&enter)->BufferData(target, size, data, usage); | 125 ToGles2Impl(&enter)->BufferData(target, size, data, usage); |
| 137 } | 126 } |
| 138 } | 127 } |
| 139 | 128 |
| 140 void BufferSubData(PP_Resource context_id, | 129 void BufferSubData( |
| 141 GLenum target, | 130 PP_Resource context_id, GLenum target, GLintptr offset, GLsizeiptr size, |
| 142 GLintptr offset, | 131 const void* data) { |
| 143 GLsizeiptr size, | |
| 144 const void* data) { | |
| 145 Enter3D enter(context_id, true); | 132 Enter3D enter(context_id, true); |
| 146 if (enter.succeeded()) { | 133 if (enter.succeeded()) { |
| 147 ToGles2Impl(&enter)->BufferSubData(target, offset, size, data); | 134 ToGles2Impl(&enter)->BufferSubData(target, offset, size, data); |
| 148 } | 135 } |
| 149 } | 136 } |
| 150 | 137 |
| 151 GLenum CheckFramebufferStatus(PP_Resource context_id, GLenum target) { | 138 GLenum CheckFramebufferStatus(PP_Resource context_id, GLenum target) { |
| 152 Enter3D enter(context_id, true); | 139 Enter3D enter(context_id, true); |
| 153 if (enter.succeeded()) { | 140 if (enter.succeeded()) { |
| 154 return ToGles2Impl(&enter)->CheckFramebufferStatus(target); | 141 return ToGles2Impl(&enter)->CheckFramebufferStatus(target); |
| 155 } else { | 142 } else { |
| 156 return 0; | 143 return 0; |
| 157 } | 144 } |
| 158 } | 145 } |
| 159 | 146 |
| 160 void Clear(PP_Resource context_id, GLbitfield mask) { | 147 void Clear(PP_Resource context_id, GLbitfield mask) { |
| 161 Enter3D enter(context_id, true); | 148 Enter3D enter(context_id, true); |
| 162 if (enter.succeeded()) { | 149 if (enter.succeeded()) { |
| 163 ToGles2Impl(&enter)->Clear(mask); | 150 ToGles2Impl(&enter)->Clear(mask); |
| 164 } | 151 } |
| 165 } | 152 } |
| 166 | 153 |
| 167 void ClearColor(PP_Resource context_id, | 154 void ClearColor( |
| 168 GLclampf red, | 155 PP_Resource context_id, GLclampf red, GLclampf green, GLclampf blue, |
| 169 GLclampf green, | 156 GLclampf alpha) { |
| 170 GLclampf blue, | |
| 171 GLclampf alpha) { | |
| 172 Enter3D enter(context_id, true); | 157 Enter3D enter(context_id, true); |
| 173 if (enter.succeeded()) { | 158 if (enter.succeeded()) { |
| 174 ToGles2Impl(&enter)->ClearColor(red, green, blue, alpha); | 159 ToGles2Impl(&enter)->ClearColor(red, green, blue, alpha); |
| 175 } | 160 } |
| 176 } | 161 } |
| 177 | 162 |
| 178 void ClearDepthf(PP_Resource context_id, GLclampf depth) { | 163 void ClearDepthf(PP_Resource context_id, GLclampf depth) { |
| 179 Enter3D enter(context_id, true); | 164 Enter3D enter(context_id, true); |
| 180 if (enter.succeeded()) { | 165 if (enter.succeeded()) { |
| 181 ToGles2Impl(&enter)->ClearDepthf(depth); | 166 ToGles2Impl(&enter)->ClearDepthf(depth); |
| 182 } | 167 } |
| 183 } | 168 } |
| 184 | 169 |
| 185 void ClearStencil(PP_Resource context_id, GLint s) { | 170 void ClearStencil(PP_Resource context_id, GLint s) { |
| 186 Enter3D enter(context_id, true); | 171 Enter3D enter(context_id, true); |
| 187 if (enter.succeeded()) { | 172 if (enter.succeeded()) { |
| 188 ToGles2Impl(&enter)->ClearStencil(s); | 173 ToGles2Impl(&enter)->ClearStencil(s); |
| 189 } | 174 } |
| 190 } | 175 } |
| 191 | 176 |
| 192 void ColorMask(PP_Resource context_id, | 177 void ColorMask( |
| 193 GLboolean red, | 178 PP_Resource context_id, GLboolean red, GLboolean green, GLboolean blue, |
| 194 GLboolean green, | 179 GLboolean alpha) { |
| 195 GLboolean blue, | |
| 196 GLboolean alpha) { | |
| 197 Enter3D enter(context_id, true); | 180 Enter3D enter(context_id, true); |
| 198 if (enter.succeeded()) { | 181 if (enter.succeeded()) { |
| 199 ToGles2Impl(&enter)->ColorMask(red, green, blue, alpha); | 182 ToGles2Impl(&enter)->ColorMask(red, green, blue, alpha); |
| 200 } | 183 } |
| 201 } | 184 } |
| 202 | 185 |
| 203 void CompileShader(PP_Resource context_id, GLuint shader) { | 186 void CompileShader(PP_Resource context_id, GLuint shader) { |
| 204 Enter3D enter(context_id, true); | 187 Enter3D enter(context_id, true); |
| 205 if (enter.succeeded()) { | 188 if (enter.succeeded()) { |
| 206 ToGles2Impl(&enter)->CompileShader(shader); | 189 ToGles2Impl(&enter)->CompileShader(shader); |
| 207 } | 190 } |
| 208 } | 191 } |
| 209 | 192 |
| 210 void CompressedTexImage2D(PP_Resource context_id, | 193 void CompressedTexImage2D( |
| 211 GLenum target, | 194 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, |
| 212 GLint level, | 195 GLsizei width, GLsizei height, GLint border, GLsizei imageSize, |
| 213 GLenum internalformat, | 196 const void* data) { |
| 214 GLsizei width, | |
| 215 GLsizei height, | |
| 216 GLint border, | |
| 217 GLsizei imageSize, | |
| 218 const void* data) { | |
| 219 Enter3D enter(context_id, true); | 197 Enter3D enter(context_id, true); |
| 220 if (enter.succeeded()) { | 198 if (enter.succeeded()) { |
| 221 ToGles2Impl(&enter)->CompressedTexImage2D( | 199 ToGles2Impl( |
| 222 target, level, internalformat, width, height, border, imageSize, data); | 200 &enter)->CompressedTexImage2D( |
| 201 target, level, internalformat, width, height, border, imageSize, | |
| 202 data); | |
| 223 } | 203 } |
| 224 } | 204 } |
| 225 | 205 |
| 226 void CompressedTexSubImage2D(PP_Resource context_id, | 206 void CompressedTexSubImage2D( |
| 227 GLenum target, | 207 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, |
| 228 GLint level, | 208 GLint yoffset, GLsizei width, GLsizei height, GLenum format, |
| 229 GLint xoffset, | 209 GLsizei imageSize, const void* data) { |
| 230 GLint yoffset, | |
| 231 GLsizei width, | |
| 232 GLsizei height, | |
| 233 GLenum format, | |
| 234 GLsizei imageSize, | |
| 235 const void* data) { | |
| 236 Enter3D enter(context_id, true); | 210 Enter3D enter(context_id, true); |
| 237 if (enter.succeeded()) { | 211 if (enter.succeeded()) { |
| 238 ToGles2Impl(&enter)->CompressedTexSubImage2D(target, | 212 ToGles2Impl( |
| 239 level, | 213 &enter)->CompressedTexSubImage2D( |
| 240 xoffset, | 214 target, level, xoffset, yoffset, width, height, format, imageSize, |
| 241 yoffset, | 215 data); |
| 242 width, | |
| 243 height, | |
| 244 format, | |
| 245 imageSize, | |
| 246 data); | |
| 247 } | 216 } |
| 248 } | 217 } |
| 249 | 218 |
| 250 void CopyTexImage2D(PP_Resource context_id, | 219 void CopyTexImage2D( |
| 251 GLenum target, | 220 PP_Resource context_id, GLenum target, GLint level, GLenum internalformat, |
| 252 GLint level, | 221 GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { |
| 253 GLenum internalformat, | |
| 254 GLint x, | |
| 255 GLint y, | |
| 256 GLsizei width, | |
| 257 GLsizei height, | |
| 258 GLint border) { | |
| 259 Enter3D enter(context_id, true); | 222 Enter3D enter(context_id, true); |
| 260 if (enter.succeeded()) { | 223 if (enter.succeeded()) { |
| 261 ToGles2Impl(&enter)->CopyTexImage2D( | 224 ToGles2Impl( |
| 262 target, level, internalformat, x, y, width, height, border); | 225 &enter)->CopyTexImage2D( |
| 226 target, level, internalformat, x, y, width, height, border); | |
| 263 } | 227 } |
| 264 } | 228 } |
| 265 | 229 |
| 266 void CopyTexSubImage2D(PP_Resource context_id, | 230 void CopyTexSubImage2D( |
| 267 GLenum target, | 231 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, |
| 268 GLint level, | 232 GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { |
| 269 GLint xoffset, | |
| 270 GLint yoffset, | |
| 271 GLint x, | |
| 272 GLint y, | |
| 273 GLsizei width, | |
| 274 GLsizei height) { | |
| 275 Enter3D enter(context_id, true); | 233 Enter3D enter(context_id, true); |
| 276 if (enter.succeeded()) { | 234 if (enter.succeeded()) { |
| 277 ToGles2Impl(&enter)->CopyTexSubImage2D( | 235 ToGles2Impl( |
| 278 target, level, xoffset, yoffset, x, y, width, height); | 236 &enter)->CopyTexSubImage2D( |
| 237 target, level, xoffset, yoffset, x, y, width, height); | |
| 279 } | 238 } |
| 280 } | 239 } |
| 281 | 240 |
| 282 GLuint CreateProgram(PP_Resource context_id) { | 241 GLuint CreateProgram(PP_Resource context_id) { |
| 283 Enter3D enter(context_id, true); | 242 Enter3D enter(context_id, true); |
| 284 if (enter.succeeded()) { | 243 if (enter.succeeded()) { |
| 285 return ToGles2Impl(&enter)->CreateProgram(); | 244 return ToGles2Impl(&enter)->CreateProgram(); |
| 286 } else { | 245 } else { |
| 287 return 0; | 246 return 0; |
| 288 } | 247 } |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 304 } | 263 } |
| 305 } | 264 } |
| 306 | 265 |
| 307 void DeleteBuffers(PP_Resource context_id, GLsizei n, const GLuint* buffers) { | 266 void DeleteBuffers(PP_Resource context_id, GLsizei n, const GLuint* buffers) { |
| 308 Enter3D enter(context_id, true); | 267 Enter3D enter(context_id, true); |
| 309 if (enter.succeeded()) { | 268 if (enter.succeeded()) { |
| 310 ToGles2Impl(&enter)->DeleteBuffers(n, buffers); | 269 ToGles2Impl(&enter)->DeleteBuffers(n, buffers); |
| 311 } | 270 } |
| 312 } | 271 } |
| 313 | 272 |
| 314 void DeleteFramebuffers(PP_Resource context_id, | 273 void DeleteFramebuffers( |
| 315 GLsizei n, | 274 PP_Resource context_id, GLsizei n, const GLuint* framebuffers) { |
| 316 const GLuint* framebuffers) { | |
| 317 Enter3D enter(context_id, true); | 275 Enter3D enter(context_id, true); |
| 318 if (enter.succeeded()) { | 276 if (enter.succeeded()) { |
| 319 ToGles2Impl(&enter)->DeleteFramebuffers(n, framebuffers); | 277 ToGles2Impl(&enter)->DeleteFramebuffers(n, framebuffers); |
| 320 } | 278 } |
| 321 } | 279 } |
| 322 | 280 |
| 323 void DeleteProgram(PP_Resource context_id, GLuint program) { | 281 void DeleteProgram(PP_Resource context_id, GLuint program) { |
| 324 Enter3D enter(context_id, true); | 282 Enter3D enter(context_id, true); |
| 325 if (enter.succeeded()) { | 283 if (enter.succeeded()) { |
| 326 ToGles2Impl(&enter)->DeleteProgram(program); | 284 ToGles2Impl(&enter)->DeleteProgram(program); |
| 327 } | 285 } |
| 328 } | 286 } |
| 329 | 287 |
| 330 void DeleteRenderbuffers(PP_Resource context_id, | 288 void DeleteRenderbuffers( |
| 331 GLsizei n, | 289 PP_Resource context_id, GLsizei n, const GLuint* renderbuffers) { |
| 332 const GLuint* renderbuffers) { | |
| 333 Enter3D enter(context_id, true); | 290 Enter3D enter(context_id, true); |
| 334 if (enter.succeeded()) { | 291 if (enter.succeeded()) { |
| 335 ToGles2Impl(&enter)->DeleteRenderbuffers(n, renderbuffers); | 292 ToGles2Impl(&enter)->DeleteRenderbuffers(n, renderbuffers); |
| 336 } | 293 } |
| 337 } | 294 } |
| 338 | 295 |
| 339 void DeleteShader(PP_Resource context_id, GLuint shader) { | 296 void DeleteShader(PP_Resource context_id, GLuint shader) { |
| 340 Enter3D enter(context_id, true); | 297 Enter3D enter(context_id, true); |
| 341 if (enter.succeeded()) { | 298 if (enter.succeeded()) { |
| 342 ToGles2Impl(&enter)->DeleteShader(shader); | 299 ToGles2Impl(&enter)->DeleteShader(shader); |
| 343 } | 300 } |
| 344 } | 301 } |
| 345 | 302 |
| 346 void DeleteTextures(PP_Resource context_id, GLsizei n, const GLuint* textures) { | 303 void DeleteTextures( |
| 304 PP_Resource context_id, GLsizei n, const GLuint* textures) { | |
| 347 Enter3D enter(context_id, true); | 305 Enter3D enter(context_id, true); |
| 348 if (enter.succeeded()) { | 306 if (enter.succeeded()) { |
| 349 ToGles2Impl(&enter)->DeleteTextures(n, textures); | 307 ToGles2Impl(&enter)->DeleteTextures(n, textures); |
| 350 } | 308 } |
| 351 } | 309 } |
| 352 | 310 |
| 353 void DepthFunc(PP_Resource context_id, GLenum func) { | 311 void DepthFunc(PP_Resource context_id, GLenum func) { |
| 354 Enter3D enter(context_id, true); | 312 Enter3D enter(context_id, true); |
| 355 if (enter.succeeded()) { | 313 if (enter.succeeded()) { |
| 356 ToGles2Impl(&enter)->DepthFunc(func); | 314 ToGles2Impl(&enter)->DepthFunc(func); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 385 } | 343 } |
| 386 } | 344 } |
| 387 | 345 |
| 388 void DisableVertexAttribArray(PP_Resource context_id, GLuint index) { | 346 void DisableVertexAttribArray(PP_Resource context_id, GLuint index) { |
| 389 Enter3D enter(context_id, true); | 347 Enter3D enter(context_id, true); |
| 390 if (enter.succeeded()) { | 348 if (enter.succeeded()) { |
| 391 ToGles2Impl(&enter)->DisableVertexAttribArray(index); | 349 ToGles2Impl(&enter)->DisableVertexAttribArray(index); |
| 392 } | 350 } |
| 393 } | 351 } |
| 394 | 352 |
| 395 void DrawArrays(PP_Resource context_id, | 353 void DrawArrays( |
| 396 GLenum mode, | 354 PP_Resource context_id, GLenum mode, GLint first, GLsizei count) { |
| 397 GLint first, | |
| 398 GLsizei count) { | |
| 399 Enter3D enter(context_id, true); | 355 Enter3D enter(context_id, true); |
| 400 if (enter.succeeded()) { | 356 if (enter.succeeded()) { |
| 401 ToGles2Impl(&enter)->DrawArrays(mode, first, count); | 357 ToGles2Impl(&enter)->DrawArrays(mode, first, count); |
| 402 } | 358 } |
| 403 } | 359 } |
| 404 | 360 |
| 405 void DrawElements(PP_Resource context_id, | 361 void DrawElements( |
| 406 GLenum mode, | 362 PP_Resource context_id, GLenum mode, GLsizei count, GLenum type, |
| 407 GLsizei count, | 363 const void* indices) { |
| 408 GLenum type, | |
| 409 const void* indices) { | |
| 410 Enter3D enter(context_id, true); | 364 Enter3D enter(context_id, true); |
| 411 if (enter.succeeded()) { | 365 if (enter.succeeded()) { |
| 412 ToGles2Impl(&enter)->DrawElements(mode, count, type, indices); | 366 ToGles2Impl(&enter)->DrawElements(mode, count, type, indices); |
| 413 } | 367 } |
| 414 } | 368 } |
| 415 | 369 |
| 416 void Enable(PP_Resource context_id, GLenum cap) { | 370 void Enable(PP_Resource context_id, GLenum cap) { |
| 417 Enter3D enter(context_id, true); | 371 Enter3D enter(context_id, true); |
| 418 if (enter.succeeded()) { | 372 if (enter.succeeded()) { |
| 419 ToGles2Impl(&enter)->Enable(cap); | 373 ToGles2Impl(&enter)->Enable(cap); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 434 } | 388 } |
| 435 } | 389 } |
| 436 | 390 |
| 437 void Flush(PP_Resource context_id) { | 391 void Flush(PP_Resource context_id) { |
| 438 Enter3D enter(context_id, true); | 392 Enter3D enter(context_id, true); |
| 439 if (enter.succeeded()) { | 393 if (enter.succeeded()) { |
| 440 ToGles2Impl(&enter)->Flush(); | 394 ToGles2Impl(&enter)->Flush(); |
| 441 } | 395 } |
| 442 } | 396 } |
| 443 | 397 |
| 444 void FramebufferRenderbuffer(PP_Resource context_id, | 398 void FramebufferRenderbuffer( |
| 445 GLenum target, | 399 PP_Resource context_id, GLenum target, GLenum attachment, |
| 446 GLenum attachment, | 400 GLenum renderbuffertarget, GLuint renderbuffer) { |
| 447 GLenum renderbuffertarget, | |
| 448 GLuint renderbuffer) { | |
| 449 Enter3D enter(context_id, true); | 401 Enter3D enter(context_id, true); |
| 450 if (enter.succeeded()) { | 402 if (enter.succeeded()) { |
| 451 ToGles2Impl(&enter)->FramebufferRenderbuffer( | 403 ToGles2Impl( |
| 452 target, attachment, renderbuffertarget, renderbuffer); | 404 &enter)->FramebufferRenderbuffer( |
| 405 target, attachment, renderbuffertarget, renderbuffer); | |
| 453 } | 406 } |
| 454 } | 407 } |
| 455 | 408 |
| 456 void FramebufferTexture2D(PP_Resource context_id, | 409 void FramebufferTexture2D( |
| 457 GLenum target, | 410 PP_Resource context_id, GLenum target, GLenum attachment, GLenum textarget, |
| 458 GLenum attachment, | 411 GLuint texture, GLint level) { |
| 459 GLenum textarget, | |
| 460 GLuint texture, | |
| 461 GLint level) { | |
| 462 Enter3D enter(context_id, true); | 412 Enter3D enter(context_id, true); |
| 463 if (enter.succeeded()) { | 413 if (enter.succeeded()) { |
| 464 ToGles2Impl(&enter) | 414 ToGles2Impl( |
| 465 ->FramebufferTexture2D(target, attachment, textarget, texture, level); | 415 &enter)->FramebufferTexture2D( |
| 416 target, attachment, textarget, texture, level); | |
| 466 } | 417 } |
| 467 } | 418 } |
| 468 | 419 |
| 469 void FrontFace(PP_Resource context_id, GLenum mode) { | 420 void FrontFace(PP_Resource context_id, GLenum mode) { |
| 470 Enter3D enter(context_id, true); | 421 Enter3D enter(context_id, true); |
| 471 if (enter.succeeded()) { | 422 if (enter.succeeded()) { |
| 472 ToGles2Impl(&enter)->FrontFace(mode); | 423 ToGles2Impl(&enter)->FrontFace(mode); |
| 473 } | 424 } |
| 474 } | 425 } |
| 475 | 426 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 487 } | 438 } |
| 488 } | 439 } |
| 489 | 440 |
| 490 void GenFramebuffers(PP_Resource context_id, GLsizei n, GLuint* framebuffers) { | 441 void GenFramebuffers(PP_Resource context_id, GLsizei n, GLuint* framebuffers) { |
| 491 Enter3D enter(context_id, true); | 442 Enter3D enter(context_id, true); |
| 492 if (enter.succeeded()) { | 443 if (enter.succeeded()) { |
| 493 ToGles2Impl(&enter)->GenFramebuffers(n, framebuffers); | 444 ToGles2Impl(&enter)->GenFramebuffers(n, framebuffers); |
| 494 } | 445 } |
| 495 } | 446 } |
| 496 | 447 |
| 497 void GenRenderbuffers(PP_Resource context_id, | 448 void GenRenderbuffers( |
| 498 GLsizei n, | 449 PP_Resource context_id, GLsizei n, GLuint* renderbuffers) { |
| 499 GLuint* renderbuffers) { | |
| 500 Enter3D enter(context_id, true); | 450 Enter3D enter(context_id, true); |
| 501 if (enter.succeeded()) { | 451 if (enter.succeeded()) { |
| 502 ToGles2Impl(&enter)->GenRenderbuffers(n, renderbuffers); | 452 ToGles2Impl(&enter)->GenRenderbuffers(n, renderbuffers); |
| 503 } | 453 } |
| 504 } | 454 } |
| 505 | 455 |
| 506 void GenTextures(PP_Resource context_id, GLsizei n, GLuint* textures) { | 456 void GenTextures(PP_Resource context_id, GLsizei n, GLuint* textures) { |
| 507 Enter3D enter(context_id, true); | 457 Enter3D enter(context_id, true); |
| 508 if (enter.succeeded()) { | 458 if (enter.succeeded()) { |
| 509 ToGles2Impl(&enter)->GenTextures(n, textures); | 459 ToGles2Impl(&enter)->GenTextures(n, textures); |
| 510 } | 460 } |
| 511 } | 461 } |
| 512 | 462 |
| 513 void GetActiveAttrib(PP_Resource context_id, | 463 void GetActiveAttrib( |
| 514 GLuint program, | 464 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, |
| 515 GLuint index, | 465 GLsizei* length, GLint* size, GLenum* type, char* name) { |
| 516 GLsizei bufsize, | |
| 517 GLsizei* length, | |
| 518 GLint* size, | |
| 519 GLenum* type, | |
| 520 char* name) { | |
| 521 Enter3D enter(context_id, true); | 466 Enter3D enter(context_id, true); |
| 522 if (enter.succeeded()) { | 467 if (enter.succeeded()) { |
| 523 ToGles2Impl(&enter) | 468 ToGles2Impl( |
| 524 ->GetActiveAttrib(program, index, bufsize, length, size, type, name); | 469 &enter)->GetActiveAttrib( |
| 470 program, index, bufsize, length, size, type, name); | |
| 525 } | 471 } |
| 526 } | 472 } |
| 527 | 473 |
| 528 void GetActiveUniform(PP_Resource context_id, | 474 void GetActiveUniform( |
| 529 GLuint program, | 475 PP_Resource context_id, GLuint program, GLuint index, GLsizei bufsize, |
| 530 GLuint index, | 476 GLsizei* length, GLint* size, GLenum* type, char* name) { |
| 531 GLsizei bufsize, | |
| 532 GLsizei* length, | |
| 533 GLint* size, | |
| 534 GLenum* type, | |
| 535 char* name) { | |
| 536 Enter3D enter(context_id, true); | 477 Enter3D enter(context_id, true); |
| 537 if (enter.succeeded()) { | 478 if (enter.succeeded()) { |
| 538 ToGles2Impl(&enter) | 479 ToGles2Impl( |
| 539 ->GetActiveUniform(program, index, bufsize, length, size, type, name); | 480 &enter)->GetActiveUniform( |
| 481 program, index, bufsize, length, size, type, name); | |
| 540 } | 482 } |
| 541 } | 483 } |
| 542 | 484 |
| 543 void GetAttachedShaders(PP_Resource context_id, | 485 void GetAttachedShaders( |
| 544 GLuint program, | 486 PP_Resource context_id, GLuint program, GLsizei maxcount, GLsizei* count, |
| 545 GLsizei maxcount, | 487 GLuint* shaders) { |
| 546 GLsizei* count, | |
| 547 GLuint* shaders) { | |
| 548 Enter3D enter(context_id, true); | 488 Enter3D enter(context_id, true); |
| 549 if (enter.succeeded()) { | 489 if (enter.succeeded()) { |
| 550 ToGles2Impl(&enter)->GetAttachedShaders(program, maxcount, count, shaders); | 490 ToGles2Impl(&enter)->GetAttachedShaders(program, maxcount, count, shaders); |
| 551 } | 491 } |
| 552 } | 492 } |
| 553 | 493 |
| 554 GLint GetAttribLocation(PP_Resource context_id, | 494 GLint GetAttribLocation( |
| 555 GLuint program, | 495 PP_Resource context_id, GLuint program, const char* name) { |
| 556 const char* name) { | |
| 557 Enter3D enter(context_id, true); | 496 Enter3D enter(context_id, true); |
| 558 if (enter.succeeded()) { | 497 if (enter.succeeded()) { |
| 559 return ToGles2Impl(&enter)->GetAttribLocation(program, name); | 498 return ToGles2Impl(&enter)->GetAttribLocation(program, name); |
| 560 } else { | 499 } else { |
| 561 return -1; | 500 return -1; |
| 562 } | 501 } |
| 563 } | 502 } |
| 564 | 503 |
| 565 void GetBooleanv(PP_Resource context_id, GLenum pname, GLboolean* params) { | 504 void GetBooleanv(PP_Resource context_id, GLenum pname, GLboolean* params) { |
| 566 Enter3D enter(context_id, true); | 505 Enter3D enter(context_id, true); |
| 567 if (enter.succeeded()) { | 506 if (enter.succeeded()) { |
| 568 ToGles2Impl(&enter)->GetBooleanv(pname, params); | 507 ToGles2Impl(&enter)->GetBooleanv(pname, params); |
| 569 } | 508 } |
| 570 } | 509 } |
| 571 | 510 |
| 572 void GetBufferParameteriv(PP_Resource context_id, | 511 void GetBufferParameteriv( |
| 573 GLenum target, | 512 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { |
| 574 GLenum pname, | |
| 575 GLint* params) { | |
| 576 Enter3D enter(context_id, true); | 513 Enter3D enter(context_id, true); |
| 577 if (enter.succeeded()) { | 514 if (enter.succeeded()) { |
| 578 ToGles2Impl(&enter)->GetBufferParameteriv(target, pname, params); | 515 ToGles2Impl(&enter)->GetBufferParameteriv(target, pname, params); |
| 579 } | 516 } |
| 580 } | 517 } |
| 581 | 518 |
| 582 GLenum GetError(PP_Resource context_id) { | 519 GLenum GetError(PP_Resource context_id) { |
| 583 Enter3D enter(context_id, true); | 520 Enter3D enter(context_id, true); |
| 584 if (enter.succeeded()) { | 521 if (enter.succeeded()) { |
| 585 return ToGles2Impl(&enter)->GetError(); | 522 return ToGles2Impl(&enter)->GetError(); |
| 586 } else { | 523 } else { |
| 587 return 0; | 524 return 0; |
| 588 } | 525 } |
| 589 } | 526 } |
| 590 | 527 |
| 591 void GetFloatv(PP_Resource context_id, GLenum pname, GLfloat* params) { | 528 void GetFloatv(PP_Resource context_id, GLenum pname, GLfloat* params) { |
| 592 Enter3D enter(context_id, true); | 529 Enter3D enter(context_id, true); |
| 593 if (enter.succeeded()) { | 530 if (enter.succeeded()) { |
| 594 ToGles2Impl(&enter)->GetFloatv(pname, params); | 531 ToGles2Impl(&enter)->GetFloatv(pname, params); |
| 595 } | 532 } |
| 596 } | 533 } |
| 597 | 534 |
| 598 void GetFramebufferAttachmentParameteriv(PP_Resource context_id, | 535 void GetFramebufferAttachmentParameteriv( |
| 599 GLenum target, | 536 PP_Resource context_id, GLenum target, GLenum attachment, GLenum pname, |
| 600 GLenum attachment, | 537 GLint* params) { |
| 601 GLenum pname, | |
| 602 GLint* params) { | |
| 603 Enter3D enter(context_id, true); | 538 Enter3D enter(context_id, true); |
| 604 if (enter.succeeded()) { | 539 if (enter.succeeded()) { |
| 605 ToGles2Impl(&enter)->GetFramebufferAttachmentParameteriv( | 540 ToGles2Impl( |
| 606 target, attachment, pname, params); | 541 &enter)->GetFramebufferAttachmentParameteriv( |
| 542 target, attachment, pname, params); | |
| 607 } | 543 } |
| 608 } | 544 } |
| 609 | 545 |
| 610 void GetIntegerv(PP_Resource context_id, GLenum pname, GLint* params) { | 546 void GetIntegerv(PP_Resource context_id, GLenum pname, GLint* params) { |
| 611 Enter3D enter(context_id, true); | 547 Enter3D enter(context_id, true); |
| 612 if (enter.succeeded()) { | 548 if (enter.succeeded()) { |
| 613 ToGles2Impl(&enter)->GetIntegerv(pname, params); | 549 ToGles2Impl(&enter)->GetIntegerv(pname, params); |
| 614 } | 550 } |
| 615 } | 551 } |
| 616 | 552 |
| 617 void GetProgramiv(PP_Resource context_id, | 553 void GetProgramiv( |
| 618 GLuint program, | 554 PP_Resource context_id, GLuint program, GLenum pname, GLint* params) { |
| 619 GLenum pname, | |
| 620 GLint* params) { | |
| 621 Enter3D enter(context_id, true); | 555 Enter3D enter(context_id, true); |
| 622 if (enter.succeeded()) { | 556 if (enter.succeeded()) { |
| 623 ToGles2Impl(&enter)->GetProgramiv(program, pname, params); | 557 ToGles2Impl(&enter)->GetProgramiv(program, pname, params); |
| 624 } | 558 } |
| 625 } | 559 } |
| 626 | 560 |
| 627 void GetProgramInfoLog(PP_Resource context_id, | 561 void GetProgramInfoLog( |
| 628 GLuint program, | 562 PP_Resource context_id, GLuint program, GLsizei bufsize, GLsizei* length, |
| 629 GLsizei bufsize, | 563 char* infolog) { |
| 630 GLsizei* length, | |
| 631 char* infolog) { | |
| 632 Enter3D enter(context_id, true); | 564 Enter3D enter(context_id, true); |
| 633 if (enter.succeeded()) { | 565 if (enter.succeeded()) { |
| 634 ToGles2Impl(&enter)->GetProgramInfoLog(program, bufsize, length, infolog); | 566 ToGles2Impl(&enter)->GetProgramInfoLog(program, bufsize, length, infolog); |
| 635 } | 567 } |
| 636 } | 568 } |
| 637 | 569 |
| 638 void GetRenderbufferParameteriv(PP_Resource context_id, | 570 void GetRenderbufferParameteriv( |
| 639 GLenum target, | 571 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { |
| 640 GLenum pname, | |
| 641 GLint* params) { | |
| 642 Enter3D enter(context_id, true); | 572 Enter3D enter(context_id, true); |
| 643 if (enter.succeeded()) { | 573 if (enter.succeeded()) { |
| 644 ToGles2Impl(&enter)->GetRenderbufferParameteriv(target, pname, params); | 574 ToGles2Impl(&enter)->GetRenderbufferParameteriv(target, pname, params); |
| 645 } | 575 } |
| 646 } | 576 } |
| 647 | 577 |
| 648 void GetShaderiv(PP_Resource context_id, | 578 void GetShaderiv( |
| 649 GLuint shader, | 579 PP_Resource context_id, GLuint shader, GLenum pname, GLint* params) { |
| 650 GLenum pname, | |
| 651 GLint* params) { | |
| 652 Enter3D enter(context_id, true); | 580 Enter3D enter(context_id, true); |
| 653 if (enter.succeeded()) { | 581 if (enter.succeeded()) { |
| 654 ToGles2Impl(&enter)->GetShaderiv(shader, pname, params); | 582 ToGles2Impl(&enter)->GetShaderiv(shader, pname, params); |
| 655 } | 583 } |
| 656 } | 584 } |
| 657 | 585 |
| 658 void GetShaderInfoLog(PP_Resource context_id, | 586 void GetShaderInfoLog( |
| 659 GLuint shader, | 587 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, |
| 660 GLsizei bufsize, | 588 char* infolog) { |
| 661 GLsizei* length, | |
| 662 char* infolog) { | |
| 663 Enter3D enter(context_id, true); | 589 Enter3D enter(context_id, true); |
| 664 if (enter.succeeded()) { | 590 if (enter.succeeded()) { |
| 665 ToGles2Impl(&enter)->GetShaderInfoLog(shader, bufsize, length, infolog); | 591 ToGles2Impl(&enter)->GetShaderInfoLog(shader, bufsize, length, infolog); |
| 666 } | 592 } |
| 667 } | 593 } |
| 668 | 594 |
| 669 void GetShaderPrecisionFormat(PP_Resource context_id, | 595 void GetShaderPrecisionFormat( |
| 670 GLenum shadertype, | 596 PP_Resource context_id, GLenum shadertype, GLenum precisiontype, |
| 671 GLenum precisiontype, | 597 GLint* range, GLint* precision) { |
| 672 GLint* range, | |
| 673 GLint* precision) { | |
| 674 Enter3D enter(context_id, true); | 598 Enter3D enter(context_id, true); |
| 675 if (enter.succeeded()) { | 599 if (enter.succeeded()) { |
| 676 ToGles2Impl(&enter) | 600 ToGles2Impl( |
| 677 ->GetShaderPrecisionFormat(shadertype, precisiontype, range, precision); | 601 &enter)->GetShaderPrecisionFormat( |
| 602 shadertype, precisiontype, range, precision); | |
| 678 } | 603 } |
| 679 } | 604 } |
| 680 | 605 |
| 681 void GetShaderSource(PP_Resource context_id, | 606 void GetShaderSource( |
| 682 GLuint shader, | 607 PP_Resource context_id, GLuint shader, GLsizei bufsize, GLsizei* length, |
| 683 GLsizei bufsize, | 608 char* source) { |
| 684 GLsizei* length, | |
| 685 char* source) { | |
| 686 Enter3D enter(context_id, true); | 609 Enter3D enter(context_id, true); |
| 687 if (enter.succeeded()) { | 610 if (enter.succeeded()) { |
| 688 ToGles2Impl(&enter)->GetShaderSource(shader, bufsize, length, source); | 611 ToGles2Impl(&enter)->GetShaderSource(shader, bufsize, length, source); |
| 689 } | 612 } |
| 690 } | 613 } |
| 691 | 614 |
| 692 const GLubyte* GetString(PP_Resource context_id, GLenum name) { | 615 const GLubyte* GetString(PP_Resource context_id, GLenum name) { |
| 693 Enter3D enter(context_id, true); | 616 Enter3D enter(context_id, true); |
| 694 if (enter.succeeded()) { | 617 if (enter.succeeded()) { |
| 695 return ToGles2Impl(&enter)->GetString(name); | 618 return ToGles2Impl(&enter)->GetString(name); |
| 696 } else { | 619 } else { |
| 697 return NULL; | 620 return NULL; |
| 698 } | 621 } |
| 699 } | 622 } |
| 700 | 623 |
| 701 void GetTexParameterfv(PP_Resource context_id, | 624 void GetTexParameterfv( |
| 702 GLenum target, | 625 PP_Resource context_id, GLenum target, GLenum pname, GLfloat* params) { |
| 703 GLenum pname, | |
| 704 GLfloat* params) { | |
| 705 Enter3D enter(context_id, true); | 626 Enter3D enter(context_id, true); |
| 706 if (enter.succeeded()) { | 627 if (enter.succeeded()) { |
| 707 ToGles2Impl(&enter)->GetTexParameterfv(target, pname, params); | 628 ToGles2Impl(&enter)->GetTexParameterfv(target, pname, params); |
| 708 } | 629 } |
| 709 } | 630 } |
| 710 | 631 |
| 711 void GetTexParameteriv(PP_Resource context_id, | 632 void GetTexParameteriv( |
| 712 GLenum target, | 633 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { |
| 713 GLenum pname, | |
| 714 GLint* params) { | |
| 715 Enter3D enter(context_id, true); | 634 Enter3D enter(context_id, true); |
| 716 if (enter.succeeded()) { | 635 if (enter.succeeded()) { |
| 717 ToGles2Impl(&enter)->GetTexParameteriv(target, pname, params); | 636 ToGles2Impl(&enter)->GetTexParameteriv(target, pname, params); |
| 718 } | 637 } |
| 719 } | 638 } |
| 720 | 639 |
| 721 void GetUniformfv(PP_Resource context_id, | 640 void GetUniformfv( |
| 722 GLuint program, | 641 PP_Resource context_id, GLuint program, GLint location, GLfloat* params) { |
| 723 GLint location, | |
| 724 GLfloat* params) { | |
| 725 Enter3D enter(context_id, true); | 642 Enter3D enter(context_id, true); |
| 726 if (enter.succeeded()) { | 643 if (enter.succeeded()) { |
| 727 ToGles2Impl(&enter)->GetUniformfv(program, location, params); | 644 ToGles2Impl(&enter)->GetUniformfv(program, location, params); |
| 728 } | 645 } |
| 729 } | 646 } |
| 730 | 647 |
| 731 void GetUniformiv(PP_Resource context_id, | 648 void GetUniformiv( |
| 732 GLuint program, | 649 PP_Resource context_id, GLuint program, GLint location, GLint* params) { |
| 733 GLint location, | |
| 734 GLint* params) { | |
| 735 Enter3D enter(context_id, true); | 650 Enter3D enter(context_id, true); |
| 736 if (enter.succeeded()) { | 651 if (enter.succeeded()) { |
| 737 ToGles2Impl(&enter)->GetUniformiv(program, location, params); | 652 ToGles2Impl(&enter)->GetUniformiv(program, location, params); |
| 738 } | 653 } |
| 739 } | 654 } |
| 740 | 655 |
| 741 GLint GetUniformLocation(PP_Resource context_id, | 656 GLint GetUniformLocation( |
| 742 GLuint program, | 657 PP_Resource context_id, GLuint program, const char* name) { |
| 743 const char* name) { | |
| 744 Enter3D enter(context_id, true); | 658 Enter3D enter(context_id, true); |
| 745 if (enter.succeeded()) { | 659 if (enter.succeeded()) { |
| 746 return ToGles2Impl(&enter)->GetUniformLocation(program, name); | 660 return ToGles2Impl(&enter)->GetUniformLocation(program, name); |
| 747 } else { | 661 } else { |
| 748 return -1; | 662 return -1; |
| 749 } | 663 } |
| 750 } | 664 } |
| 751 | 665 |
| 752 void GetVertexAttribfv(PP_Resource context_id, | 666 void GetVertexAttribfv( |
| 753 GLuint index, | 667 PP_Resource context_id, GLuint index, GLenum pname, GLfloat* params) { |
| 754 GLenum pname, | |
| 755 GLfloat* params) { | |
| 756 Enter3D enter(context_id, true); | 668 Enter3D enter(context_id, true); |
| 757 if (enter.succeeded()) { | 669 if (enter.succeeded()) { |
| 758 ToGles2Impl(&enter)->GetVertexAttribfv(index, pname, params); | 670 ToGles2Impl(&enter)->GetVertexAttribfv(index, pname, params); |
| 759 } | 671 } |
| 760 } | 672 } |
| 761 | 673 |
| 762 void GetVertexAttribiv(PP_Resource context_id, | 674 void GetVertexAttribiv( |
| 763 GLuint index, | 675 PP_Resource context_id, GLuint index, GLenum pname, GLint* params) { |
| 764 GLenum pname, | |
| 765 GLint* params) { | |
| 766 Enter3D enter(context_id, true); | 676 Enter3D enter(context_id, true); |
| 767 if (enter.succeeded()) { | 677 if (enter.succeeded()) { |
| 768 ToGles2Impl(&enter)->GetVertexAttribiv(index, pname, params); | 678 ToGles2Impl(&enter)->GetVertexAttribiv(index, pname, params); |
| 769 } | 679 } |
| 770 } | 680 } |
| 771 | 681 |
| 772 void GetVertexAttribPointerv(PP_Resource context_id, | 682 void GetVertexAttribPointerv( |
| 773 GLuint index, | 683 PP_Resource context_id, GLuint index, GLenum pname, void** pointer) { |
| 774 GLenum pname, | |
| 775 void** pointer) { | |
| 776 Enter3D enter(context_id, true); | 684 Enter3D enter(context_id, true); |
| 777 if (enter.succeeded()) { | 685 if (enter.succeeded()) { |
| 778 ToGles2Impl(&enter)->GetVertexAttribPointerv(index, pname, pointer); | 686 ToGles2Impl(&enter)->GetVertexAttribPointerv(index, pname, pointer); |
| 779 } | 687 } |
| 780 } | 688 } |
| 781 | 689 |
| 782 void Hint(PP_Resource context_id, GLenum target, GLenum mode) { | 690 void Hint(PP_Resource context_id, GLenum target, GLenum mode) { |
| 783 Enter3D enter(context_id, true); | 691 Enter3D enter(context_id, true); |
| 784 if (enter.succeeded()) { | 692 if (enter.succeeded()) { |
| 785 ToGles2Impl(&enter)->Hint(target, mode); | 693 ToGles2Impl(&enter)->Hint(target, mode); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 870 } | 778 } |
| 871 } | 779 } |
| 872 | 780 |
| 873 void PolygonOffset(PP_Resource context_id, GLfloat factor, GLfloat units) { | 781 void PolygonOffset(PP_Resource context_id, GLfloat factor, GLfloat units) { |
| 874 Enter3D enter(context_id, true); | 782 Enter3D enter(context_id, true); |
| 875 if (enter.succeeded()) { | 783 if (enter.succeeded()) { |
| 876 ToGles2Impl(&enter)->PolygonOffset(factor, units); | 784 ToGles2Impl(&enter)->PolygonOffset(factor, units); |
| 877 } | 785 } |
| 878 } | 786 } |
| 879 | 787 |
| 880 void ReadPixels(PP_Resource context_id, | 788 void ReadPixels( |
| 881 GLint x, | 789 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height, |
| 882 GLint y, | 790 GLenum format, GLenum type, void* pixels) { |
| 883 GLsizei width, | |
| 884 GLsizei height, | |
| 885 GLenum format, | |
| 886 GLenum type, | |
| 887 void* pixels) { | |
| 888 Enter3D enter(context_id, true); | 791 Enter3D enter(context_id, true); |
| 889 if (enter.succeeded()) { | 792 if (enter.succeeded()) { |
| 890 ToGles2Impl(&enter)->ReadPixels(x, y, width, height, format, type, pixels); | 793 ToGles2Impl(&enter)->ReadPixels(x, y, width, height, format, type, pixels); |
| 891 } | 794 } |
| 892 } | 795 } |
| 893 | 796 |
| 894 void ReleaseShaderCompiler(PP_Resource context_id) { | 797 void ReleaseShaderCompiler(PP_Resource context_id) { |
| 895 Enter3D enter(context_id, true); | 798 Enter3D enter(context_id, true); |
| 896 if (enter.succeeded()) { | 799 if (enter.succeeded()) { |
| 897 ToGles2Impl(&enter)->ReleaseShaderCompiler(); | 800 ToGles2Impl(&enter)->ReleaseShaderCompiler(); |
| 898 } | 801 } |
| 899 } | 802 } |
| 900 | 803 |
| 901 void RenderbufferStorage(PP_Resource context_id, | 804 void RenderbufferStorage( |
| 902 GLenum target, | 805 PP_Resource context_id, GLenum target, GLenum internalformat, GLsizei width, |
| 903 GLenum internalformat, | 806 GLsizei height) { |
| 904 GLsizei width, | |
| 905 GLsizei height) { | |
| 906 Enter3D enter(context_id, true); | 807 Enter3D enter(context_id, true); |
| 907 if (enter.succeeded()) { | 808 if (enter.succeeded()) { |
| 908 ToGles2Impl(&enter) | 809 ToGles2Impl( |
| 909 ->RenderbufferStorage(target, internalformat, width, height); | 810 &enter)->RenderbufferStorage(target, internalformat, width, height); |
| 910 } | 811 } |
| 911 } | 812 } |
| 912 | 813 |
| 913 void SampleCoverage(PP_Resource context_id, GLclampf value, GLboolean invert) { | 814 void SampleCoverage(PP_Resource context_id, GLclampf value, GLboolean invert) { |
| 914 Enter3D enter(context_id, true); | 815 Enter3D enter(context_id, true); |
| 915 if (enter.succeeded()) { | 816 if (enter.succeeded()) { |
| 916 ToGles2Impl(&enter)->SampleCoverage(value, invert); | 817 ToGles2Impl(&enter)->SampleCoverage(value, invert); |
| 917 } | 818 } |
| 918 } | 819 } |
| 919 | 820 |
| 920 void Scissor(PP_Resource context_id, | 821 void Scissor( |
| 921 GLint x, | 822 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { |
| 922 GLint y, | |
| 923 GLsizei width, | |
| 924 GLsizei height) { | |
| 925 Enter3D enter(context_id, true); | 823 Enter3D enter(context_id, true); |
| 926 if (enter.succeeded()) { | 824 if (enter.succeeded()) { |
| 927 ToGles2Impl(&enter)->Scissor(x, y, width, height); | 825 ToGles2Impl(&enter)->Scissor(x, y, width, height); |
| 928 } | 826 } |
| 929 } | 827 } |
| 930 | 828 |
| 931 void ShaderBinary(PP_Resource context_id, | 829 void ShaderBinary( |
| 932 GLsizei n, | 830 PP_Resource context_id, GLsizei n, const GLuint* shaders, |
| 933 const GLuint* shaders, | 831 GLenum binaryformat, const void* binary, GLsizei length) { |
| 934 GLenum binaryformat, | |
| 935 const void* binary, | |
| 936 GLsizei length) { | |
| 937 Enter3D enter(context_id, true); | 832 Enter3D enter(context_id, true); |
| 938 if (enter.succeeded()) { | 833 if (enter.succeeded()) { |
| 939 ToGles2Impl(&enter)->ShaderBinary(n, shaders, binaryformat, binary, length); | 834 ToGles2Impl( |
| 835 &enter)->ShaderBinary(n, shaders, binaryformat, binary, length); | |
| 940 } | 836 } |
| 941 } | 837 } |
| 942 | 838 |
| 943 void ShaderSource(PP_Resource context_id, | 839 void ShaderSource( |
| 944 GLuint shader, | 840 PP_Resource context_id, GLuint shader, GLsizei count, const char** str, |
| 945 GLsizei count, | 841 const GLint* length) { |
| 946 const char** str, | |
| 947 const GLint* length) { | |
| 948 Enter3D enter(context_id, true); | 842 Enter3D enter(context_id, true); |
| 949 if (enter.succeeded()) { | 843 if (enter.succeeded()) { |
| 950 ToGles2Impl(&enter)->ShaderSource(shader, count, str, length); | 844 ToGles2Impl(&enter)->ShaderSource(shader, count, str, length); |
| 951 } | 845 } |
| 952 } | 846 } |
| 953 | 847 |
| 954 void StencilFunc(PP_Resource context_id, GLenum func, GLint ref, GLuint mask) { | 848 void StencilFunc(PP_Resource context_id, GLenum func, GLint ref, GLuint mask) { |
| 955 Enter3D enter(context_id, true); | 849 Enter3D enter(context_id, true); |
| 956 if (enter.succeeded()) { | 850 if (enter.succeeded()) { |
| 957 ToGles2Impl(&enter)->StencilFunc(func, ref, mask); | 851 ToGles2Impl(&enter)->StencilFunc(func, ref, mask); |
| 958 } | 852 } |
| 959 } | 853 } |
| 960 | 854 |
| 961 void StencilFuncSeparate(PP_Resource context_id, | 855 void StencilFuncSeparate( |
| 962 GLenum face, | 856 PP_Resource context_id, GLenum face, GLenum func, GLint ref, GLuint mask) { |
| 963 GLenum func, | |
| 964 GLint ref, | |
| 965 GLuint mask) { | |
| 966 Enter3D enter(context_id, true); | 857 Enter3D enter(context_id, true); |
| 967 if (enter.succeeded()) { | 858 if (enter.succeeded()) { |
| 968 ToGles2Impl(&enter)->StencilFuncSeparate(face, func, ref, mask); | 859 ToGles2Impl(&enter)->StencilFuncSeparate(face, func, ref, mask); |
| 969 } | 860 } |
| 970 } | 861 } |
| 971 | 862 |
| 972 void StencilMask(PP_Resource context_id, GLuint mask) { | 863 void StencilMask(PP_Resource context_id, GLuint mask) { |
| 973 Enter3D enter(context_id, true); | 864 Enter3D enter(context_id, true); |
| 974 if (enter.succeeded()) { | 865 if (enter.succeeded()) { |
| 975 ToGles2Impl(&enter)->StencilMask(mask); | 866 ToGles2Impl(&enter)->StencilMask(mask); |
| 976 } | 867 } |
| 977 } | 868 } |
| 978 | 869 |
| 979 void StencilMaskSeparate(PP_Resource context_id, GLenum face, GLuint mask) { | 870 void StencilMaskSeparate(PP_Resource context_id, GLenum face, GLuint mask) { |
| 980 Enter3D enter(context_id, true); | 871 Enter3D enter(context_id, true); |
| 981 if (enter.succeeded()) { | 872 if (enter.succeeded()) { |
| 982 ToGles2Impl(&enter)->StencilMaskSeparate(face, mask); | 873 ToGles2Impl(&enter)->StencilMaskSeparate(face, mask); |
| 983 } | 874 } |
| 984 } | 875 } |
| 985 | 876 |
| 986 void StencilOp(PP_Resource context_id, | 877 void StencilOp( |
| 987 GLenum fail, | 878 PP_Resource context_id, GLenum fail, GLenum zfail, GLenum zpass) { |
| 988 GLenum zfail, | |
| 989 GLenum zpass) { | |
| 990 Enter3D enter(context_id, true); | 879 Enter3D enter(context_id, true); |
| 991 if (enter.succeeded()) { | 880 if (enter.succeeded()) { |
| 992 ToGles2Impl(&enter)->StencilOp(fail, zfail, zpass); | 881 ToGles2Impl(&enter)->StencilOp(fail, zfail, zpass); |
| 993 } | 882 } |
| 994 } | 883 } |
| 995 | 884 |
| 996 void StencilOpSeparate(PP_Resource context_id, | 885 void StencilOpSeparate( |
| 997 GLenum face, | 886 PP_Resource context_id, GLenum face, GLenum fail, GLenum zfail, |
| 998 GLenum fail, | 887 GLenum zpass) { |
| 999 GLenum zfail, | |
| 1000 GLenum zpass) { | |
| 1001 Enter3D enter(context_id, true); | 888 Enter3D enter(context_id, true); |
| 1002 if (enter.succeeded()) { | 889 if (enter.succeeded()) { |
| 1003 ToGles2Impl(&enter)->StencilOpSeparate(face, fail, zfail, zpass); | 890 ToGles2Impl(&enter)->StencilOpSeparate(face, fail, zfail, zpass); |
| 1004 } | 891 } |
| 1005 } | 892 } |
| 1006 | 893 |
| 1007 void TexImage2D(PP_Resource context_id, | 894 void TexImage2D( |
| 1008 GLenum target, | 895 PP_Resource context_id, GLenum target, GLint level, GLint internalformat, |
| 1009 GLint level, | 896 GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, |
| 1010 GLint internalformat, | 897 const void* pixels) { |
| 1011 GLsizei width, | |
| 1012 GLsizei height, | |
| 1013 GLint border, | |
| 1014 GLenum format, | |
| 1015 GLenum type, | |
| 1016 const void* pixels) { | |
| 1017 Enter3D enter(context_id, true); | 898 Enter3D enter(context_id, true); |
| 1018 if (enter.succeeded()) { | 899 if (enter.succeeded()) { |
| 1019 ToGles2Impl(&enter)->TexImage2D(target, | 900 ToGles2Impl( |
| 1020 level, | 901 &enter)->TexImage2D( |
| 1021 internalformat, | 902 target, level, internalformat, width, height, border, format, type, |
| 1022 width, | 903 pixels); |
| 1023 height, | |
| 1024 border, | |
| 1025 format, | |
| 1026 type, | |
| 1027 pixels); | |
| 1028 } | 904 } |
| 1029 } | 905 } |
| 1030 | 906 |
| 1031 void TexParameterf(PP_Resource context_id, | 907 void TexParameterf( |
| 1032 GLenum target, | 908 PP_Resource context_id, GLenum target, GLenum pname, GLfloat param) { |
| 1033 GLenum pname, | |
| 1034 GLfloat param) { | |
| 1035 Enter3D enter(context_id, true); | 909 Enter3D enter(context_id, true); |
| 1036 if (enter.succeeded()) { | 910 if (enter.succeeded()) { |
| 1037 ToGles2Impl(&enter)->TexParameterf(target, pname, param); | 911 ToGles2Impl(&enter)->TexParameterf(target, pname, param); |
| 1038 } | 912 } |
| 1039 } | 913 } |
| 1040 | 914 |
| 1041 void TexParameterfv(PP_Resource context_id, | 915 void TexParameterfv( |
| 1042 GLenum target, | 916 PP_Resource context_id, GLenum target, GLenum pname, |
| 1043 GLenum pname, | 917 const GLfloat* params) { |
| 1044 const GLfloat* params) { | |
| 1045 Enter3D enter(context_id, true); | 918 Enter3D enter(context_id, true); |
| 1046 if (enter.succeeded()) { | 919 if (enter.succeeded()) { |
| 1047 ToGles2Impl(&enter)->TexParameterfv(target, pname, params); | 920 ToGles2Impl(&enter)->TexParameterfv(target, pname, params); |
| 1048 } | 921 } |
| 1049 } | 922 } |
| 1050 | 923 |
| 1051 void TexParameteri(PP_Resource context_id, | 924 void TexParameteri( |
| 1052 GLenum target, | 925 PP_Resource context_id, GLenum target, GLenum pname, GLint param) { |
| 1053 GLenum pname, | |
| 1054 GLint param) { | |
| 1055 Enter3D enter(context_id, true); | 926 Enter3D enter(context_id, true); |
| 1056 if (enter.succeeded()) { | 927 if (enter.succeeded()) { |
| 1057 ToGles2Impl(&enter)->TexParameteri(target, pname, param); | 928 ToGles2Impl(&enter)->TexParameteri(target, pname, param); |
| 1058 } | 929 } |
| 1059 } | 930 } |
| 1060 | 931 |
| 1061 void TexParameteriv(PP_Resource context_id, | 932 void TexParameteriv( |
| 1062 GLenum target, | 933 PP_Resource context_id, GLenum target, GLenum pname, const GLint* params) { |
| 1063 GLenum pname, | |
| 1064 const GLint* params) { | |
| 1065 Enter3D enter(context_id, true); | 934 Enter3D enter(context_id, true); |
| 1066 if (enter.succeeded()) { | 935 if (enter.succeeded()) { |
| 1067 ToGles2Impl(&enter)->TexParameteriv(target, pname, params); | 936 ToGles2Impl(&enter)->TexParameteriv(target, pname, params); |
| 1068 } | 937 } |
| 1069 } | 938 } |
| 1070 | 939 |
| 1071 void TexSubImage2D(PP_Resource context_id, | 940 void TexSubImage2D( |
| 1072 GLenum target, | 941 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, |
| 1073 GLint level, | 942 GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, |
| 1074 GLint xoffset, | 943 const void* pixels) { |
| 1075 GLint yoffset, | |
| 1076 GLsizei width, | |
| 1077 GLsizei height, | |
| 1078 GLenum format, | |
| 1079 GLenum type, | |
| 1080 const void* pixels) { | |
| 1081 Enter3D enter(context_id, true); | 944 Enter3D enter(context_id, true); |
| 1082 if (enter.succeeded()) { | 945 if (enter.succeeded()) { |
| 1083 ToGles2Impl(&enter)->TexSubImage2D( | 946 ToGles2Impl( |
| 1084 target, level, xoffset, yoffset, width, height, format, type, pixels); | 947 &enter)->TexSubImage2D( |
| 948 target, level, xoffset, yoffset, width, height, format, type, | |
| 949 pixels); | |
| 1085 } | 950 } |
| 1086 } | 951 } |
| 1087 | 952 |
| 1088 void Uniform1f(PP_Resource context_id, GLint location, GLfloat x) { | 953 void Uniform1f(PP_Resource context_id, GLint location, GLfloat x) { |
| 1089 Enter3D enter(context_id, true); | 954 Enter3D enter(context_id, true); |
| 1090 if (enter.succeeded()) { | 955 if (enter.succeeded()) { |
| 1091 ToGles2Impl(&enter)->Uniform1f(location, x); | 956 ToGles2Impl(&enter)->Uniform1f(location, x); |
| 1092 } | 957 } |
| 1093 } | 958 } |
| 1094 | 959 |
| 1095 void Uniform1fv(PP_Resource context_id, | 960 void Uniform1fv( |
| 1096 GLint location, | 961 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 1097 GLsizei count, | |
| 1098 const GLfloat* v) { | |
| 1099 Enter3D enter(context_id, true); | 962 Enter3D enter(context_id, true); |
| 1100 if (enter.succeeded()) { | 963 if (enter.succeeded()) { |
| 1101 ToGles2Impl(&enter)->Uniform1fv(location, count, v); | 964 ToGles2Impl(&enter)->Uniform1fv(location, count, v); |
| 1102 } | 965 } |
| 1103 } | 966 } |
| 1104 | 967 |
| 1105 void Uniform1i(PP_Resource context_id, GLint location, GLint x) { | 968 void Uniform1i(PP_Resource context_id, GLint location, GLint x) { |
| 1106 Enter3D enter(context_id, true); | 969 Enter3D enter(context_id, true); |
| 1107 if (enter.succeeded()) { | 970 if (enter.succeeded()) { |
| 1108 ToGles2Impl(&enter)->Uniform1i(location, x); | 971 ToGles2Impl(&enter)->Uniform1i(location, x); |
| 1109 } | 972 } |
| 1110 } | 973 } |
| 1111 | 974 |
| 1112 void Uniform1iv(PP_Resource context_id, | 975 void Uniform1iv( |
| 1113 GLint location, | 976 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 1114 GLsizei count, | |
| 1115 const GLint* v) { | |
| 1116 Enter3D enter(context_id, true); | 977 Enter3D enter(context_id, true); |
| 1117 if (enter.succeeded()) { | 978 if (enter.succeeded()) { |
| 1118 ToGles2Impl(&enter)->Uniform1iv(location, count, v); | 979 ToGles2Impl(&enter)->Uniform1iv(location, count, v); |
| 1119 } | 980 } |
| 1120 } | 981 } |
| 1121 | 982 |
| 1122 void Uniform2f(PP_Resource context_id, GLint location, GLfloat x, GLfloat y) { | 983 void Uniform2f(PP_Resource context_id, GLint location, GLfloat x, GLfloat y) { |
| 1123 Enter3D enter(context_id, true); | 984 Enter3D enter(context_id, true); |
| 1124 if (enter.succeeded()) { | 985 if (enter.succeeded()) { |
| 1125 ToGles2Impl(&enter)->Uniform2f(location, x, y); | 986 ToGles2Impl(&enter)->Uniform2f(location, x, y); |
| 1126 } | 987 } |
| 1127 } | 988 } |
| 1128 | 989 |
| 1129 void Uniform2fv(PP_Resource context_id, | 990 void Uniform2fv( |
| 1130 GLint location, | 991 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 1131 GLsizei count, | |
| 1132 const GLfloat* v) { | |
| 1133 Enter3D enter(context_id, true); | 992 Enter3D enter(context_id, true); |
| 1134 if (enter.succeeded()) { | 993 if (enter.succeeded()) { |
| 1135 ToGles2Impl(&enter)->Uniform2fv(location, count, v); | 994 ToGles2Impl(&enter)->Uniform2fv(location, count, v); |
| 1136 } | 995 } |
| 1137 } | 996 } |
| 1138 | 997 |
| 1139 void Uniform2i(PP_Resource context_id, GLint location, GLint x, GLint y) { | 998 void Uniform2i(PP_Resource context_id, GLint location, GLint x, GLint y) { |
| 1140 Enter3D enter(context_id, true); | 999 Enter3D enter(context_id, true); |
| 1141 if (enter.succeeded()) { | 1000 if (enter.succeeded()) { |
| 1142 ToGles2Impl(&enter)->Uniform2i(location, x, y); | 1001 ToGles2Impl(&enter)->Uniform2i(location, x, y); |
| 1143 } | 1002 } |
| 1144 } | 1003 } |
| 1145 | 1004 |
| 1146 void Uniform2iv(PP_Resource context_id, | 1005 void Uniform2iv( |
| 1147 GLint location, | 1006 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 1148 GLsizei count, | |
| 1149 const GLint* v) { | |
| 1150 Enter3D enter(context_id, true); | 1007 Enter3D enter(context_id, true); |
| 1151 if (enter.succeeded()) { | 1008 if (enter.succeeded()) { |
| 1152 ToGles2Impl(&enter)->Uniform2iv(location, count, v); | 1009 ToGles2Impl(&enter)->Uniform2iv(location, count, v); |
| 1153 } | 1010 } |
| 1154 } | 1011 } |
| 1155 | 1012 |
| 1156 void Uniform3f(PP_Resource context_id, | 1013 void Uniform3f( |
| 1157 GLint location, | 1014 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z) { |
| 1158 GLfloat x, | |
| 1159 GLfloat y, | |
| 1160 GLfloat z) { | |
| 1161 Enter3D enter(context_id, true); | 1015 Enter3D enter(context_id, true); |
| 1162 if (enter.succeeded()) { | 1016 if (enter.succeeded()) { |
| 1163 ToGles2Impl(&enter)->Uniform3f(location, x, y, z); | 1017 ToGles2Impl(&enter)->Uniform3f(location, x, y, z); |
| 1164 } | 1018 } |
| 1165 } | 1019 } |
| 1166 | 1020 |
| 1167 void Uniform3fv(PP_Resource context_id, | 1021 void Uniform3fv( |
| 1168 GLint location, | 1022 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 1169 GLsizei count, | |
| 1170 const GLfloat* v) { | |
| 1171 Enter3D enter(context_id, true); | 1023 Enter3D enter(context_id, true); |
| 1172 if (enter.succeeded()) { | 1024 if (enter.succeeded()) { |
| 1173 ToGles2Impl(&enter)->Uniform3fv(location, count, v); | 1025 ToGles2Impl(&enter)->Uniform3fv(location, count, v); |
| 1174 } | 1026 } |
| 1175 } | 1027 } |
| 1176 | 1028 |
| 1177 void Uniform3i(PP_Resource context_id, | 1029 void Uniform3i( |
| 1178 GLint location, | 1030 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z) { |
| 1179 GLint x, | |
| 1180 GLint y, | |
| 1181 GLint z) { | |
| 1182 Enter3D enter(context_id, true); | 1031 Enter3D enter(context_id, true); |
| 1183 if (enter.succeeded()) { | 1032 if (enter.succeeded()) { |
| 1184 ToGles2Impl(&enter)->Uniform3i(location, x, y, z); | 1033 ToGles2Impl(&enter)->Uniform3i(location, x, y, z); |
| 1185 } | 1034 } |
| 1186 } | 1035 } |
| 1187 | 1036 |
| 1188 void Uniform3iv(PP_Resource context_id, | 1037 void Uniform3iv( |
| 1189 GLint location, | 1038 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 1190 GLsizei count, | |
| 1191 const GLint* v) { | |
| 1192 Enter3D enter(context_id, true); | 1039 Enter3D enter(context_id, true); |
| 1193 if (enter.succeeded()) { | 1040 if (enter.succeeded()) { |
| 1194 ToGles2Impl(&enter)->Uniform3iv(location, count, v); | 1041 ToGles2Impl(&enter)->Uniform3iv(location, count, v); |
| 1195 } | 1042 } |
| 1196 } | 1043 } |
| 1197 | 1044 |
| 1198 void Uniform4f(PP_Resource context_id, | 1045 void Uniform4f( |
| 1199 GLint location, | 1046 PP_Resource context_id, GLint location, GLfloat x, GLfloat y, GLfloat z, |
| 1200 GLfloat x, | 1047 GLfloat w) { |
| 1201 GLfloat y, | |
| 1202 GLfloat z, | |
| 1203 GLfloat w) { | |
| 1204 Enter3D enter(context_id, true); | 1048 Enter3D enter(context_id, true); |
| 1205 if (enter.succeeded()) { | 1049 if (enter.succeeded()) { |
| 1206 ToGles2Impl(&enter)->Uniform4f(location, x, y, z, w); | 1050 ToGles2Impl(&enter)->Uniform4f(location, x, y, z, w); |
| 1207 } | 1051 } |
| 1208 } | 1052 } |
| 1209 | 1053 |
| 1210 void Uniform4fv(PP_Resource context_id, | 1054 void Uniform4fv( |
| 1211 GLint location, | 1055 PP_Resource context_id, GLint location, GLsizei count, const GLfloat* v) { |
| 1212 GLsizei count, | |
| 1213 const GLfloat* v) { | |
| 1214 Enter3D enter(context_id, true); | 1056 Enter3D enter(context_id, true); |
| 1215 if (enter.succeeded()) { | 1057 if (enter.succeeded()) { |
| 1216 ToGles2Impl(&enter)->Uniform4fv(location, count, v); | 1058 ToGles2Impl(&enter)->Uniform4fv(location, count, v); |
| 1217 } | 1059 } |
| 1218 } | 1060 } |
| 1219 | 1061 |
| 1220 void Uniform4i(PP_Resource context_id, | 1062 void Uniform4i( |
| 1221 GLint location, | 1063 PP_Resource context_id, GLint location, GLint x, GLint y, GLint z, |
| 1222 GLint x, | 1064 GLint w) { |
| 1223 GLint y, | |
| 1224 GLint z, | |
| 1225 GLint w) { | |
| 1226 Enter3D enter(context_id, true); | 1065 Enter3D enter(context_id, true); |
| 1227 if (enter.succeeded()) { | 1066 if (enter.succeeded()) { |
| 1228 ToGles2Impl(&enter)->Uniform4i(location, x, y, z, w); | 1067 ToGles2Impl(&enter)->Uniform4i(location, x, y, z, w); |
| 1229 } | 1068 } |
| 1230 } | 1069 } |
| 1231 | 1070 |
| 1232 void Uniform4iv(PP_Resource context_id, | 1071 void Uniform4iv( |
| 1233 GLint location, | 1072 PP_Resource context_id, GLint location, GLsizei count, const GLint* v) { |
| 1234 GLsizei count, | |
| 1235 const GLint* v) { | |
| 1236 Enter3D enter(context_id, true); | 1073 Enter3D enter(context_id, true); |
| 1237 if (enter.succeeded()) { | 1074 if (enter.succeeded()) { |
| 1238 ToGles2Impl(&enter)->Uniform4iv(location, count, v); | 1075 ToGles2Impl(&enter)->Uniform4iv(location, count, v); |
| 1239 } | 1076 } |
| 1240 } | 1077 } |
| 1241 | 1078 |
| 1242 void UniformMatrix2fv(PP_Resource context_id, | 1079 void UniformMatrix2fv( |
| 1243 GLint location, | 1080 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, |
| 1244 GLsizei count, | 1081 const GLfloat* value) { |
| 1245 GLboolean transpose, | |
| 1246 const GLfloat* value) { | |
| 1247 Enter3D enter(context_id, true); | 1082 Enter3D enter(context_id, true); |
| 1248 if (enter.succeeded()) { | 1083 if (enter.succeeded()) { |
| 1249 ToGles2Impl(&enter)->UniformMatrix2fv(location, count, transpose, value); | 1084 ToGles2Impl(&enter)->UniformMatrix2fv(location, count, transpose, value); |
| 1250 } | 1085 } |
| 1251 } | 1086 } |
| 1252 | 1087 |
| 1253 void UniformMatrix3fv(PP_Resource context_id, | 1088 void UniformMatrix3fv( |
| 1254 GLint location, | 1089 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, |
| 1255 GLsizei count, | 1090 const GLfloat* value) { |
| 1256 GLboolean transpose, | |
| 1257 const GLfloat* value) { | |
| 1258 Enter3D enter(context_id, true); | 1091 Enter3D enter(context_id, true); |
| 1259 if (enter.succeeded()) { | 1092 if (enter.succeeded()) { |
| 1260 ToGles2Impl(&enter)->UniformMatrix3fv(location, count, transpose, value); | 1093 ToGles2Impl(&enter)->UniformMatrix3fv(location, count, transpose, value); |
| 1261 } | 1094 } |
| 1262 } | 1095 } |
| 1263 | 1096 |
| 1264 void UniformMatrix4fv(PP_Resource context_id, | 1097 void UniformMatrix4fv( |
| 1265 GLint location, | 1098 PP_Resource context_id, GLint location, GLsizei count, GLboolean transpose, |
| 1266 GLsizei count, | 1099 const GLfloat* value) { |
| 1267 GLboolean transpose, | |
| 1268 const GLfloat* value) { | |
| 1269 Enter3D enter(context_id, true); | 1100 Enter3D enter(context_id, true); |
| 1270 if (enter.succeeded()) { | 1101 if (enter.succeeded()) { |
| 1271 ToGles2Impl(&enter)->UniformMatrix4fv(location, count, transpose, value); | 1102 ToGles2Impl(&enter)->UniformMatrix4fv(location, count, transpose, value); |
| 1272 } | 1103 } |
| 1273 } | 1104 } |
| 1274 | 1105 |
| 1275 void UseProgram(PP_Resource context_id, GLuint program) { | 1106 void UseProgram(PP_Resource context_id, GLuint program) { |
| 1276 Enter3D enter(context_id, true); | 1107 Enter3D enter(context_id, true); |
| 1277 if (enter.succeeded()) { | 1108 if (enter.succeeded()) { |
| 1278 ToGles2Impl(&enter)->UseProgram(program); | 1109 ToGles2Impl(&enter)->UseProgram(program); |
| 1279 } | 1110 } |
| 1280 } | 1111 } |
| 1281 | 1112 |
| 1282 void ValidateProgram(PP_Resource context_id, GLuint program) { | 1113 void ValidateProgram(PP_Resource context_id, GLuint program) { |
| 1283 Enter3D enter(context_id, true); | 1114 Enter3D enter(context_id, true); |
| 1284 if (enter.succeeded()) { | 1115 if (enter.succeeded()) { |
| 1285 ToGles2Impl(&enter)->ValidateProgram(program); | 1116 ToGles2Impl(&enter)->ValidateProgram(program); |
| 1286 } | 1117 } |
| 1287 } | 1118 } |
| 1288 | 1119 |
| 1289 void VertexAttrib1f(PP_Resource context_id, GLuint indx, GLfloat x) { | 1120 void VertexAttrib1f(PP_Resource context_id, GLuint indx, GLfloat x) { |
| 1290 Enter3D enter(context_id, true); | 1121 Enter3D enter(context_id, true); |
| 1291 if (enter.succeeded()) { | 1122 if (enter.succeeded()) { |
| 1292 ToGles2Impl(&enter)->VertexAttrib1f(indx, x); | 1123 ToGles2Impl(&enter)->VertexAttrib1f(indx, x); |
| 1293 } | 1124 } |
| 1294 } | 1125 } |
| 1295 | 1126 |
| 1296 void VertexAttrib1fv(PP_Resource context_id, | 1127 void VertexAttrib1fv( |
| 1297 GLuint indx, | 1128 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 1298 const GLfloat* values) { | |
| 1299 Enter3D enter(context_id, true); | 1129 Enter3D enter(context_id, true); |
| 1300 if (enter.succeeded()) { | 1130 if (enter.succeeded()) { |
| 1301 ToGles2Impl(&enter)->VertexAttrib1fv(indx, values); | 1131 ToGles2Impl(&enter)->VertexAttrib1fv(indx, values); |
| 1302 } | 1132 } |
| 1303 } | 1133 } |
| 1304 | 1134 |
| 1305 void VertexAttrib2f(PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y) { | 1135 void VertexAttrib2f( |
| 1136 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y) { | |
| 1306 Enter3D enter(context_id, true); | 1137 Enter3D enter(context_id, true); |
| 1307 if (enter.succeeded()) { | 1138 if (enter.succeeded()) { |
| 1308 ToGles2Impl(&enter)->VertexAttrib2f(indx, x, y); | 1139 ToGles2Impl(&enter)->VertexAttrib2f(indx, x, y); |
| 1309 } | 1140 } |
| 1310 } | 1141 } |
| 1311 | 1142 |
| 1312 void VertexAttrib2fv(PP_Resource context_id, | 1143 void VertexAttrib2fv( |
| 1313 GLuint indx, | 1144 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 1314 const GLfloat* values) { | |
| 1315 Enter3D enter(context_id, true); | 1145 Enter3D enter(context_id, true); |
| 1316 if (enter.succeeded()) { | 1146 if (enter.succeeded()) { |
| 1317 ToGles2Impl(&enter)->VertexAttrib2fv(indx, values); | 1147 ToGles2Impl(&enter)->VertexAttrib2fv(indx, values); |
| 1318 } | 1148 } |
| 1319 } | 1149 } |
| 1320 | 1150 |
| 1321 void VertexAttrib3f(PP_Resource context_id, | 1151 void VertexAttrib3f( |
| 1322 GLuint indx, | 1152 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z) { |
| 1323 GLfloat x, | |
| 1324 GLfloat y, | |
| 1325 GLfloat z) { | |
| 1326 Enter3D enter(context_id, true); | 1153 Enter3D enter(context_id, true); |
| 1327 if (enter.succeeded()) { | 1154 if (enter.succeeded()) { |
| 1328 ToGles2Impl(&enter)->VertexAttrib3f(indx, x, y, z); | 1155 ToGles2Impl(&enter)->VertexAttrib3f(indx, x, y, z); |
| 1329 } | 1156 } |
| 1330 } | 1157 } |
| 1331 | 1158 |
| 1332 void VertexAttrib3fv(PP_Resource context_id, | 1159 void VertexAttrib3fv( |
| 1333 GLuint indx, | 1160 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 1334 const GLfloat* values) { | |
| 1335 Enter3D enter(context_id, true); | 1161 Enter3D enter(context_id, true); |
| 1336 if (enter.succeeded()) { | 1162 if (enter.succeeded()) { |
| 1337 ToGles2Impl(&enter)->VertexAttrib3fv(indx, values); | 1163 ToGles2Impl(&enter)->VertexAttrib3fv(indx, values); |
| 1338 } | 1164 } |
| 1339 } | 1165 } |
| 1340 | 1166 |
| 1341 void VertexAttrib4f(PP_Resource context_id, | 1167 void VertexAttrib4f( |
| 1342 GLuint indx, | 1168 PP_Resource context_id, GLuint indx, GLfloat x, GLfloat y, GLfloat z, |
| 1343 GLfloat x, | 1169 GLfloat w) { |
| 1344 GLfloat y, | |
| 1345 GLfloat z, | |
| 1346 GLfloat w) { | |
| 1347 Enter3D enter(context_id, true); | 1170 Enter3D enter(context_id, true); |
| 1348 if (enter.succeeded()) { | 1171 if (enter.succeeded()) { |
| 1349 ToGles2Impl(&enter)->VertexAttrib4f(indx, x, y, z, w); | 1172 ToGles2Impl(&enter)->VertexAttrib4f(indx, x, y, z, w); |
| 1350 } | 1173 } |
| 1351 } | 1174 } |
| 1352 | 1175 |
| 1353 void VertexAttrib4fv(PP_Resource context_id, | 1176 void VertexAttrib4fv( |
| 1354 GLuint indx, | 1177 PP_Resource context_id, GLuint indx, const GLfloat* values) { |
| 1355 const GLfloat* values) { | |
| 1356 Enter3D enter(context_id, true); | 1178 Enter3D enter(context_id, true); |
| 1357 if (enter.succeeded()) { | 1179 if (enter.succeeded()) { |
| 1358 ToGles2Impl(&enter)->VertexAttrib4fv(indx, values); | 1180 ToGles2Impl(&enter)->VertexAttrib4fv(indx, values); |
| 1359 } | 1181 } |
| 1360 } | 1182 } |
| 1361 | 1183 |
| 1362 void VertexAttribPointer(PP_Resource context_id, | 1184 void VertexAttribPointer( |
| 1363 GLuint indx, | 1185 PP_Resource context_id, GLuint indx, GLint size, GLenum type, |
| 1364 GLint size, | 1186 GLboolean normalized, GLsizei stride, const void* ptr) { |
| 1365 GLenum type, | |
| 1366 GLboolean normalized, | |
| 1367 GLsizei stride, | |
| 1368 const void* ptr) { | |
| 1369 Enter3D enter(context_id, true); | 1187 Enter3D enter(context_id, true); |
| 1370 if (enter.succeeded()) { | 1188 if (enter.succeeded()) { |
| 1371 ToGles2Impl(&enter) | 1189 ToGles2Impl( |
| 1372 ->VertexAttribPointer(indx, size, type, normalized, stride, ptr); | 1190 &enter)->VertexAttribPointer( |
| 1191 indx, size, type, normalized, stride, ptr); | |
| 1373 } | 1192 } |
| 1374 } | 1193 } |
| 1375 | 1194 |
| 1376 void Viewport(PP_Resource context_id, | 1195 void Viewport( |
| 1377 GLint x, | 1196 PP_Resource context_id, GLint x, GLint y, GLsizei width, GLsizei height) { |
| 1378 GLint y, | |
| 1379 GLsizei width, | |
| 1380 GLsizei height) { | |
| 1381 Enter3D enter(context_id, true); | 1197 Enter3D enter(context_id, true); |
| 1382 if (enter.succeeded()) { | 1198 if (enter.succeeded()) { |
| 1383 ToGles2Impl(&enter)->Viewport(x, y, width, height); | 1199 ToGles2Impl(&enter)->Viewport(x, y, width, height); |
| 1384 } | 1200 } |
| 1385 } | 1201 } |
| 1386 | 1202 |
| 1387 void BlitFramebufferEXT(PP_Resource context_id, | 1203 void BlitFramebufferEXT( |
| 1388 GLint srcX0, | 1204 PP_Resource context_id, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, |
| 1389 GLint srcY0, | 1205 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, |
| 1390 GLint srcX1, | 1206 GLenum filter) { |
| 1391 GLint srcY1, | |
| 1392 GLint dstX0, | |
| 1393 GLint dstY0, | |
| 1394 GLint dstX1, | |
| 1395 GLint dstY1, | |
| 1396 GLbitfield mask, | |
| 1397 GLenum filter) { | |
| 1398 Enter3D enter(context_id, true); | 1207 Enter3D enter(context_id, true); |
| 1399 if (enter.succeeded()) { | 1208 if (enter.succeeded()) { |
| 1400 ToGles2Impl(&enter)->BlitFramebufferCHROMIUM( | 1209 ToGles2Impl( |
| 1401 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 1210 &enter)->BlitFramebufferCHROMIUM( |
| 1211 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, | |
| 1212 filter); | |
| 1402 } | 1213 } |
| 1403 } | 1214 } |
| 1404 | 1215 |
| 1405 void RenderbufferStorageMultisampleEXT(PP_Resource context_id, | 1216 void RenderbufferStorageMultisampleEXT( |
| 1406 GLenum target, | 1217 PP_Resource context_id, GLenum target, GLsizei samples, |
| 1407 GLsizei samples, | 1218 GLenum internalformat, GLsizei width, GLsizei height) { |
| 1408 GLenum internalformat, | |
| 1409 GLsizei width, | |
| 1410 GLsizei height) { | |
| 1411 Enter3D enter(context_id, true); | 1219 Enter3D enter(context_id, true); |
| 1412 if (enter.succeeded()) { | 1220 if (enter.succeeded()) { |
| 1413 ToGles2Impl(&enter)->RenderbufferStorageMultisampleCHROMIUM( | 1221 ToGles2Impl( |
| 1414 target, samples, internalformat, width, height); | 1222 &enter)->RenderbufferStorageMultisampleCHROMIUM( |
| 1223 target, samples, internalformat, width, height); | |
| 1415 } | 1224 } |
| 1416 } | 1225 } |
| 1417 | 1226 |
| 1418 void GenQueriesEXT(PP_Resource context_id, GLsizei n, GLuint* queries) { | 1227 void GenQueriesEXT(PP_Resource context_id, GLsizei n, GLuint* queries) { |
| 1419 Enter3D enter(context_id, true); | 1228 Enter3D enter(context_id, true); |
| 1420 if (enter.succeeded()) { | 1229 if (enter.succeeded()) { |
| 1421 ToGles2Impl(&enter)->GenQueriesEXT(n, queries); | 1230 ToGles2Impl(&enter)->GenQueriesEXT(n, queries); |
| 1422 } | 1231 } |
| 1423 } | 1232 } |
| 1424 | 1233 |
| 1425 void DeleteQueriesEXT(PP_Resource context_id, | 1234 void DeleteQueriesEXT( |
| 1426 GLsizei n, | 1235 PP_Resource context_id, GLsizei n, const GLuint* queries) { |
| 1427 const GLuint* queries) { | |
| 1428 Enter3D enter(context_id, true); | 1236 Enter3D enter(context_id, true); |
| 1429 if (enter.succeeded()) { | 1237 if (enter.succeeded()) { |
| 1430 ToGles2Impl(&enter)->DeleteQueriesEXT(n, queries); | 1238 ToGles2Impl(&enter)->DeleteQueriesEXT(n, queries); |
| 1431 } | 1239 } |
| 1432 } | 1240 } |
| 1433 | 1241 |
| 1434 GLboolean IsQueryEXT(PP_Resource context_id, GLuint id) { | 1242 GLboolean IsQueryEXT(PP_Resource context_id, GLuint id) { |
| 1435 Enter3D enter(context_id, true); | 1243 Enter3D enter(context_id, true); |
| 1436 if (enter.succeeded()) { | 1244 if (enter.succeeded()) { |
| 1437 return ToGles2Impl(&enter)->IsQueryEXT(id); | 1245 return ToGles2Impl(&enter)->IsQueryEXT(id); |
| 1438 } else { | 1246 } else { |
| 1439 return GL_FALSE; | 1247 return GL_FALSE; |
| 1440 } | 1248 } |
| 1441 } | 1249 } |
| 1442 | 1250 |
| 1443 void BeginQueryEXT(PP_Resource context_id, GLenum target, GLuint id) { | 1251 void BeginQueryEXT(PP_Resource context_id, GLenum target, GLuint id) { |
| 1444 Enter3D enter(context_id, true); | 1252 Enter3D enter(context_id, true); |
| 1445 if (enter.succeeded()) { | 1253 if (enter.succeeded()) { |
| 1446 ToGles2Impl(&enter)->BeginQueryEXT(target, id); | 1254 ToGles2Impl(&enter)->BeginQueryEXT(target, id); |
| 1447 } | 1255 } |
| 1448 } | 1256 } |
| 1449 | 1257 |
| 1450 void EndQueryEXT(PP_Resource context_id, GLenum target) { | 1258 void EndQueryEXT(PP_Resource context_id, GLenum target) { |
| 1451 Enter3D enter(context_id, true); | 1259 Enter3D enter(context_id, true); |
| 1452 if (enter.succeeded()) { | 1260 if (enter.succeeded()) { |
| 1453 ToGles2Impl(&enter)->EndQueryEXT(target); | 1261 ToGles2Impl(&enter)->EndQueryEXT(target); |
| 1454 } | 1262 } |
| 1455 } | 1263 } |
| 1456 | 1264 |
| 1457 void GetQueryivEXT(PP_Resource context_id, | 1265 void GetQueryivEXT( |
| 1458 GLenum target, | 1266 PP_Resource context_id, GLenum target, GLenum pname, GLint* params) { |
| 1459 GLenum pname, | |
| 1460 GLint* params) { | |
| 1461 Enter3D enter(context_id, true); | 1267 Enter3D enter(context_id, true); |
| 1462 if (enter.succeeded()) { | 1268 if (enter.succeeded()) { |
| 1463 ToGles2Impl(&enter)->GetQueryivEXT(target, pname, params); | 1269 ToGles2Impl(&enter)->GetQueryivEXT(target, pname, params); |
| 1464 } | 1270 } |
| 1465 } | 1271 } |
| 1466 | 1272 |
| 1467 void GetQueryObjectuivEXT(PP_Resource context_id, | 1273 void GetQueryObjectuivEXT( |
| 1468 GLuint id, | 1274 PP_Resource context_id, GLuint id, GLenum pname, GLuint* params) { |
| 1469 GLenum pname, | |
| 1470 GLuint* params) { | |
| 1471 Enter3D enter(context_id, true); | 1275 Enter3D enter(context_id, true); |
| 1472 if (enter.succeeded()) { | 1276 if (enter.succeeded()) { |
| 1473 ToGles2Impl(&enter)->GetQueryObjectuivEXT(id, pname, params); | 1277 ToGles2Impl(&enter)->GetQueryObjectuivEXT(id, pname, params); |
| 1474 } | 1278 } |
| 1475 } | 1279 } |
| 1476 | 1280 |
| 1477 GLboolean EnableFeatureCHROMIUM(PP_Resource context_id, const char* feature) { | 1281 GLboolean EnableFeatureCHROMIUM(PP_Resource context_id, const char* feature) { |
| 1478 Enter3D enter(context_id, true); | 1282 Enter3D enter(context_id, true); |
| 1479 if (enter.succeeded()) { | 1283 if (enter.succeeded()) { |
| 1480 return ToGles2Impl(&enter)->EnableFeatureCHROMIUM(feature); | 1284 return ToGles2Impl(&enter)->EnableFeatureCHROMIUM(feature); |
| 1481 } else { | 1285 } else { |
| 1482 return GL_FALSE; | 1286 return GL_FALSE; |
| 1483 } | 1287 } |
| 1484 } | 1288 } |
| 1485 | 1289 |
| 1486 void* MapBufferSubDataCHROMIUM(PP_Resource context_id, | 1290 void* MapBufferSubDataCHROMIUM( |
| 1487 GLuint target, | 1291 PP_Resource context_id, GLuint target, GLintptr offset, GLsizeiptr size, |
| 1488 GLintptr offset, | 1292 GLenum access) { |
| 1489 GLsizeiptr size, | |
| 1490 GLenum access) { | |
| 1491 Enter3D enter(context_id, true); | 1293 Enter3D enter(context_id, true); |
| 1492 if (enter.succeeded()) { | 1294 if (enter.succeeded()) { |
| 1493 return ToGles2Impl(&enter) | 1295 return ToGles2Impl( |
| 1494 ->MapBufferSubDataCHROMIUM(target, offset, size, access); | 1296 &enter)->MapBufferSubDataCHROMIUM(target, offset, size, access); |
| 1495 } else { | 1297 } else { |
| 1496 return NULL; | 1298 return NULL; |
| 1497 } | 1299 } |
| 1498 } | 1300 } |
| 1499 | 1301 |
| 1500 void UnmapBufferSubDataCHROMIUM(PP_Resource context_id, const void* mem) { | 1302 void UnmapBufferSubDataCHROMIUM(PP_Resource context_id, const void* mem) { |
| 1501 Enter3D enter(context_id, true); | 1303 Enter3D enter(context_id, true); |
| 1502 if (enter.succeeded()) { | 1304 if (enter.succeeded()) { |
| 1503 ToGles2Impl(&enter)->UnmapBufferSubDataCHROMIUM(mem); | 1305 ToGles2Impl(&enter)->UnmapBufferSubDataCHROMIUM(mem); |
| 1504 } | 1306 } |
| 1505 } | 1307 } |
| 1506 | 1308 |
| 1507 void* MapTexSubImage2DCHROMIUM(PP_Resource context_id, | 1309 void* MapTexSubImage2DCHROMIUM( |
| 1508 GLenum target, | 1310 PP_Resource context_id, GLenum target, GLint level, GLint xoffset, |
| 1509 GLint level, | 1311 GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, |
| 1510 GLint xoffset, | 1312 GLenum access) { |
| 1511 GLint yoffset, | |
| 1512 GLsizei width, | |
| 1513 GLsizei height, | |
| 1514 GLenum format, | |
| 1515 GLenum type, | |
| 1516 GLenum access) { | |
| 1517 Enter3D enter(context_id, true); | 1313 Enter3D enter(context_id, true); |
| 1518 if (enter.succeeded()) { | 1314 if (enter.succeeded()) { |
| 1519 return ToGles2Impl(&enter)->MapTexSubImage2DCHROMIUM( | 1315 return ToGles2Impl( |
| 1520 target, level, xoffset, yoffset, width, height, format, type, access); | 1316 &enter)->MapTexSubImage2DCHROMIUM( |
| 1317 target, level, xoffset, yoffset, width, height, format, type, | |
| 1318 access); | |
| 1521 } else { | 1319 } else { |
| 1522 return NULL; | 1320 return NULL; |
| 1523 } | 1321 } |
| 1524 } | 1322 } |
| 1525 | 1323 |
| 1526 void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id, const void* mem) { | 1324 void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id, const void* mem) { |
| 1527 Enter3D enter(context_id, true); | 1325 Enter3D enter(context_id, true); |
| 1528 if (enter.succeeded()) { | 1326 if (enter.succeeded()) { |
| 1529 ToGles2Impl(&enter)->UnmapTexSubImage2DCHROMIUM(mem); | 1327 ToGles2Impl(&enter)->UnmapTexSubImage2DCHROMIUM(mem); |
| 1530 } | 1328 } |
| 1531 } | 1329 } |
| 1532 | 1330 |
| 1533 void DrawArraysInstancedANGLE(PP_Resource context_id, | 1331 void DrawArraysInstancedANGLE( |
| 1534 GLenum mode, | 1332 PP_Resource context_id, GLenum mode, GLint first, GLsizei count, |
| 1535 GLint first, | 1333 GLsizei primcount) { |
| 1536 GLsizei count, | |
| 1537 GLsizei primcount) { | |
| 1538 Enter3D enter(context_id, true); | 1334 Enter3D enter(context_id, true); |
| 1539 if (enter.succeeded()) { | 1335 if (enter.succeeded()) { |
| 1540 ToGles2Impl(&enter) | 1336 ToGles2Impl( |
| 1541 ->DrawArraysInstancedANGLE(mode, first, count, primcount); | 1337 &enter)->DrawArraysInstancedANGLE(mode, first, count, primcount); |
| 1542 } | 1338 } |
| 1543 } | 1339 } |
| 1544 | 1340 |
| 1545 void DrawElementsInstancedANGLE(PP_Resource context_id, | 1341 void DrawElementsInstancedANGLE( |
| 1546 GLenum mode, | 1342 PP_Resource context_id, GLenum mode, GLsizei count, GLenum type, |
| 1547 GLsizei count, | 1343 const void* indices, GLsizei primcount) { |
| 1548 GLenum type, | |
| 1549 const void* indices, | |
| 1550 GLsizei primcount) { | |
| 1551 Enter3D enter(context_id, true); | 1344 Enter3D enter(context_id, true); |
| 1552 if (enter.succeeded()) { | 1345 if (enter.succeeded()) { |
| 1553 ToGles2Impl(&enter) | 1346 ToGles2Impl( |
| 1554 ->DrawElementsInstancedANGLE(mode, count, type, indices, primcount); | 1347 &enter)->DrawElementsInstancedANGLE( |
| 1348 mode, count, type, indices, primcount); | |
| 1555 } | 1349 } |
| 1556 } | 1350 } |
| 1557 | 1351 |
| 1558 void VertexAttribDivisorANGLE(PP_Resource context_id, | 1352 void VertexAttribDivisorANGLE( |
| 1559 GLuint index, | 1353 PP_Resource context_id, GLuint index, GLuint divisor) { |
| 1560 GLuint divisor) { | |
| 1561 Enter3D enter(context_id, true); | 1354 Enter3D enter(context_id, true); |
| 1562 if (enter.succeeded()) { | 1355 if (enter.succeeded()) { |
| 1563 ToGles2Impl(&enter)->VertexAttribDivisorANGLE(index, divisor); | 1356 ToGles2Impl(&enter)->VertexAttribDivisorANGLE(index, divisor); |
| 1564 } | 1357 } |
| 1565 } | 1358 } |
| 1566 | 1359 |
| 1567 } // namespace | 1360 } // namespace |
| 1568 const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() { | 1361 const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() { |
| 1569 static const struct PPB_OpenGLES2 ppb_opengles2 = { | 1362 static const struct PPB_OpenGLES2 ppb_opengles2 = { |
| 1570 &ActiveTexture, &AttachShader, | 1363 &ActiveTexture, |
|
Zhenyao Mo
2014/03/04 16:13:16
Ah, this should be 4-space instead of 2.
I'll lea
| |
| 1571 &BindAttribLocation, &BindBuffer, | 1364 &AttachShader, |
| 1572 &BindFramebuffer, &BindRenderbuffer, | 1365 &BindAttribLocation, |
| 1573 &BindTexture, &BlendColor, | 1366 &BindBuffer, |
| 1574 &BlendEquation, &BlendEquationSeparate, | 1367 &BindFramebuffer, |
| 1575 &BlendFunc, &BlendFuncSeparate, | 1368 &BindRenderbuffer, |
| 1576 &BufferData, &BufferSubData, | 1369 &BindTexture, |
| 1577 &CheckFramebufferStatus, &Clear, | 1370 &BlendColor, |
| 1578 &ClearColor, &ClearDepthf, | 1371 &BlendEquation, |
| 1579 &ClearStencil, &ColorMask, | 1372 &BlendEquationSeparate, |
| 1580 &CompileShader, &CompressedTexImage2D, | 1373 &BlendFunc, |
| 1581 &CompressedTexSubImage2D, &CopyTexImage2D, | 1374 &BlendFuncSeparate, |
| 1582 &CopyTexSubImage2D, &CreateProgram, | 1375 &BufferData, |
| 1583 &CreateShader, &CullFace, | 1376 &BufferSubData, |
| 1584 &DeleteBuffers, &DeleteFramebuffers, | 1377 &CheckFramebufferStatus, |
| 1585 &DeleteProgram, &DeleteRenderbuffers, | 1378 &Clear, |
| 1586 &DeleteShader, &DeleteTextures, | 1379 &ClearColor, |
| 1587 &DepthFunc, &DepthMask, | 1380 &ClearDepthf, |
| 1588 &DepthRangef, &DetachShader, | 1381 &ClearStencil, |
| 1589 &Disable, &DisableVertexAttribArray, | 1382 &ColorMask, |
| 1590 &DrawArrays, &DrawElements, | 1383 &CompileShader, |
| 1591 &Enable, &EnableVertexAttribArray, | 1384 &CompressedTexImage2D, |
| 1592 &Finish, &Flush, | 1385 &CompressedTexSubImage2D, |
| 1593 &FramebufferRenderbuffer, &FramebufferTexture2D, | 1386 &CopyTexImage2D, |
| 1594 &FrontFace, &GenBuffers, | 1387 &CopyTexSubImage2D, |
| 1595 &GenerateMipmap, &GenFramebuffers, | 1388 &CreateProgram, |
| 1596 &GenRenderbuffers, &GenTextures, | 1389 &CreateShader, |
| 1597 &GetActiveAttrib, &GetActiveUniform, | 1390 &CullFace, |
| 1598 &GetAttachedShaders, &GetAttribLocation, | 1391 &DeleteBuffers, |
| 1599 &GetBooleanv, &GetBufferParameteriv, | 1392 &DeleteFramebuffers, |
| 1600 &GetError, &GetFloatv, | 1393 &DeleteProgram, |
| 1601 &GetFramebufferAttachmentParameteriv, &GetIntegerv, | 1394 &DeleteRenderbuffers, |
| 1602 &GetProgramiv, &GetProgramInfoLog, | 1395 &DeleteShader, |
| 1603 &GetRenderbufferParameteriv, &GetShaderiv, | 1396 &DeleteTextures, |
| 1604 &GetShaderInfoLog, &GetShaderPrecisionFormat, | 1397 &DepthFunc, |
| 1605 &GetShaderSource, &GetString, | 1398 &DepthMask, |
| 1606 &GetTexParameterfv, &GetTexParameteriv, | 1399 &DepthRangef, |
| 1607 &GetUniformfv, &GetUniformiv, | 1400 &DetachShader, |
| 1608 &GetUniformLocation, &GetVertexAttribfv, | 1401 &Disable, |
| 1609 &GetVertexAttribiv, &GetVertexAttribPointerv, | 1402 &DisableVertexAttribArray, |
| 1610 &Hint, &IsBuffer, | 1403 &DrawArrays, |
| 1611 &IsEnabled, &IsFramebuffer, | 1404 &DrawElements, |
| 1612 &IsProgram, &IsRenderbuffer, | 1405 &Enable, |
| 1613 &IsShader, &IsTexture, | 1406 &EnableVertexAttribArray, |
| 1614 &LineWidth, &LinkProgram, | 1407 &Finish, |
| 1615 &PixelStorei, &PolygonOffset, | 1408 &Flush, |
| 1616 &ReadPixels, &ReleaseShaderCompiler, | 1409 &FramebufferRenderbuffer, |
| 1617 &RenderbufferStorage, &SampleCoverage, | 1410 &FramebufferTexture2D, |
| 1618 &Scissor, &ShaderBinary, | 1411 &FrontFace, |
| 1619 &ShaderSource, &StencilFunc, | 1412 &GenBuffers, |
| 1620 &StencilFuncSeparate, &StencilMask, | 1413 &GenerateMipmap, |
| 1621 &StencilMaskSeparate, &StencilOp, | 1414 &GenFramebuffers, |
| 1622 &StencilOpSeparate, &TexImage2D, | 1415 &GenRenderbuffers, |
| 1623 &TexParameterf, &TexParameterfv, | 1416 &GenTextures, |
| 1624 &TexParameteri, &TexParameteriv, | 1417 &GetActiveAttrib, |
| 1625 &TexSubImage2D, &Uniform1f, | 1418 &GetActiveUniform, |
| 1626 &Uniform1fv, &Uniform1i, | 1419 &GetAttachedShaders, |
| 1627 &Uniform1iv, &Uniform2f, | 1420 &GetAttribLocation, |
| 1628 &Uniform2fv, &Uniform2i, | 1421 &GetBooleanv, |
| 1629 &Uniform2iv, &Uniform3f, | 1422 &GetBufferParameteriv, |
| 1630 &Uniform3fv, &Uniform3i, | 1423 &GetError, |
| 1631 &Uniform3iv, &Uniform4f, | 1424 &GetFloatv, |
| 1632 &Uniform4fv, &Uniform4i, | 1425 &GetFramebufferAttachmentParameteriv, |
| 1633 &Uniform4iv, &UniformMatrix2fv, | 1426 &GetIntegerv, |
| 1634 &UniformMatrix3fv, &UniformMatrix4fv, | 1427 &GetProgramiv, |
| 1635 &UseProgram, &ValidateProgram, | 1428 &GetProgramInfoLog, |
| 1636 &VertexAttrib1f, &VertexAttrib1fv, | 1429 &GetRenderbufferParameteriv, |
| 1637 &VertexAttrib2f, &VertexAttrib2fv, | 1430 &GetShaderiv, |
| 1638 &VertexAttrib3f, &VertexAttrib3fv, | 1431 &GetShaderInfoLog, |
| 1639 &VertexAttrib4f, &VertexAttrib4fv, | 1432 &GetShaderPrecisionFormat, |
| 1640 &VertexAttribPointer, &Viewport}; | 1433 &GetShaderSource, |
| 1434 &GetString, | |
| 1435 &GetTexParameterfv, | |
| 1436 &GetTexParameteriv, | |
| 1437 &GetUniformfv, | |
| 1438 &GetUniformiv, | |
| 1439 &GetUniformLocation, | |
| 1440 &GetVertexAttribfv, | |
| 1441 &GetVertexAttribiv, | |
| 1442 &GetVertexAttribPointerv, | |
| 1443 &Hint, | |
| 1444 &IsBuffer, | |
| 1445 &IsEnabled, | |
| 1446 &IsFramebuffer, | |
| 1447 &IsProgram, | |
| 1448 &IsRenderbuffer, | |
| 1449 &IsShader, | |
| 1450 &IsTexture, | |
| 1451 &LineWidth, | |
| 1452 &LinkProgram, | |
| 1453 &PixelStorei, | |
| 1454 &PolygonOffset, | |
| 1455 &ReadPixels, | |
| 1456 &ReleaseShaderCompiler, | |
| 1457 &RenderbufferStorage, | |
| 1458 &SampleCoverage, | |
| 1459 &Scissor, | |
| 1460 &ShaderBinary, | |
| 1461 &ShaderSource, | |
| 1462 &StencilFunc, | |
| 1463 &StencilFuncSeparate, | |
| 1464 &StencilMask, | |
| 1465 &StencilMaskSeparate, | |
| 1466 &StencilOp, | |
| 1467 &StencilOpSeparate, | |
| 1468 &TexImage2D, | |
| 1469 &TexParameterf, | |
| 1470 &TexParameterfv, | |
| 1471 &TexParameteri, | |
| 1472 &TexParameteriv, | |
| 1473 &TexSubImage2D, | |
| 1474 &Uniform1f, | |
| 1475 &Uniform1fv, | |
| 1476 &Uniform1i, | |
| 1477 &Uniform1iv, | |
| 1478 &Uniform2f, | |
| 1479 &Uniform2fv, | |
| 1480 &Uniform2i, | |
| 1481 &Uniform2iv, | |
| 1482 &Uniform3f, | |
| 1483 &Uniform3fv, | |
| 1484 &Uniform3i, | |
| 1485 &Uniform3iv, | |
| 1486 &Uniform4f, | |
| 1487 &Uniform4fv, | |
| 1488 &Uniform4i, | |
| 1489 &Uniform4iv, | |
| 1490 &UniformMatrix2fv, | |
| 1491 &UniformMatrix3fv, | |
| 1492 &UniformMatrix4fv, | |
| 1493 &UseProgram, | |
| 1494 &ValidateProgram, | |
| 1495 &VertexAttrib1f, | |
| 1496 &VertexAttrib1fv, | |
| 1497 &VertexAttrib2f, | |
| 1498 &VertexAttrib2fv, | |
| 1499 &VertexAttrib3f, | |
| 1500 &VertexAttrib3fv, | |
| 1501 &VertexAttrib4f, | |
| 1502 &VertexAttrib4fv, | |
| 1503 &VertexAttribPointer, | |
| 1504 &Viewport | |
| 1505 }; | |
| 1641 return &ppb_opengles2; | 1506 return &ppb_opengles2; |
| 1642 } | 1507 } |
| 1643 const PPB_OpenGLES2InstancedArrays* | 1508 const PPB_OpenGLES2InstancedArrays* PPB_OpenGLES2_Shared::GetInstancedArraysInte rface() { // NOLINT |
| 1644 PPB_OpenGLES2_Shared::GetInstancedArraysInterface() { // NOLINT | |
| 1645 static const struct PPB_OpenGLES2InstancedArrays ppb_opengles2 = { | 1509 static const struct PPB_OpenGLES2InstancedArrays ppb_opengles2 = { |
| 1646 &DrawArraysInstancedANGLE, &DrawElementsInstancedANGLE, | 1510 &DrawArraysInstancedANGLE, |
| 1647 &VertexAttribDivisorANGLE}; | 1511 &DrawElementsInstancedANGLE, |
| 1512 &VertexAttribDivisorANGLE | |
| 1513 }; | |
| 1648 return &ppb_opengles2; | 1514 return &ppb_opengles2; |
| 1649 } | 1515 } |
| 1650 const PPB_OpenGLES2FramebufferBlit* | 1516 const PPB_OpenGLES2FramebufferBlit* PPB_OpenGLES2_Shared::GetFramebufferBlitInte rface() { // NOLINT |
| 1651 PPB_OpenGLES2_Shared::GetFramebufferBlitInterface() { // NOLINT | |
| 1652 static const struct PPB_OpenGLES2FramebufferBlit ppb_opengles2 = { | 1517 static const struct PPB_OpenGLES2FramebufferBlit ppb_opengles2 = { |
| 1653 &BlitFramebufferEXT}; | 1518 &BlitFramebufferEXT |
| 1519 }; | |
| 1654 return &ppb_opengles2; | 1520 return &ppb_opengles2; |
| 1655 } | 1521 } |
| 1656 const PPB_OpenGLES2FramebufferMultisample* | 1522 const PPB_OpenGLES2FramebufferMultisample* PPB_OpenGLES2_Shared::GetFramebufferM ultisampleInterface() { // NOLINT |
| 1657 PPB_OpenGLES2_Shared::GetFramebufferMultisampleInterface() { // NOLINT | |
| 1658 static const struct PPB_OpenGLES2FramebufferMultisample ppb_opengles2 = { | 1523 static const struct PPB_OpenGLES2FramebufferMultisample ppb_opengles2 = { |
| 1659 &RenderbufferStorageMultisampleEXT}; | 1524 &RenderbufferStorageMultisampleEXT |
| 1525 }; | |
| 1660 return &ppb_opengles2; | 1526 return &ppb_opengles2; |
| 1661 } | 1527 } |
| 1662 const PPB_OpenGLES2ChromiumEnableFeature* | 1528 const PPB_OpenGLES2ChromiumEnableFeature* PPB_OpenGLES2_Shared::GetChromiumEnabl eFeatureInterface() { // NOLINT |
| 1663 PPB_OpenGLES2_Shared::GetChromiumEnableFeatureInterface() { // NOLINT | |
| 1664 static const struct PPB_OpenGLES2ChromiumEnableFeature ppb_opengles2 = { | 1529 static const struct PPB_OpenGLES2ChromiumEnableFeature ppb_opengles2 = { |
| 1665 &EnableFeatureCHROMIUM}; | 1530 &EnableFeatureCHROMIUM |
| 1531 }; | |
| 1666 return &ppb_opengles2; | 1532 return &ppb_opengles2; |
| 1667 } | 1533 } |
| 1668 const PPB_OpenGLES2ChromiumMapSub* | 1534 const PPB_OpenGLES2ChromiumMapSub* PPB_OpenGLES2_Shared::GetChromiumMapSubInterf ace() { // NOLINT |
| 1669 PPB_OpenGLES2_Shared::GetChromiumMapSubInterface() { // NOLINT | |
| 1670 static const struct PPB_OpenGLES2ChromiumMapSub ppb_opengles2 = { | 1535 static const struct PPB_OpenGLES2ChromiumMapSub ppb_opengles2 = { |
| 1671 &MapBufferSubDataCHROMIUM, &UnmapBufferSubDataCHROMIUM, | 1536 &MapBufferSubDataCHROMIUM, |
| 1672 &MapTexSubImage2DCHROMIUM, &UnmapTexSubImage2DCHROMIUM}; | 1537 &UnmapBufferSubDataCHROMIUM, |
| 1538 &MapTexSubImage2DCHROMIUM, | |
| 1539 &UnmapTexSubImage2DCHROMIUM | |
| 1540 }; | |
| 1673 return &ppb_opengles2; | 1541 return &ppb_opengles2; |
| 1674 } | 1542 } |
| 1675 const PPB_OpenGLES2Query* PPB_OpenGLES2_Shared::GetQueryInterface() { | 1543 const PPB_OpenGLES2Query* PPB_OpenGLES2_Shared::GetQueryInterface() { |
| 1676 static const struct PPB_OpenGLES2Query ppb_opengles2 = { | 1544 static const struct PPB_OpenGLES2Query ppb_opengles2 = { |
| 1677 &GenQueriesEXT, &DeleteQueriesEXT, &IsQueryEXT, &BeginQueryEXT, | 1545 &GenQueriesEXT, |
| 1678 &EndQueryEXT, &GetQueryivEXT, &GetQueryObjectuivEXT}; | 1546 &DeleteQueriesEXT, |
| 1547 &IsQueryEXT, | |
| 1548 &BeginQueryEXT, | |
| 1549 &EndQueryEXT, | |
| 1550 &GetQueryivEXT, | |
| 1551 &GetQueryObjectuivEXT | |
| 1552 }; | |
| 1679 return &ppb_opengles2; | 1553 return &ppb_opengles2; |
| 1680 } | 1554 } |
| 1681 } // namespace ppapi | 1555 } // namespace ppapi |
| OLD | NEW |