Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This file is auto-generated from | |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | |
| 7 // It's formatted by clang-format using chromium coding style: | |
| 8 // clang-format -i -style=chromium filename | |
| 9 // DO NOT EDIT! | |
| 10 | |
| 11 // It is included by gles2_cmd_decoder_passthrough.cc | |
| 12 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_HANDLERS_AUTOGE N_H_ | |
| 13 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_HANDLERS_AUTOGE N_H_ | |
| 14 | |
| 15 error::Error GLES2DecoderPassthroughImpl::HandleActiveTexture( | |
| 16 uint32_t immediate_data_size, | |
| 17 const void* cmd_data) { | |
| 18 const gles2::cmds::ActiveTexture& c = | |
| 19 *static_cast<const gles2::cmds::ActiveTexture*>(cmd_data); | |
| 20 (void)c; | |
|
Zhenyao Mo
2016/05/31 01:37:22
nit: get rid of this. Here and below.
Geoff Lang
2016/06/01 20:11:51
I can remove it from the generator, but this gener
Zhenyao Mo
2016/06/01 20:17:44
I think it's most likely not needed in gles2_cmd_d
| |
| 21 GLenum texture = static_cast<GLenum>(c.texture); | |
| 22 error::Error error = DoActiveTexture(texture); | |
| 23 if (error != error::kNoError) { | |
| 24 return error; | |
| 25 } | |
| 26 return error::kNoError; | |
|
Zhenyao Mo
2016/05/31 01:37:22
This is rather unfortunate that we can't just "ret
Geoff Lang
2016/06/01 20:11:51
Agreed, not so simple to detect which commands do
| |
| 27 } | |
| 28 | |
| 29 error::Error GLES2DecoderPassthroughImpl::HandleAttachShader( | |
| 30 uint32_t immediate_data_size, | |
| 31 const void* cmd_data) { | |
| 32 const gles2::cmds::AttachShader& c = | |
| 33 *static_cast<const gles2::cmds::AttachShader*>(cmd_data); | |
| 34 (void)c; | |
| 35 GLuint program = c.program; | |
| 36 GLuint shader = c.shader; | |
| 37 error::Error error = DoAttachShader(program, shader); | |
| 38 if (error != error::kNoError) { | |
| 39 return error; | |
| 40 } | |
| 41 return error::kNoError; | |
| 42 } | |
| 43 | |
| 44 error::Error GLES2DecoderPassthroughImpl::HandleBindBuffer( | |
| 45 uint32_t immediate_data_size, | |
| 46 const void* cmd_data) { | |
| 47 const gles2::cmds::BindBuffer& c = | |
| 48 *static_cast<const gles2::cmds::BindBuffer*>(cmd_data); | |
| 49 (void)c; | |
| 50 GLenum target = static_cast<GLenum>(c.target); | |
| 51 GLuint buffer = c.buffer; | |
| 52 error::Error error = DoBindBuffer(target, buffer); | |
| 53 if (error != error::kNoError) { | |
| 54 return error; | |
| 55 } | |
| 56 return error::kNoError; | |
| 57 } | |
| 58 | |
| 59 error::Error GLES2DecoderPassthroughImpl::HandleBindBufferBase( | |
| 60 uint32_t immediate_data_size, | |
| 61 const void* cmd_data) { | |
| 62 const gles2::cmds::BindBufferBase& c = | |
| 63 *static_cast<const gles2::cmds::BindBufferBase*>(cmd_data); | |
| 64 (void)c; | |
| 65 GLenum target = static_cast<GLenum>(c.target); | |
| 66 GLuint index = static_cast<GLuint>(c.index); | |
| 67 GLuint buffer = c.buffer; | |
| 68 error::Error error = DoBindBufferBase(target, index, buffer); | |
| 69 if (error != error::kNoError) { | |
| 70 return error; | |
| 71 } | |
| 72 return error::kNoError; | |
| 73 } | |
| 74 | |
| 75 error::Error GLES2DecoderPassthroughImpl::HandleBindBufferRange( | |
| 76 uint32_t immediate_data_size, | |
| 77 const void* cmd_data) { | |
| 78 const gles2::cmds::BindBufferRange& c = | |
| 79 *static_cast<const gles2::cmds::BindBufferRange*>(cmd_data); | |
| 80 (void)c; | |
| 81 GLenum target = static_cast<GLenum>(c.target); | |
| 82 GLuint index = static_cast<GLuint>(c.index); | |
| 83 GLuint buffer = c.buffer; | |
| 84 GLintptr offset = static_cast<GLintptr>(c.offset); | |
| 85 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | |
| 86 error::Error error = DoBindBufferRange(target, index, buffer, offset, size); | |
| 87 if (error != error::kNoError) { | |
| 88 return error; | |
| 89 } | |
| 90 return error::kNoError; | |
| 91 } | |
| 92 | |
| 93 error::Error GLES2DecoderPassthroughImpl::HandleBindFramebuffer( | |
| 94 uint32_t immediate_data_size, | |
| 95 const void* cmd_data) { | |
| 96 const gles2::cmds::BindFramebuffer& c = | |
| 97 *static_cast<const gles2::cmds::BindFramebuffer*>(cmd_data); | |
| 98 (void)c; | |
| 99 GLenum target = static_cast<GLenum>(c.target); | |
| 100 GLuint framebuffer = c.framebuffer; | |
| 101 error::Error error = DoBindFramebuffer(target, framebuffer); | |
| 102 if (error != error::kNoError) { | |
| 103 return error; | |
| 104 } | |
| 105 return error::kNoError; | |
| 106 } | |
| 107 | |
| 108 error::Error GLES2DecoderPassthroughImpl::HandleBindRenderbuffer( | |
| 109 uint32_t immediate_data_size, | |
| 110 const void* cmd_data) { | |
| 111 const gles2::cmds::BindRenderbuffer& c = | |
| 112 *static_cast<const gles2::cmds::BindRenderbuffer*>(cmd_data); | |
| 113 (void)c; | |
| 114 GLenum target = static_cast<GLenum>(c.target); | |
| 115 GLuint renderbuffer = c.renderbuffer; | |
| 116 error::Error error = DoBindRenderbuffer(target, renderbuffer); | |
| 117 if (error != error::kNoError) { | |
| 118 return error; | |
| 119 } | |
| 120 return error::kNoError; | |
| 121 } | |
| 122 | |
| 123 error::Error GLES2DecoderPassthroughImpl::HandleBindSampler( | |
| 124 uint32_t immediate_data_size, | |
| 125 const void* cmd_data) { | |
| 126 const gles2::cmds::BindSampler& c = | |
| 127 *static_cast<const gles2::cmds::BindSampler*>(cmd_data); | |
| 128 (void)c; | |
| 129 GLuint unit = static_cast<GLuint>(c.unit); | |
| 130 GLuint sampler = c.sampler; | |
| 131 error::Error error = DoBindSampler(unit, sampler); | |
| 132 if (error != error::kNoError) { | |
| 133 return error; | |
| 134 } | |
| 135 return error::kNoError; | |
| 136 } | |
| 137 | |
| 138 error::Error GLES2DecoderPassthroughImpl::HandleBindTexture( | |
| 139 uint32_t immediate_data_size, | |
| 140 const void* cmd_data) { | |
| 141 const gles2::cmds::BindTexture& c = | |
| 142 *static_cast<const gles2::cmds::BindTexture*>(cmd_data); | |
| 143 (void)c; | |
| 144 GLenum target = static_cast<GLenum>(c.target); | |
| 145 GLuint texture = c.texture; | |
| 146 error::Error error = DoBindTexture(target, texture); | |
| 147 if (error != error::kNoError) { | |
| 148 return error; | |
| 149 } | |
| 150 return error::kNoError; | |
| 151 } | |
| 152 | |
| 153 error::Error GLES2DecoderPassthroughImpl::HandleBindTransformFeedback( | |
| 154 uint32_t immediate_data_size, | |
| 155 const void* cmd_data) { | |
| 156 const gles2::cmds::BindTransformFeedback& c = | |
| 157 *static_cast<const gles2::cmds::BindTransformFeedback*>(cmd_data); | |
| 158 (void)c; | |
| 159 GLenum target = static_cast<GLenum>(c.target); | |
| 160 GLuint transformfeedback = c.transformfeedback; | |
| 161 error::Error error = DoBindTransformFeedback(target, transformfeedback); | |
| 162 if (error != error::kNoError) { | |
| 163 return error; | |
| 164 } | |
| 165 return error::kNoError; | |
| 166 } | |
| 167 | |
| 168 error::Error GLES2DecoderPassthroughImpl::HandleBlendColor( | |
| 169 uint32_t immediate_data_size, | |
| 170 const void* cmd_data) { | |
| 171 const gles2::cmds::BlendColor& c = | |
| 172 *static_cast<const gles2::cmds::BlendColor*>(cmd_data); | |
| 173 (void)c; | |
| 174 GLclampf red = static_cast<GLclampf>(c.red); | |
| 175 GLclampf green = static_cast<GLclampf>(c.green); | |
| 176 GLclampf blue = static_cast<GLclampf>(c.blue); | |
| 177 GLclampf alpha = static_cast<GLclampf>(c.alpha); | |
| 178 error::Error error = DoBlendColor(red, green, blue, alpha); | |
| 179 if (error != error::kNoError) { | |
| 180 return error; | |
| 181 } | |
| 182 return error::kNoError; | |
| 183 } | |
| 184 | |
| 185 error::Error GLES2DecoderPassthroughImpl::HandleBlendEquation( | |
| 186 uint32_t immediate_data_size, | |
| 187 const void* cmd_data) { | |
| 188 const gles2::cmds::BlendEquation& c = | |
| 189 *static_cast<const gles2::cmds::BlendEquation*>(cmd_data); | |
| 190 (void)c; | |
| 191 GLenum mode = static_cast<GLenum>(c.mode); | |
| 192 error::Error error = DoBlendEquation(mode); | |
| 193 if (error != error::kNoError) { | |
| 194 return error; | |
| 195 } | |
| 196 return error::kNoError; | |
| 197 } | |
| 198 | |
| 199 error::Error GLES2DecoderPassthroughImpl::HandleBlendEquationSeparate( | |
| 200 uint32_t immediate_data_size, | |
| 201 const void* cmd_data) { | |
| 202 const gles2::cmds::BlendEquationSeparate& c = | |
| 203 *static_cast<const gles2::cmds::BlendEquationSeparate*>(cmd_data); | |
| 204 (void)c; | |
| 205 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); | |
| 206 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); | |
| 207 error::Error error = DoBlendEquationSeparate(modeRGB, modeAlpha); | |
| 208 if (error != error::kNoError) { | |
| 209 return error; | |
| 210 } | |
| 211 return error::kNoError; | |
| 212 } | |
| 213 | |
| 214 error::Error GLES2DecoderPassthroughImpl::HandleBlendFunc( | |
| 215 uint32_t immediate_data_size, | |
| 216 const void* cmd_data) { | |
| 217 const gles2::cmds::BlendFunc& c = | |
| 218 *static_cast<const gles2::cmds::BlendFunc*>(cmd_data); | |
| 219 (void)c; | |
| 220 GLenum sfactor = static_cast<GLenum>(c.sfactor); | |
| 221 GLenum dfactor = static_cast<GLenum>(c.dfactor); | |
| 222 error::Error error = DoBlendFunc(sfactor, dfactor); | |
| 223 if (error != error::kNoError) { | |
| 224 return error; | |
| 225 } | |
| 226 return error::kNoError; | |
| 227 } | |
| 228 | |
| 229 error::Error GLES2DecoderPassthroughImpl::HandleBlendFuncSeparate( | |
| 230 uint32_t immediate_data_size, | |
| 231 const void* cmd_data) { | |
| 232 const gles2::cmds::BlendFuncSeparate& c = | |
| 233 *static_cast<const gles2::cmds::BlendFuncSeparate*>(cmd_data); | |
| 234 (void)c; | |
| 235 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); | |
| 236 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); | |
| 237 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); | |
| 238 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); | |
| 239 error::Error error = DoBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); | |
| 240 if (error != error::kNoError) { | |
| 241 return error; | |
| 242 } | |
| 243 return error::kNoError; | |
| 244 } | |
| 245 | |
| 246 error::Error GLES2DecoderPassthroughImpl::HandleBufferSubData( | |
| 247 uint32_t immediate_data_size, | |
| 248 const void* cmd_data) { | |
| 249 const gles2::cmds::BufferSubData& c = | |
| 250 *static_cast<const gles2::cmds::BufferSubData*>(cmd_data); | |
| 251 (void)c; | |
| 252 GLenum target = static_cast<GLenum>(c.target); | |
| 253 GLintptr offset = static_cast<GLintptr>(c.offset); | |
| 254 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | |
| 255 uint32_t data_size = size; | |
| 256 const void* data = GetSharedMemoryAs<const void*>( | |
| 257 c.data_shm_id, c.data_shm_offset, data_size); | |
| 258 error::Error error = DoBufferSubData(target, offset, size, data); | |
| 259 if (error != error::kNoError) { | |
| 260 return error; | |
| 261 } | |
| 262 return error::kNoError; | |
| 263 } | |
| 264 | |
| 265 error::Error GLES2DecoderPassthroughImpl::HandleCheckFramebufferStatus( | |
| 266 uint32_t immediate_data_size, | |
| 267 const void* cmd_data) { | |
| 268 const gles2::cmds::CheckFramebufferStatus& c = | |
| 269 *static_cast<const gles2::cmds::CheckFramebufferStatus*>(cmd_data); | |
| 270 (void)c; | |
| 271 GLenum target = static_cast<GLenum>(c.target); | |
| 272 typedef cmds::CheckFramebufferStatus::Result Result; | |
| 273 Result* result = GetSharedMemoryAs<Result*>( | |
| 274 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 275 if (!result) { | |
| 276 return error::kOutOfBounds; | |
| 277 } | |
| 278 error::Error error = DoCheckFramebufferStatus(target, result); | |
| 279 if (error != error::kNoError) { | |
| 280 return error; | |
| 281 } | |
| 282 return error::kNoError; | |
| 283 } | |
| 284 | |
| 285 error::Error GLES2DecoderPassthroughImpl::HandleClear( | |
| 286 uint32_t immediate_data_size, | |
| 287 const void* cmd_data) { | |
| 288 const gles2::cmds::Clear& c = | |
| 289 *static_cast<const gles2::cmds::Clear*>(cmd_data); | |
| 290 (void)c; | |
| 291 GLbitfield mask = static_cast<GLbitfield>(c.mask); | |
| 292 error::Error error = DoClear(mask); | |
| 293 if (error != error::kNoError) { | |
| 294 return error; | |
| 295 } | |
| 296 return error::kNoError; | |
| 297 } | |
| 298 | |
| 299 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferfi( | |
| 300 uint32_t immediate_data_size, | |
| 301 const void* cmd_data) { | |
| 302 const gles2::cmds::ClearBufferfi& c = | |
| 303 *static_cast<const gles2::cmds::ClearBufferfi*>(cmd_data); | |
| 304 (void)c; | |
| 305 GLenum buffer = static_cast<GLenum>(c.buffer); | |
| 306 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); | |
| 307 GLfloat depth = static_cast<GLfloat>(c.depth); | |
| 308 GLint stencil = static_cast<GLint>(c.stencil); | |
| 309 error::Error error = DoClearBufferfi(buffer, drawbuffers, depth, stencil); | |
| 310 if (error != error::kNoError) { | |
| 311 return error; | |
| 312 } | |
| 313 return error::kNoError; | |
| 314 } | |
| 315 | |
| 316 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferfvImmediate( | |
| 317 uint32_t immediate_data_size, | |
| 318 const void* cmd_data) { | |
| 319 const gles2::cmds::ClearBufferfvImmediate& c = | |
| 320 *static_cast<const gles2::cmds::ClearBufferfvImmediate*>(cmd_data); | |
| 321 (void)c; | |
| 322 GLenum buffer = static_cast<GLenum>(c.buffer); | |
| 323 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); | |
| 324 uint32_t data_size; | |
| 325 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { | |
| 326 return error::kOutOfBounds; | |
| 327 } | |
| 328 if (data_size > immediate_data_size) { | |
| 329 return error::kOutOfBounds; | |
| 330 } | |
| 331 const GLfloat* value = | |
| 332 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 333 error::Error error = DoClearBufferfv(buffer, drawbuffers, value); | |
| 334 if (error != error::kNoError) { | |
| 335 return error; | |
| 336 } | |
| 337 return error::kNoError; | |
| 338 } | |
| 339 | |
| 340 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferivImmediate( | |
| 341 uint32_t immediate_data_size, | |
| 342 const void* cmd_data) { | |
| 343 const gles2::cmds::ClearBufferivImmediate& c = | |
| 344 *static_cast<const gles2::cmds::ClearBufferivImmediate*>(cmd_data); | |
| 345 (void)c; | |
| 346 GLenum buffer = static_cast<GLenum>(c.buffer); | |
| 347 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); | |
| 348 uint32_t data_size; | |
| 349 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 4, &data_size)) { | |
| 350 return error::kOutOfBounds; | |
| 351 } | |
| 352 if (data_size > immediate_data_size) { | |
| 353 return error::kOutOfBounds; | |
| 354 } | |
| 355 const GLint* value = | |
| 356 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 357 error::Error error = DoClearBufferiv(buffer, drawbuffers, value); | |
| 358 if (error != error::kNoError) { | |
| 359 return error; | |
| 360 } | |
| 361 return error::kNoError; | |
| 362 } | |
| 363 | |
| 364 error::Error GLES2DecoderPassthroughImpl::HandleClearBufferuivImmediate( | |
| 365 uint32_t immediate_data_size, | |
| 366 const void* cmd_data) { | |
| 367 const gles2::cmds::ClearBufferuivImmediate& c = | |
| 368 *static_cast<const gles2::cmds::ClearBufferuivImmediate*>(cmd_data); | |
| 369 (void)c; | |
| 370 GLenum buffer = static_cast<GLenum>(c.buffer); | |
| 371 GLint drawbuffers = static_cast<GLint>(c.drawbuffers); | |
| 372 uint32_t data_size; | |
| 373 if (!GLES2Util::ComputeDataSize(1, sizeof(GLuint), 4, &data_size)) { | |
| 374 return error::kOutOfBounds; | |
| 375 } | |
| 376 if (data_size > immediate_data_size) { | |
| 377 return error::kOutOfBounds; | |
| 378 } | |
| 379 const GLuint* value = | |
| 380 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 381 error::Error error = DoClearBufferuiv(buffer, drawbuffers, value); | |
| 382 if (error != error::kNoError) { | |
| 383 return error; | |
| 384 } | |
| 385 return error::kNoError; | |
| 386 } | |
| 387 | |
| 388 error::Error GLES2DecoderPassthroughImpl::HandleClearColor( | |
| 389 uint32_t immediate_data_size, | |
| 390 const void* cmd_data) { | |
| 391 const gles2::cmds::ClearColor& c = | |
| 392 *static_cast<const gles2::cmds::ClearColor*>(cmd_data); | |
| 393 (void)c; | |
| 394 GLclampf red = static_cast<GLclampf>(c.red); | |
| 395 GLclampf green = static_cast<GLclampf>(c.green); | |
| 396 GLclampf blue = static_cast<GLclampf>(c.blue); | |
| 397 GLclampf alpha = static_cast<GLclampf>(c.alpha); | |
| 398 error::Error error = DoClearColor(red, green, blue, alpha); | |
| 399 if (error != error::kNoError) { | |
| 400 return error; | |
| 401 } | |
| 402 return error::kNoError; | |
| 403 } | |
| 404 | |
| 405 error::Error GLES2DecoderPassthroughImpl::HandleClearDepthf( | |
| 406 uint32_t immediate_data_size, | |
| 407 const void* cmd_data) { | |
| 408 const gles2::cmds::ClearDepthf& c = | |
| 409 *static_cast<const gles2::cmds::ClearDepthf*>(cmd_data); | |
| 410 (void)c; | |
| 411 GLclampf depth = static_cast<GLclampf>(c.depth); | |
| 412 error::Error error = DoClearDepthf(depth); | |
| 413 if (error != error::kNoError) { | |
| 414 return error; | |
| 415 } | |
| 416 return error::kNoError; | |
| 417 } | |
| 418 | |
| 419 error::Error GLES2DecoderPassthroughImpl::HandleClearStencil( | |
| 420 uint32_t immediate_data_size, | |
| 421 const void* cmd_data) { | |
| 422 const gles2::cmds::ClearStencil& c = | |
| 423 *static_cast<const gles2::cmds::ClearStencil*>(cmd_data); | |
| 424 (void)c; | |
| 425 GLint s = static_cast<GLint>(c.s); | |
| 426 error::Error error = DoClearStencil(s); | |
| 427 if (error != error::kNoError) { | |
| 428 return error; | |
| 429 } | |
| 430 return error::kNoError; | |
| 431 } | |
| 432 | |
| 433 error::Error GLES2DecoderPassthroughImpl::HandleColorMask( | |
| 434 uint32_t immediate_data_size, | |
| 435 const void* cmd_data) { | |
| 436 const gles2::cmds::ColorMask& c = | |
| 437 *static_cast<const gles2::cmds::ColorMask*>(cmd_data); | |
| 438 (void)c; | |
| 439 GLboolean red = static_cast<GLboolean>(c.red); | |
| 440 GLboolean green = static_cast<GLboolean>(c.green); | |
| 441 GLboolean blue = static_cast<GLboolean>(c.blue); | |
| 442 GLboolean alpha = static_cast<GLboolean>(c.alpha); | |
| 443 error::Error error = DoColorMask(red, green, blue, alpha); | |
| 444 if (error != error::kNoError) { | |
| 445 return error; | |
| 446 } | |
| 447 return error::kNoError; | |
| 448 } | |
| 449 | |
| 450 error::Error GLES2DecoderPassthroughImpl::HandleCompileShader( | |
| 451 uint32_t immediate_data_size, | |
| 452 const void* cmd_data) { | |
| 453 const gles2::cmds::CompileShader& c = | |
| 454 *static_cast<const gles2::cmds::CompileShader*>(cmd_data); | |
| 455 (void)c; | |
| 456 GLuint shader = c.shader; | |
| 457 error::Error error = DoCompileShader(shader); | |
| 458 if (error != error::kNoError) { | |
| 459 return error; | |
| 460 } | |
| 461 return error::kNoError; | |
| 462 } | |
| 463 | |
| 464 error::Error GLES2DecoderPassthroughImpl::HandleCompressedTexSubImage2D( | |
| 465 uint32_t immediate_data_size, | |
| 466 const void* cmd_data) { | |
| 467 const gles2::cmds::CompressedTexSubImage2D& c = | |
| 468 *static_cast<const gles2::cmds::CompressedTexSubImage2D*>(cmd_data); | |
| 469 (void)c; | |
| 470 GLenum target = static_cast<GLenum>(c.target); | |
| 471 GLint level = static_cast<GLint>(c.level); | |
| 472 GLint xoffset = static_cast<GLint>(c.xoffset); | |
| 473 GLint yoffset = static_cast<GLint>(c.yoffset); | |
| 474 GLsizei width = static_cast<GLsizei>(c.width); | |
| 475 GLsizei height = static_cast<GLsizei>(c.height); | |
| 476 GLenum format = static_cast<GLenum>(c.format); | |
| 477 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | |
| 478 uint32_t data_size = imageSize; | |
| 479 const void* data = GetSharedMemoryAs<const void*>( | |
| 480 c.data_shm_id, c.data_shm_offset, data_size); | |
| 481 error::Error error = DoCompressedTexSubImage2D( | |
| 482 target, level, xoffset, yoffset, width, height, format, imageSize, data); | |
| 483 if (error != error::kNoError) { | |
| 484 return error; | |
| 485 } | |
| 486 return error::kNoError; | |
| 487 } | |
| 488 | |
| 489 error::Error GLES2DecoderPassthroughImpl::HandleCompressedTexSubImage3D( | |
| 490 uint32_t immediate_data_size, | |
| 491 const void* cmd_data) { | |
| 492 const gles2::cmds::CompressedTexSubImage3D& c = | |
| 493 *static_cast<const gles2::cmds::CompressedTexSubImage3D*>(cmd_data); | |
| 494 (void)c; | |
| 495 GLenum target = static_cast<GLenum>(c.target); | |
| 496 GLint level = static_cast<GLint>(c.level); | |
| 497 GLint xoffset = static_cast<GLint>(c.xoffset); | |
| 498 GLint yoffset = static_cast<GLint>(c.yoffset); | |
| 499 GLint zoffset = static_cast<GLint>(c.zoffset); | |
| 500 GLsizei width = static_cast<GLsizei>(c.width); | |
| 501 GLsizei height = static_cast<GLsizei>(c.height); | |
| 502 GLsizei depth = static_cast<GLsizei>(c.depth); | |
| 503 GLenum format = static_cast<GLenum>(c.format); | |
| 504 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | |
| 505 uint32_t data_size = imageSize; | |
| 506 const void* data = GetSharedMemoryAs<const void*>( | |
| 507 c.data_shm_id, c.data_shm_offset, data_size); | |
| 508 error::Error error = | |
| 509 DoCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, | |
| 510 height, depth, format, imageSize, data); | |
| 511 if (error != error::kNoError) { | |
| 512 return error; | |
| 513 } | |
| 514 return error::kNoError; | |
| 515 } | |
| 516 | |
| 517 error::Error GLES2DecoderPassthroughImpl::HandleCopyBufferSubData( | |
| 518 uint32_t immediate_data_size, | |
| 519 const void* cmd_data) { | |
| 520 const gles2::cmds::CopyBufferSubData& c = | |
| 521 *static_cast<const gles2::cmds::CopyBufferSubData*>(cmd_data); | |
| 522 (void)c; | |
| 523 GLenum readtarget = static_cast<GLenum>(c.readtarget); | |
| 524 GLenum writetarget = static_cast<GLenum>(c.writetarget); | |
| 525 GLintptr readoffset = static_cast<GLintptr>(c.readoffset); | |
| 526 GLintptr writeoffset = static_cast<GLintptr>(c.writeoffset); | |
| 527 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | |
| 528 error::Error error = DoCopyBufferSubData(readtarget, writetarget, readoffset, | |
| 529 writeoffset, size); | |
| 530 if (error != error::kNoError) { | |
| 531 return error; | |
| 532 } | |
| 533 return error::kNoError; | |
| 534 } | |
| 535 | |
| 536 error::Error GLES2DecoderPassthroughImpl::HandleCopyTexImage2D( | |
| 537 uint32_t immediate_data_size, | |
| 538 const void* cmd_data) { | |
| 539 const gles2::cmds::CopyTexImage2D& c = | |
| 540 *static_cast<const gles2::cmds::CopyTexImage2D*>(cmd_data); | |
| 541 (void)c; | |
| 542 GLenum target = static_cast<GLenum>(c.target); | |
| 543 GLint level = static_cast<GLint>(c.level); | |
| 544 GLenum internalformat = static_cast<GLenum>(c.internalformat); | |
| 545 GLint x = static_cast<GLint>(c.x); | |
| 546 GLint y = static_cast<GLint>(c.y); | |
| 547 GLsizei width = static_cast<GLsizei>(c.width); | |
| 548 GLsizei height = static_cast<GLsizei>(c.height); | |
| 549 GLint border = static_cast<GLint>(c.border); | |
| 550 error::Error error = DoCopyTexImage2D(target, level, internalformat, x, y, | |
| 551 width, height, border); | |
| 552 if (error != error::kNoError) { | |
| 553 return error; | |
| 554 } | |
| 555 return error::kNoError; | |
| 556 } | |
| 557 | |
| 558 error::Error GLES2DecoderPassthroughImpl::HandleCopyTexSubImage2D( | |
| 559 uint32_t immediate_data_size, | |
| 560 const void* cmd_data) { | |
| 561 const gles2::cmds::CopyTexSubImage2D& c = | |
| 562 *static_cast<const gles2::cmds::CopyTexSubImage2D*>(cmd_data); | |
| 563 (void)c; | |
| 564 GLenum target = static_cast<GLenum>(c.target); | |
| 565 GLint level = static_cast<GLint>(c.level); | |
| 566 GLint xoffset = static_cast<GLint>(c.xoffset); | |
| 567 GLint yoffset = static_cast<GLint>(c.yoffset); | |
| 568 GLint x = static_cast<GLint>(c.x); | |
| 569 GLint y = static_cast<GLint>(c.y); | |
| 570 GLsizei width = static_cast<GLsizei>(c.width); | |
| 571 GLsizei height = static_cast<GLsizei>(c.height); | |
| 572 error::Error error = | |
| 573 DoCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); | |
| 574 if (error != error::kNoError) { | |
| 575 return error; | |
| 576 } | |
| 577 return error::kNoError; | |
| 578 } | |
| 579 | |
| 580 error::Error GLES2DecoderPassthroughImpl::HandleCopyTexSubImage3D( | |
| 581 uint32_t immediate_data_size, | |
| 582 const void* cmd_data) { | |
| 583 const gles2::cmds::CopyTexSubImage3D& c = | |
| 584 *static_cast<const gles2::cmds::CopyTexSubImage3D*>(cmd_data); | |
| 585 (void)c; | |
| 586 GLenum target = static_cast<GLenum>(c.target); | |
| 587 GLint level = static_cast<GLint>(c.level); | |
| 588 GLint xoffset = static_cast<GLint>(c.xoffset); | |
| 589 GLint yoffset = static_cast<GLint>(c.yoffset); | |
| 590 GLint zoffset = static_cast<GLint>(c.zoffset); | |
| 591 GLint x = static_cast<GLint>(c.x); | |
| 592 GLint y = static_cast<GLint>(c.y); | |
| 593 GLsizei width = static_cast<GLsizei>(c.width); | |
| 594 GLsizei height = static_cast<GLsizei>(c.height); | |
| 595 error::Error error = DoCopyTexSubImage3D(target, level, xoffset, yoffset, | |
| 596 zoffset, x, y, width, height); | |
| 597 if (error != error::kNoError) { | |
| 598 return error; | |
| 599 } | |
| 600 return error::kNoError; | |
| 601 } | |
| 602 | |
| 603 error::Error GLES2DecoderPassthroughImpl::HandleCullFace( | |
| 604 uint32_t immediate_data_size, | |
| 605 const void* cmd_data) { | |
| 606 const gles2::cmds::CullFace& c = | |
| 607 *static_cast<const gles2::cmds::CullFace*>(cmd_data); | |
| 608 (void)c; | |
| 609 GLenum mode = static_cast<GLenum>(c.mode); | |
| 610 error::Error error = DoCullFace(mode); | |
| 611 if (error != error::kNoError) { | |
| 612 return error; | |
| 613 } | |
| 614 return error::kNoError; | |
| 615 } | |
| 616 | |
| 617 error::Error GLES2DecoderPassthroughImpl::HandleDeleteBuffersImmediate( | |
| 618 uint32_t immediate_data_size, | |
| 619 const void* cmd_data) { | |
| 620 const gles2::cmds::DeleteBuffersImmediate& c = | |
| 621 *static_cast<const gles2::cmds::DeleteBuffersImmediate*>(cmd_data); | |
| 622 (void)c; | |
| 623 GLsizei n = static_cast<GLsizei>(c.n); | |
| 624 uint32_t data_size; | |
| 625 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 626 return error::kOutOfBounds; | |
| 627 } | |
| 628 const GLuint* buffers = | |
| 629 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 630 error::Error error = DoDeleteBuffers(n, buffers); | |
| 631 if (error != error::kNoError) { | |
| 632 return error; | |
| 633 } | |
| 634 return error::kNoError; | |
| 635 } | |
| 636 | |
| 637 error::Error GLES2DecoderPassthroughImpl::HandleDeleteFramebuffersImmediate( | |
| 638 uint32_t immediate_data_size, | |
| 639 const void* cmd_data) { | |
| 640 const gles2::cmds::DeleteFramebuffersImmediate& c = | |
| 641 *static_cast<const gles2::cmds::DeleteFramebuffersImmediate*>(cmd_data); | |
| 642 (void)c; | |
| 643 GLsizei n = static_cast<GLsizei>(c.n); | |
| 644 uint32_t data_size; | |
| 645 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 646 return error::kOutOfBounds; | |
| 647 } | |
| 648 const GLuint* framebuffers = | |
| 649 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 650 error::Error error = DoDeleteFramebuffers(n, framebuffers); | |
| 651 if (error != error::kNoError) { | |
| 652 return error; | |
| 653 } | |
| 654 return error::kNoError; | |
| 655 } | |
| 656 | |
| 657 error::Error GLES2DecoderPassthroughImpl::HandleDeleteProgram( | |
| 658 uint32_t immediate_data_size, | |
| 659 const void* cmd_data) { | |
| 660 const gles2::cmds::DeleteProgram& c = | |
| 661 *static_cast<const gles2::cmds::DeleteProgram*>(cmd_data); | |
| 662 (void)c; | |
| 663 GLuint program = c.program; | |
| 664 error::Error error = DoDeleteProgram(program); | |
| 665 if (error != error::kNoError) { | |
| 666 return error; | |
| 667 } | |
| 668 return error::kNoError; | |
| 669 } | |
| 670 | |
| 671 error::Error GLES2DecoderPassthroughImpl::HandleDeleteRenderbuffersImmediate( | |
| 672 uint32_t immediate_data_size, | |
| 673 const void* cmd_data) { | |
| 674 const gles2::cmds::DeleteRenderbuffersImmediate& c = | |
| 675 *static_cast<const gles2::cmds::DeleteRenderbuffersImmediate*>(cmd_data); | |
| 676 (void)c; | |
| 677 GLsizei n = static_cast<GLsizei>(c.n); | |
| 678 uint32_t data_size; | |
| 679 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 680 return error::kOutOfBounds; | |
| 681 } | |
| 682 const GLuint* renderbuffers = | |
| 683 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 684 error::Error error = DoDeleteRenderbuffers(n, renderbuffers); | |
| 685 if (error != error::kNoError) { | |
| 686 return error; | |
| 687 } | |
| 688 return error::kNoError; | |
| 689 } | |
| 690 | |
| 691 error::Error GLES2DecoderPassthroughImpl::HandleDeleteSamplersImmediate( | |
| 692 uint32_t immediate_data_size, | |
| 693 const void* cmd_data) { | |
| 694 const gles2::cmds::DeleteSamplersImmediate& c = | |
| 695 *static_cast<const gles2::cmds::DeleteSamplersImmediate*>(cmd_data); | |
| 696 (void)c; | |
| 697 GLsizei n = static_cast<GLsizei>(c.n); | |
| 698 uint32_t data_size; | |
| 699 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 700 return error::kOutOfBounds; | |
| 701 } | |
| 702 const GLuint* samplers = | |
| 703 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 704 error::Error error = DoDeleteSamplers(n, samplers); | |
| 705 if (error != error::kNoError) { | |
| 706 return error; | |
| 707 } | |
| 708 return error::kNoError; | |
| 709 } | |
| 710 | |
| 711 error::Error GLES2DecoderPassthroughImpl::HandleDeleteSync( | |
| 712 uint32_t immediate_data_size, | |
| 713 const void* cmd_data) { | |
| 714 const gles2::cmds::DeleteSync& c = | |
| 715 *static_cast<const gles2::cmds::DeleteSync*>(cmd_data); | |
| 716 (void)c; | |
| 717 GLuint sync = c.sync; | |
| 718 error::Error error = DoDeleteSync(sync); | |
| 719 if (error != error::kNoError) { | |
| 720 return error; | |
| 721 } | |
| 722 return error::kNoError; | |
| 723 } | |
| 724 | |
| 725 error::Error GLES2DecoderPassthroughImpl::HandleDeleteShader( | |
| 726 uint32_t immediate_data_size, | |
| 727 const void* cmd_data) { | |
| 728 const gles2::cmds::DeleteShader& c = | |
| 729 *static_cast<const gles2::cmds::DeleteShader*>(cmd_data); | |
| 730 (void)c; | |
| 731 GLuint shader = c.shader; | |
| 732 error::Error error = DoDeleteShader(shader); | |
| 733 if (error != error::kNoError) { | |
| 734 return error; | |
| 735 } | |
| 736 return error::kNoError; | |
| 737 } | |
| 738 | |
| 739 error::Error GLES2DecoderPassthroughImpl::HandleDeleteTexturesImmediate( | |
| 740 uint32_t immediate_data_size, | |
| 741 const void* cmd_data) { | |
| 742 const gles2::cmds::DeleteTexturesImmediate& c = | |
| 743 *static_cast<const gles2::cmds::DeleteTexturesImmediate*>(cmd_data); | |
| 744 (void)c; | |
| 745 GLsizei n = static_cast<GLsizei>(c.n); | |
| 746 uint32_t data_size; | |
| 747 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 748 return error::kOutOfBounds; | |
| 749 } | |
| 750 const GLuint* textures = | |
| 751 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 752 error::Error error = DoDeleteTextures(n, textures); | |
| 753 if (error != error::kNoError) { | |
| 754 return error; | |
| 755 } | |
| 756 return error::kNoError; | |
| 757 } | |
| 758 | |
| 759 error::Error | |
| 760 GLES2DecoderPassthroughImpl::HandleDeleteTransformFeedbacksImmediate( | |
| 761 uint32_t immediate_data_size, | |
| 762 const void* cmd_data) { | |
| 763 const gles2::cmds::DeleteTransformFeedbacksImmediate& c = | |
| 764 *static_cast<const gles2::cmds::DeleteTransformFeedbacksImmediate*>( | |
| 765 cmd_data); | |
| 766 (void)c; | |
| 767 GLsizei n = static_cast<GLsizei>(c.n); | |
| 768 uint32_t data_size; | |
| 769 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 770 return error::kOutOfBounds; | |
| 771 } | |
| 772 const GLuint* ids = | |
| 773 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 774 error::Error error = DoDeleteTransformFeedbacks(n, ids); | |
| 775 if (error != error::kNoError) { | |
| 776 return error; | |
| 777 } | |
| 778 return error::kNoError; | |
| 779 } | |
| 780 | |
| 781 error::Error GLES2DecoderPassthroughImpl::HandleDepthFunc( | |
| 782 uint32_t immediate_data_size, | |
| 783 const void* cmd_data) { | |
| 784 const gles2::cmds::DepthFunc& c = | |
| 785 *static_cast<const gles2::cmds::DepthFunc*>(cmd_data); | |
| 786 (void)c; | |
| 787 GLenum func = static_cast<GLenum>(c.func); | |
| 788 error::Error error = DoDepthFunc(func); | |
| 789 if (error != error::kNoError) { | |
| 790 return error; | |
| 791 } | |
| 792 return error::kNoError; | |
| 793 } | |
| 794 | |
| 795 error::Error GLES2DecoderPassthroughImpl::HandleDepthMask( | |
| 796 uint32_t immediate_data_size, | |
| 797 const void* cmd_data) { | |
| 798 const gles2::cmds::DepthMask& c = | |
| 799 *static_cast<const gles2::cmds::DepthMask*>(cmd_data); | |
| 800 (void)c; | |
| 801 GLboolean flag = static_cast<GLboolean>(c.flag); | |
| 802 error::Error error = DoDepthMask(flag); | |
| 803 if (error != error::kNoError) { | |
| 804 return error; | |
| 805 } | |
| 806 return error::kNoError; | |
| 807 } | |
| 808 | |
| 809 error::Error GLES2DecoderPassthroughImpl::HandleDepthRangef( | |
| 810 uint32_t immediate_data_size, | |
| 811 const void* cmd_data) { | |
| 812 const gles2::cmds::DepthRangef& c = | |
| 813 *static_cast<const gles2::cmds::DepthRangef*>(cmd_data); | |
| 814 (void)c; | |
| 815 GLclampf zNear = static_cast<GLclampf>(c.zNear); | |
| 816 GLclampf zFar = static_cast<GLclampf>(c.zFar); | |
| 817 error::Error error = DoDepthRangef(zNear, zFar); | |
| 818 if (error != error::kNoError) { | |
| 819 return error; | |
| 820 } | |
| 821 return error::kNoError; | |
| 822 } | |
| 823 | |
| 824 error::Error GLES2DecoderPassthroughImpl::HandleDetachShader( | |
| 825 uint32_t immediate_data_size, | |
| 826 const void* cmd_data) { | |
| 827 const gles2::cmds::DetachShader& c = | |
| 828 *static_cast<const gles2::cmds::DetachShader*>(cmd_data); | |
| 829 (void)c; | |
| 830 GLuint program = c.program; | |
| 831 GLuint shader = c.shader; | |
| 832 error::Error error = DoDetachShader(program, shader); | |
| 833 if (error != error::kNoError) { | |
| 834 return error; | |
| 835 } | |
| 836 return error::kNoError; | |
| 837 } | |
| 838 | |
| 839 error::Error GLES2DecoderPassthroughImpl::HandleDisable( | |
| 840 uint32_t immediate_data_size, | |
| 841 const void* cmd_data) { | |
| 842 const gles2::cmds::Disable& c = | |
| 843 *static_cast<const gles2::cmds::Disable*>(cmd_data); | |
| 844 (void)c; | |
| 845 GLenum cap = static_cast<GLenum>(c.cap); | |
| 846 error::Error error = DoDisable(cap); | |
| 847 if (error != error::kNoError) { | |
| 848 return error; | |
| 849 } | |
| 850 return error::kNoError; | |
| 851 } | |
| 852 | |
| 853 error::Error GLES2DecoderPassthroughImpl::HandleDisableVertexAttribArray( | |
| 854 uint32_t immediate_data_size, | |
| 855 const void* cmd_data) { | |
| 856 const gles2::cmds::DisableVertexAttribArray& c = | |
| 857 *static_cast<const gles2::cmds::DisableVertexAttribArray*>(cmd_data); | |
| 858 (void)c; | |
| 859 GLuint index = static_cast<GLuint>(c.index); | |
| 860 error::Error error = DoDisableVertexAttribArray(index); | |
| 861 if (error != error::kNoError) { | |
| 862 return error; | |
| 863 } | |
| 864 return error::kNoError; | |
| 865 } | |
| 866 | |
| 867 error::Error GLES2DecoderPassthroughImpl::HandleEnable( | |
| 868 uint32_t immediate_data_size, | |
| 869 const void* cmd_data) { | |
| 870 const gles2::cmds::Enable& c = | |
| 871 *static_cast<const gles2::cmds::Enable*>(cmd_data); | |
| 872 (void)c; | |
| 873 GLenum cap = static_cast<GLenum>(c.cap); | |
| 874 error::Error error = DoEnable(cap); | |
| 875 if (error != error::kNoError) { | |
| 876 return error; | |
| 877 } | |
| 878 return error::kNoError; | |
| 879 } | |
| 880 | |
| 881 error::Error GLES2DecoderPassthroughImpl::HandleEnableVertexAttribArray( | |
| 882 uint32_t immediate_data_size, | |
| 883 const void* cmd_data) { | |
| 884 const gles2::cmds::EnableVertexAttribArray& c = | |
| 885 *static_cast<const gles2::cmds::EnableVertexAttribArray*>(cmd_data); | |
| 886 (void)c; | |
| 887 GLuint index = static_cast<GLuint>(c.index); | |
| 888 error::Error error = DoEnableVertexAttribArray(index); | |
| 889 if (error != error::kNoError) { | |
| 890 return error; | |
| 891 } | |
| 892 return error::kNoError; | |
| 893 } | |
| 894 | |
| 895 error::Error GLES2DecoderPassthroughImpl::HandleFinish( | |
| 896 uint32_t immediate_data_size, | |
| 897 const void* cmd_data) { | |
| 898 const gles2::cmds::Finish& c = | |
| 899 *static_cast<const gles2::cmds::Finish*>(cmd_data); | |
| 900 (void)c; | |
| 901 error::Error error = DoFinish(); | |
| 902 if (error != error::kNoError) { | |
| 903 return error; | |
| 904 } | |
| 905 return error::kNoError; | |
| 906 } | |
| 907 | |
| 908 error::Error GLES2DecoderPassthroughImpl::HandleFlush( | |
| 909 uint32_t immediate_data_size, | |
| 910 const void* cmd_data) { | |
| 911 const gles2::cmds::Flush& c = | |
| 912 *static_cast<const gles2::cmds::Flush*>(cmd_data); | |
| 913 (void)c; | |
| 914 error::Error error = DoFlush(); | |
| 915 if (error != error::kNoError) { | |
| 916 return error; | |
| 917 } | |
| 918 return error::kNoError; | |
| 919 } | |
| 920 | |
| 921 error::Error GLES2DecoderPassthroughImpl::HandleFramebufferRenderbuffer( | |
| 922 uint32_t immediate_data_size, | |
| 923 const void* cmd_data) { | |
| 924 const gles2::cmds::FramebufferRenderbuffer& c = | |
| 925 *static_cast<const gles2::cmds::FramebufferRenderbuffer*>(cmd_data); | |
| 926 (void)c; | |
| 927 GLenum target = static_cast<GLenum>(c.target); | |
| 928 GLenum attachment = static_cast<GLenum>(c.attachment); | |
| 929 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); | |
| 930 GLuint renderbuffer = c.renderbuffer; | |
| 931 error::Error error = DoFramebufferRenderbuffer( | |
| 932 target, attachment, renderbuffertarget, renderbuffer); | |
| 933 if (error != error::kNoError) { | |
| 934 return error; | |
| 935 } | |
| 936 return error::kNoError; | |
| 937 } | |
| 938 | |
| 939 error::Error GLES2DecoderPassthroughImpl::HandleFramebufferTexture2D( | |
| 940 uint32_t immediate_data_size, | |
| 941 const void* cmd_data) { | |
| 942 const gles2::cmds::FramebufferTexture2D& c = | |
| 943 *static_cast<const gles2::cmds::FramebufferTexture2D*>(cmd_data); | |
| 944 (void)c; | |
| 945 GLenum target = static_cast<GLenum>(c.target); | |
| 946 GLenum attachment = static_cast<GLenum>(c.attachment); | |
| 947 GLenum textarget = static_cast<GLenum>(c.textarget); | |
| 948 GLuint texture = c.texture; | |
| 949 GLint level = static_cast<GLint>(c.level); | |
| 950 error::Error error = | |
| 951 DoFramebufferTexture2D(target, attachment, textarget, texture, level); | |
| 952 if (error != error::kNoError) { | |
| 953 return error; | |
| 954 } | |
| 955 return error::kNoError; | |
| 956 } | |
| 957 | |
| 958 error::Error GLES2DecoderPassthroughImpl::HandleFramebufferTextureLayer( | |
| 959 uint32_t immediate_data_size, | |
| 960 const void* cmd_data) { | |
| 961 const gles2::cmds::FramebufferTextureLayer& c = | |
| 962 *static_cast<const gles2::cmds::FramebufferTextureLayer*>(cmd_data); | |
| 963 (void)c; | |
| 964 GLenum target = static_cast<GLenum>(c.target); | |
| 965 GLenum attachment = static_cast<GLenum>(c.attachment); | |
| 966 GLuint texture = c.texture; | |
| 967 GLint level = static_cast<GLint>(c.level); | |
| 968 GLint layer = static_cast<GLint>(c.layer); | |
| 969 error::Error error = | |
| 970 DoFramebufferTextureLayer(target, attachment, texture, level, layer); | |
| 971 if (error != error::kNoError) { | |
| 972 return error; | |
| 973 } | |
| 974 return error::kNoError; | |
| 975 } | |
| 976 | |
| 977 error::Error GLES2DecoderPassthroughImpl::HandleFrontFace( | |
| 978 uint32_t immediate_data_size, | |
| 979 const void* cmd_data) { | |
| 980 const gles2::cmds::FrontFace& c = | |
| 981 *static_cast<const gles2::cmds::FrontFace*>(cmd_data); | |
| 982 (void)c; | |
| 983 GLenum mode = static_cast<GLenum>(c.mode); | |
| 984 error::Error error = DoFrontFace(mode); | |
| 985 if (error != error::kNoError) { | |
| 986 return error; | |
| 987 } | |
| 988 return error::kNoError; | |
| 989 } | |
| 990 | |
| 991 error::Error GLES2DecoderPassthroughImpl::HandleGenBuffersImmediate( | |
| 992 uint32_t immediate_data_size, | |
| 993 const void* cmd_data) { | |
| 994 const gles2::cmds::GenBuffersImmediate& c = | |
| 995 *static_cast<const gles2::cmds::GenBuffersImmediate*>(cmd_data); | |
| 996 (void)c; | |
| 997 GLsizei n = static_cast<GLsizei>(c.n); | |
| 998 uint32_t data_size; | |
| 999 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 1000 return error::kOutOfBounds; | |
| 1001 } | |
| 1002 GLuint* buffers = | |
| 1003 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 1004 error::Error error = DoGenBuffers(n, buffers); | |
| 1005 if (error != error::kNoError) { | |
| 1006 return error; | |
| 1007 } | |
| 1008 return error::kNoError; | |
| 1009 } | |
| 1010 | |
| 1011 error::Error GLES2DecoderPassthroughImpl::HandleGenerateMipmap( | |
| 1012 uint32_t immediate_data_size, | |
| 1013 const void* cmd_data) { | |
| 1014 const gles2::cmds::GenerateMipmap& c = | |
| 1015 *static_cast<const gles2::cmds::GenerateMipmap*>(cmd_data); | |
| 1016 (void)c; | |
| 1017 GLenum target = static_cast<GLenum>(c.target); | |
| 1018 error::Error error = DoGenerateMipmap(target); | |
| 1019 if (error != error::kNoError) { | |
| 1020 return error; | |
| 1021 } | |
| 1022 return error::kNoError; | |
| 1023 } | |
| 1024 | |
| 1025 error::Error GLES2DecoderPassthroughImpl::HandleGenFramebuffersImmediate( | |
| 1026 uint32_t immediate_data_size, | |
| 1027 const void* cmd_data) { | |
| 1028 const gles2::cmds::GenFramebuffersImmediate& c = | |
| 1029 *static_cast<const gles2::cmds::GenFramebuffersImmediate*>(cmd_data); | |
| 1030 (void)c; | |
| 1031 GLsizei n = static_cast<GLsizei>(c.n); | |
| 1032 uint32_t data_size; | |
| 1033 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 1034 return error::kOutOfBounds; | |
| 1035 } | |
| 1036 GLuint* framebuffers = | |
| 1037 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 1038 error::Error error = DoGenFramebuffers(n, framebuffers); | |
| 1039 if (error != error::kNoError) { | |
| 1040 return error; | |
| 1041 } | |
| 1042 return error::kNoError; | |
| 1043 } | |
| 1044 | |
| 1045 error::Error GLES2DecoderPassthroughImpl::HandleGenRenderbuffersImmediate( | |
| 1046 uint32_t immediate_data_size, | |
| 1047 const void* cmd_data) { | |
| 1048 const gles2::cmds::GenRenderbuffersImmediate& c = | |
| 1049 *static_cast<const gles2::cmds::GenRenderbuffersImmediate*>(cmd_data); | |
| 1050 (void)c; | |
| 1051 GLsizei n = static_cast<GLsizei>(c.n); | |
| 1052 uint32_t data_size; | |
| 1053 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 1054 return error::kOutOfBounds; | |
| 1055 } | |
| 1056 GLuint* renderbuffers = | |
| 1057 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 1058 error::Error error = DoGenRenderbuffers(n, renderbuffers); | |
| 1059 if (error != error::kNoError) { | |
| 1060 return error; | |
| 1061 } | |
| 1062 return error::kNoError; | |
| 1063 } | |
| 1064 | |
| 1065 error::Error GLES2DecoderPassthroughImpl::HandleGenSamplersImmediate( | |
| 1066 uint32_t immediate_data_size, | |
| 1067 const void* cmd_data) { | |
| 1068 const gles2::cmds::GenSamplersImmediate& c = | |
| 1069 *static_cast<const gles2::cmds::GenSamplersImmediate*>(cmd_data); | |
| 1070 (void)c; | |
| 1071 GLsizei n = static_cast<GLsizei>(c.n); | |
| 1072 uint32_t data_size; | |
| 1073 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 1074 return error::kOutOfBounds; | |
| 1075 } | |
| 1076 GLuint* samplers = | |
| 1077 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 1078 error::Error error = DoGenSamplers(n, samplers); | |
| 1079 if (error != error::kNoError) { | |
| 1080 return error; | |
| 1081 } | |
| 1082 return error::kNoError; | |
| 1083 } | |
| 1084 | |
| 1085 error::Error GLES2DecoderPassthroughImpl::HandleGenTexturesImmediate( | |
| 1086 uint32_t immediate_data_size, | |
| 1087 const void* cmd_data) { | |
| 1088 const gles2::cmds::GenTexturesImmediate& c = | |
| 1089 *static_cast<const gles2::cmds::GenTexturesImmediate*>(cmd_data); | |
| 1090 (void)c; | |
| 1091 GLsizei n = static_cast<GLsizei>(c.n); | |
| 1092 uint32_t data_size; | |
| 1093 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 1094 return error::kOutOfBounds; | |
| 1095 } | |
| 1096 GLuint* textures = | |
| 1097 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 1098 error::Error error = DoGenTextures(n, textures); | |
| 1099 if (error != error::kNoError) { | |
| 1100 return error; | |
| 1101 } | |
| 1102 return error::kNoError; | |
| 1103 } | |
| 1104 | |
| 1105 error::Error GLES2DecoderPassthroughImpl::HandleGenTransformFeedbacksImmediate( | |
| 1106 uint32_t immediate_data_size, | |
| 1107 const void* cmd_data) { | |
| 1108 const gles2::cmds::GenTransformFeedbacksImmediate& c = | |
| 1109 *static_cast<const gles2::cmds::GenTransformFeedbacksImmediate*>( | |
| 1110 cmd_data); | |
| 1111 (void)c; | |
| 1112 GLsizei n = static_cast<GLsizei>(c.n); | |
| 1113 uint32_t data_size; | |
| 1114 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 1115 return error::kOutOfBounds; | |
| 1116 } | |
| 1117 GLuint* ids = GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 1118 error::Error error = DoGenTransformFeedbacks(n, ids); | |
| 1119 if (error != error::kNoError) { | |
| 1120 return error; | |
| 1121 } | |
| 1122 return error::kNoError; | |
| 1123 } | |
| 1124 | |
| 1125 error::Error GLES2DecoderPassthroughImpl::HandleGetBooleanv( | |
| 1126 uint32_t immediate_data_size, | |
| 1127 const void* cmd_data) { | |
| 1128 const gles2::cmds::GetBooleanv& c = | |
| 1129 *static_cast<const gles2::cmds::GetBooleanv*>(cmd_data); | |
| 1130 (void)c; | |
| 1131 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1132 unsigned int buffer_size = 0; | |
| 1133 typedef cmds::GetBooleanv::Result Result; | |
| 1134 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1135 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1136 GLboolean* params = result ? result->GetData() : NULL; | |
| 1137 if (params == NULL) { | |
| 1138 return error::kOutOfBounds; | |
| 1139 } | |
| 1140 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1141 GLsizei written_values = 0; | |
| 1142 GLsizei* length = &written_values; | |
| 1143 error::Error error = DoGetBooleanv(pname, bufsize, length, params); | |
| 1144 if (error != error::kNoError) { | |
| 1145 return error; | |
| 1146 } | |
| 1147 if (written_values > bufsize) { | |
| 1148 return error::kOutOfBounds; | |
| 1149 } | |
| 1150 result->SetNumResults(written_values); | |
| 1151 return error::kNoError; | |
| 1152 } | |
| 1153 | |
| 1154 error::Error GLES2DecoderPassthroughImpl::HandleGetBufferParameteri64v( | |
| 1155 uint32_t immediate_data_size, | |
| 1156 const void* cmd_data) { | |
| 1157 const gles2::cmds::GetBufferParameteri64v& c = | |
| 1158 *static_cast<const gles2::cmds::GetBufferParameteri64v*>(cmd_data); | |
| 1159 (void)c; | |
| 1160 GLenum target = static_cast<GLenum>(c.target); | |
| 1161 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1162 unsigned int buffer_size = 0; | |
| 1163 typedef cmds::GetBufferParameteri64v::Result Result; | |
| 1164 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1165 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1166 GLint64* params = result ? result->GetData() : NULL; | |
| 1167 if (params == NULL) { | |
| 1168 return error::kOutOfBounds; | |
| 1169 } | |
| 1170 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1171 GLsizei written_values = 0; | |
| 1172 GLsizei* length = &written_values; | |
| 1173 error::Error error = | |
| 1174 DoGetBufferParameteri64v(target, pname, bufsize, length, params); | |
| 1175 if (error != error::kNoError) { | |
| 1176 return error; | |
| 1177 } | |
| 1178 if (written_values > bufsize) { | |
| 1179 return error::kOutOfBounds; | |
| 1180 } | |
| 1181 result->SetNumResults(written_values); | |
| 1182 return error::kNoError; | |
| 1183 } | |
| 1184 | |
| 1185 error::Error GLES2DecoderPassthroughImpl::HandleGetBufferParameteriv( | |
| 1186 uint32_t immediate_data_size, | |
| 1187 const void* cmd_data) { | |
| 1188 const gles2::cmds::GetBufferParameteriv& c = | |
| 1189 *static_cast<const gles2::cmds::GetBufferParameteriv*>(cmd_data); | |
| 1190 (void)c; | |
| 1191 GLenum target = static_cast<GLenum>(c.target); | |
| 1192 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1193 unsigned int buffer_size = 0; | |
| 1194 typedef cmds::GetBufferParameteriv::Result Result; | |
| 1195 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1196 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1197 GLint* params = result ? result->GetData() : NULL; | |
| 1198 if (params == NULL) { | |
| 1199 return error::kOutOfBounds; | |
| 1200 } | |
| 1201 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1202 GLsizei written_values = 0; | |
| 1203 GLsizei* length = &written_values; | |
| 1204 error::Error error = | |
| 1205 DoGetBufferParameteriv(target, pname, bufsize, length, params); | |
| 1206 if (error != error::kNoError) { | |
| 1207 return error; | |
| 1208 } | |
| 1209 if (written_values > bufsize) { | |
| 1210 return error::kOutOfBounds; | |
| 1211 } | |
| 1212 result->SetNumResults(written_values); | |
| 1213 return error::kNoError; | |
| 1214 } | |
| 1215 | |
| 1216 error::Error GLES2DecoderPassthroughImpl::HandleGetError( | |
| 1217 uint32_t immediate_data_size, | |
| 1218 const void* cmd_data) { | |
| 1219 const gles2::cmds::GetError& c = | |
| 1220 *static_cast<const gles2::cmds::GetError*>(cmd_data); | |
| 1221 (void)c; | |
| 1222 typedef cmds::GetError::Result Result; | |
| 1223 Result* result = GetSharedMemoryAs<Result*>( | |
| 1224 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1225 if (!result) { | |
| 1226 return error::kOutOfBounds; | |
| 1227 } | |
| 1228 error::Error error = DoGetError(result); | |
| 1229 if (error != error::kNoError) { | |
| 1230 return error; | |
| 1231 } | |
| 1232 return error::kNoError; | |
| 1233 } | |
| 1234 | |
| 1235 error::Error GLES2DecoderPassthroughImpl::HandleGetFloatv( | |
| 1236 uint32_t immediate_data_size, | |
| 1237 const void* cmd_data) { | |
| 1238 const gles2::cmds::GetFloatv& c = | |
| 1239 *static_cast<const gles2::cmds::GetFloatv*>(cmd_data); | |
| 1240 (void)c; | |
| 1241 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1242 unsigned int buffer_size = 0; | |
| 1243 typedef cmds::GetFloatv::Result Result; | |
| 1244 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1245 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1246 GLfloat* params = result ? result->GetData() : NULL; | |
| 1247 if (params == NULL) { | |
| 1248 return error::kOutOfBounds; | |
| 1249 } | |
| 1250 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1251 GLsizei written_values = 0; | |
| 1252 GLsizei* length = &written_values; | |
| 1253 error::Error error = DoGetFloatv(pname, bufsize, length, params); | |
| 1254 if (error != error::kNoError) { | |
| 1255 return error; | |
| 1256 } | |
| 1257 if (written_values > bufsize) { | |
| 1258 return error::kOutOfBounds; | |
| 1259 } | |
| 1260 result->SetNumResults(written_values); | |
| 1261 return error::kNoError; | |
| 1262 } | |
| 1263 | |
| 1264 error::Error | |
| 1265 GLES2DecoderPassthroughImpl::HandleGetFramebufferAttachmentParameteriv( | |
| 1266 uint32_t immediate_data_size, | |
| 1267 const void* cmd_data) { | |
| 1268 const gles2::cmds::GetFramebufferAttachmentParameteriv& c = | |
| 1269 *static_cast<const gles2::cmds::GetFramebufferAttachmentParameteriv*>( | |
| 1270 cmd_data); | |
| 1271 (void)c; | |
| 1272 GLenum target = static_cast<GLenum>(c.target); | |
| 1273 GLenum attachment = static_cast<GLenum>(c.attachment); | |
| 1274 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1275 unsigned int buffer_size = 0; | |
| 1276 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result; | |
| 1277 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1278 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1279 GLint* params = result ? result->GetData() : NULL; | |
| 1280 if (params == NULL) { | |
| 1281 return error::kOutOfBounds; | |
| 1282 } | |
| 1283 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1284 GLsizei written_values = 0; | |
| 1285 GLsizei* length = &written_values; | |
| 1286 error::Error error = DoGetFramebufferAttachmentParameteriv( | |
| 1287 target, attachment, pname, bufsize, length, params); | |
| 1288 if (error != error::kNoError) { | |
| 1289 return error; | |
| 1290 } | |
| 1291 if (written_values > bufsize) { | |
| 1292 return error::kOutOfBounds; | |
| 1293 } | |
| 1294 result->SetNumResults(written_values); | |
| 1295 return error::kNoError; | |
| 1296 } | |
| 1297 | |
| 1298 error::Error GLES2DecoderPassthroughImpl::HandleGetInteger64v( | |
| 1299 uint32_t immediate_data_size, | |
| 1300 const void* cmd_data) { | |
| 1301 const gles2::cmds::GetInteger64v& c = | |
| 1302 *static_cast<const gles2::cmds::GetInteger64v*>(cmd_data); | |
| 1303 (void)c; | |
| 1304 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1305 unsigned int buffer_size = 0; | |
| 1306 typedef cmds::GetInteger64v::Result Result; | |
| 1307 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1308 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1309 GLint64* params = result ? result->GetData() : NULL; | |
| 1310 if (params == NULL) { | |
| 1311 return error::kOutOfBounds; | |
| 1312 } | |
| 1313 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
|
Zhenyao Mo
2016/05/31 01:37:22
Isn't this the wrong value? The function only work
Geoff Lang
2016/06/01 20:11:51
Could you elaborate? bufsize here is the number o
Zhenyao Mo
2016/06/01 20:17:44
Never mind. I thought I read / sizeof(uint32_t),
| |
| 1314 GLsizei written_values = 0; | |
| 1315 GLsizei* length = &written_values; | |
| 1316 error::Error error = DoGetInteger64v(pname, bufsize, length, params); | |
| 1317 if (error != error::kNoError) { | |
| 1318 return error; | |
| 1319 } | |
| 1320 if (written_values > bufsize) { | |
| 1321 return error::kOutOfBounds; | |
| 1322 } | |
| 1323 result->SetNumResults(written_values); | |
| 1324 return error::kNoError; | |
| 1325 } | |
| 1326 | |
| 1327 error::Error GLES2DecoderPassthroughImpl::HandleGetIntegeri_v( | |
| 1328 uint32_t immediate_data_size, | |
| 1329 const void* cmd_data) { | |
| 1330 const gles2::cmds::GetIntegeri_v& c = | |
| 1331 *static_cast<const gles2::cmds::GetIntegeri_v*>(cmd_data); | |
| 1332 (void)c; | |
| 1333 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1334 GLuint index = static_cast<GLuint>(c.index); | |
| 1335 unsigned int buffer_size = 0; | |
| 1336 typedef cmds::GetIntegeri_v::Result Result; | |
| 1337 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1338 c.data_shm_id, c.data_shm_offset, &buffer_size); | |
| 1339 GLint* data = result ? result->GetData() : NULL; | |
| 1340 if (data == NULL) { | |
| 1341 return error::kOutOfBounds; | |
| 1342 } | |
| 1343 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1344 GLsizei written_values = 0; | |
| 1345 GLsizei* length = &written_values; | |
| 1346 error::Error error = DoGetIntegeri_v(pname, index, bufsize, length, data); | |
| 1347 if (error != error::kNoError) { | |
| 1348 return error; | |
| 1349 } | |
| 1350 if (written_values > bufsize) { | |
| 1351 return error::kOutOfBounds; | |
| 1352 } | |
| 1353 result->SetNumResults(written_values); | |
| 1354 return error::kNoError; | |
| 1355 } | |
| 1356 | |
| 1357 error::Error GLES2DecoderPassthroughImpl::HandleGetInteger64i_v( | |
| 1358 uint32_t immediate_data_size, | |
| 1359 const void* cmd_data) { | |
| 1360 const gles2::cmds::GetInteger64i_v& c = | |
| 1361 *static_cast<const gles2::cmds::GetInteger64i_v*>(cmd_data); | |
| 1362 (void)c; | |
| 1363 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1364 GLuint index = static_cast<GLuint>(c.index); | |
| 1365 unsigned int buffer_size = 0; | |
| 1366 typedef cmds::GetInteger64i_v::Result Result; | |
| 1367 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1368 c.data_shm_id, c.data_shm_offset, &buffer_size); | |
| 1369 GLint64* data = result ? result->GetData() : NULL; | |
| 1370 if (data == NULL) { | |
| 1371 return error::kOutOfBounds; | |
| 1372 } | |
| 1373 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
|
Zhenyao Mo
2016/05/31 01:37:22
Same here. It seems to be ComputeMaxResults() doe
| |
| 1374 GLsizei written_values = 0; | |
| 1375 GLsizei* length = &written_values; | |
| 1376 error::Error error = DoGetInteger64i_v(pname, index, bufsize, length, data); | |
| 1377 if (error != error::kNoError) { | |
| 1378 return error; | |
| 1379 } | |
| 1380 if (written_values > bufsize) { | |
| 1381 return error::kOutOfBounds; | |
| 1382 } | |
| 1383 result->SetNumResults(written_values); | |
| 1384 return error::kNoError; | |
| 1385 } | |
| 1386 | |
| 1387 error::Error GLES2DecoderPassthroughImpl::HandleGetIntegerv( | |
| 1388 uint32_t immediate_data_size, | |
| 1389 const void* cmd_data) { | |
| 1390 const gles2::cmds::GetIntegerv& c = | |
| 1391 *static_cast<const gles2::cmds::GetIntegerv*>(cmd_data); | |
| 1392 (void)c; | |
| 1393 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1394 unsigned int buffer_size = 0; | |
| 1395 typedef cmds::GetIntegerv::Result Result; | |
| 1396 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1397 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1398 GLint* params = result ? result->GetData() : NULL; | |
| 1399 if (params == NULL) { | |
| 1400 return error::kOutOfBounds; | |
| 1401 } | |
| 1402 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1403 GLsizei written_values = 0; | |
| 1404 GLsizei* length = &written_values; | |
| 1405 error::Error error = DoGetIntegerv(pname, bufsize, length, params); | |
| 1406 if (error != error::kNoError) { | |
| 1407 return error; | |
| 1408 } | |
| 1409 if (written_values > bufsize) { | |
| 1410 return error::kOutOfBounds; | |
| 1411 } | |
| 1412 result->SetNumResults(written_values); | |
| 1413 return error::kNoError; | |
| 1414 } | |
| 1415 | |
| 1416 error::Error GLES2DecoderPassthroughImpl::HandleGetProgramiv( | |
| 1417 uint32_t immediate_data_size, | |
| 1418 const void* cmd_data) { | |
| 1419 const gles2::cmds::GetProgramiv& c = | |
| 1420 *static_cast<const gles2::cmds::GetProgramiv*>(cmd_data); | |
| 1421 (void)c; | |
| 1422 GLuint program = c.program; | |
| 1423 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1424 unsigned int buffer_size = 0; | |
| 1425 typedef cmds::GetProgramiv::Result Result; | |
| 1426 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1427 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1428 GLint* params = result ? result->GetData() : NULL; | |
| 1429 if (params == NULL) { | |
| 1430 return error::kOutOfBounds; | |
| 1431 } | |
| 1432 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1433 GLsizei written_values = 0; | |
| 1434 GLsizei* length = &written_values; | |
| 1435 error::Error error = DoGetProgramiv(program, pname, bufsize, length, params); | |
| 1436 if (error != error::kNoError) { | |
| 1437 return error; | |
| 1438 } | |
| 1439 if (written_values > bufsize) { | |
| 1440 return error::kOutOfBounds; | |
| 1441 } | |
| 1442 result->SetNumResults(written_values); | |
| 1443 return error::kNoError; | |
| 1444 } | |
| 1445 | |
| 1446 error::Error GLES2DecoderPassthroughImpl::HandleGetRenderbufferParameteriv( | |
| 1447 uint32_t immediate_data_size, | |
| 1448 const void* cmd_data) { | |
| 1449 const gles2::cmds::GetRenderbufferParameteriv& c = | |
| 1450 *static_cast<const gles2::cmds::GetRenderbufferParameteriv*>(cmd_data); | |
| 1451 (void)c; | |
| 1452 GLenum target = static_cast<GLenum>(c.target); | |
| 1453 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1454 unsigned int buffer_size = 0; | |
| 1455 typedef cmds::GetRenderbufferParameteriv::Result Result; | |
| 1456 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1457 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1458 GLint* params = result ? result->GetData() : NULL; | |
| 1459 if (params == NULL) { | |
| 1460 return error::kOutOfBounds; | |
| 1461 } | |
| 1462 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1463 GLsizei written_values = 0; | |
| 1464 GLsizei* length = &written_values; | |
| 1465 error::Error error = | |
| 1466 DoGetRenderbufferParameteriv(target, pname, bufsize, length, params); | |
| 1467 if (error != error::kNoError) { | |
| 1468 return error; | |
| 1469 } | |
| 1470 if (written_values > bufsize) { | |
| 1471 return error::kOutOfBounds; | |
| 1472 } | |
| 1473 result->SetNumResults(written_values); | |
| 1474 return error::kNoError; | |
| 1475 } | |
| 1476 | |
| 1477 error::Error GLES2DecoderPassthroughImpl::HandleGetSamplerParameterfv( | |
| 1478 uint32_t immediate_data_size, | |
| 1479 const void* cmd_data) { | |
| 1480 const gles2::cmds::GetSamplerParameterfv& c = | |
| 1481 *static_cast<const gles2::cmds::GetSamplerParameterfv*>(cmd_data); | |
| 1482 (void)c; | |
| 1483 GLuint sampler = c.sampler; | |
| 1484 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1485 unsigned int buffer_size = 0; | |
| 1486 typedef cmds::GetSamplerParameterfv::Result Result; | |
| 1487 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1488 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1489 GLfloat* params = result ? result->GetData() : NULL; | |
| 1490 if (params == NULL) { | |
| 1491 return error::kOutOfBounds; | |
| 1492 } | |
| 1493 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1494 GLsizei written_values = 0; | |
| 1495 GLsizei* length = &written_values; | |
| 1496 error::Error error = | |
| 1497 DoGetSamplerParameterfv(sampler, pname, bufsize, length, params); | |
| 1498 if (error != error::kNoError) { | |
| 1499 return error; | |
| 1500 } | |
| 1501 if (written_values > bufsize) { | |
| 1502 return error::kOutOfBounds; | |
| 1503 } | |
| 1504 result->SetNumResults(written_values); | |
| 1505 return error::kNoError; | |
| 1506 } | |
| 1507 | |
| 1508 error::Error GLES2DecoderPassthroughImpl::HandleGetSamplerParameteriv( | |
| 1509 uint32_t immediate_data_size, | |
| 1510 const void* cmd_data) { | |
| 1511 const gles2::cmds::GetSamplerParameteriv& c = | |
| 1512 *static_cast<const gles2::cmds::GetSamplerParameteriv*>(cmd_data); | |
| 1513 (void)c; | |
| 1514 GLuint sampler = c.sampler; | |
| 1515 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1516 unsigned int buffer_size = 0; | |
| 1517 typedef cmds::GetSamplerParameteriv::Result Result; | |
| 1518 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1519 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1520 GLint* params = result ? result->GetData() : NULL; | |
| 1521 if (params == NULL) { | |
| 1522 return error::kOutOfBounds; | |
| 1523 } | |
| 1524 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1525 GLsizei written_values = 0; | |
| 1526 GLsizei* length = &written_values; | |
| 1527 error::Error error = | |
| 1528 DoGetSamplerParameteriv(sampler, pname, bufsize, length, params); | |
| 1529 if (error != error::kNoError) { | |
| 1530 return error; | |
| 1531 } | |
| 1532 if (written_values > bufsize) { | |
| 1533 return error::kOutOfBounds; | |
| 1534 } | |
| 1535 result->SetNumResults(written_values); | |
| 1536 return error::kNoError; | |
| 1537 } | |
| 1538 | |
| 1539 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderiv( | |
| 1540 uint32_t immediate_data_size, | |
| 1541 const void* cmd_data) { | |
| 1542 const gles2::cmds::GetShaderiv& c = | |
| 1543 *static_cast<const gles2::cmds::GetShaderiv*>(cmd_data); | |
| 1544 (void)c; | |
| 1545 GLuint shader = c.shader; | |
| 1546 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1547 unsigned int buffer_size = 0; | |
| 1548 typedef cmds::GetShaderiv::Result Result; | |
| 1549 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1550 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1551 GLint* params = result ? result->GetData() : NULL; | |
| 1552 if (params == NULL) { | |
| 1553 return error::kOutOfBounds; | |
| 1554 } | |
| 1555 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1556 GLsizei written_values = 0; | |
| 1557 GLsizei* length = &written_values; | |
| 1558 error::Error error = DoGetShaderiv(shader, pname, bufsize, length, params); | |
| 1559 if (error != error::kNoError) { | |
| 1560 return error; | |
| 1561 } | |
| 1562 if (written_values > bufsize) { | |
| 1563 return error::kOutOfBounds; | |
| 1564 } | |
| 1565 result->SetNumResults(written_values); | |
| 1566 return error::kNoError; | |
| 1567 } | |
| 1568 | |
| 1569 error::Error GLES2DecoderPassthroughImpl::HandleGetSynciv( | |
| 1570 uint32_t immediate_data_size, | |
| 1571 const void* cmd_data) { | |
| 1572 const gles2::cmds::GetSynciv& c = | |
| 1573 *static_cast<const gles2::cmds::GetSynciv*>(cmd_data); | |
| 1574 (void)c; | |
| 1575 GLuint sync = static_cast<GLuint>(c.sync); | |
| 1576 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1577 unsigned int buffer_size = 0; | |
| 1578 typedef cmds::GetSynciv::Result Result; | |
| 1579 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1580 c.values_shm_id, c.values_shm_offset, &buffer_size); | |
| 1581 GLint* values = result ? result->GetData() : NULL; | |
| 1582 if (values == NULL) { | |
| 1583 return error::kOutOfBounds; | |
| 1584 } | |
| 1585 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1586 GLsizei written_values = 0; | |
| 1587 GLsizei* length = &written_values; | |
| 1588 error::Error error = DoGetSynciv(sync, pname, bufsize, length, values); | |
| 1589 if (error != error::kNoError) { | |
| 1590 return error; | |
| 1591 } | |
| 1592 if (written_values > bufsize) { | |
| 1593 return error::kOutOfBounds; | |
| 1594 } | |
| 1595 result->SetNumResults(written_values); | |
| 1596 return error::kNoError; | |
| 1597 } | |
| 1598 | |
| 1599 error::Error GLES2DecoderPassthroughImpl::HandleGetTexParameterfv( | |
| 1600 uint32_t immediate_data_size, | |
| 1601 const void* cmd_data) { | |
| 1602 const gles2::cmds::GetTexParameterfv& c = | |
| 1603 *static_cast<const gles2::cmds::GetTexParameterfv*>(cmd_data); | |
| 1604 (void)c; | |
| 1605 GLenum target = static_cast<GLenum>(c.target); | |
| 1606 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1607 unsigned int buffer_size = 0; | |
| 1608 typedef cmds::GetTexParameterfv::Result Result; | |
| 1609 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1610 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1611 GLfloat* params = result ? result->GetData() : NULL; | |
| 1612 if (params == NULL) { | |
| 1613 return error::kOutOfBounds; | |
| 1614 } | |
| 1615 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1616 GLsizei written_values = 0; | |
| 1617 GLsizei* length = &written_values; | |
| 1618 error::Error error = | |
| 1619 DoGetTexParameterfv(target, pname, bufsize, length, params); | |
| 1620 if (error != error::kNoError) { | |
| 1621 return error; | |
| 1622 } | |
| 1623 if (written_values > bufsize) { | |
| 1624 return error::kOutOfBounds; | |
| 1625 } | |
| 1626 result->SetNumResults(written_values); | |
| 1627 return error::kNoError; | |
| 1628 } | |
| 1629 | |
| 1630 error::Error GLES2DecoderPassthroughImpl::HandleGetTexParameteriv( | |
| 1631 uint32_t immediate_data_size, | |
| 1632 const void* cmd_data) { | |
| 1633 const gles2::cmds::GetTexParameteriv& c = | |
| 1634 *static_cast<const gles2::cmds::GetTexParameteriv*>(cmd_data); | |
| 1635 (void)c; | |
| 1636 GLenum target = static_cast<GLenum>(c.target); | |
| 1637 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1638 unsigned int buffer_size = 0; | |
| 1639 typedef cmds::GetTexParameteriv::Result Result; | |
| 1640 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1641 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1642 GLint* params = result ? result->GetData() : NULL; | |
| 1643 if (params == NULL) { | |
| 1644 return error::kOutOfBounds; | |
| 1645 } | |
| 1646 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1647 GLsizei written_values = 0; | |
| 1648 GLsizei* length = &written_values; | |
| 1649 error::Error error = | |
| 1650 DoGetTexParameteriv(target, pname, bufsize, length, params); | |
| 1651 if (error != error::kNoError) { | |
| 1652 return error; | |
| 1653 } | |
| 1654 if (written_values > bufsize) { | |
| 1655 return error::kOutOfBounds; | |
| 1656 } | |
| 1657 result->SetNumResults(written_values); | |
| 1658 return error::kNoError; | |
| 1659 } | |
| 1660 | |
| 1661 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribfv( | |
| 1662 uint32_t immediate_data_size, | |
| 1663 const void* cmd_data) { | |
| 1664 const gles2::cmds::GetVertexAttribfv& c = | |
| 1665 *static_cast<const gles2::cmds::GetVertexAttribfv*>(cmd_data); | |
| 1666 (void)c; | |
| 1667 GLuint index = static_cast<GLuint>(c.index); | |
| 1668 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1669 unsigned int buffer_size = 0; | |
| 1670 typedef cmds::GetVertexAttribfv::Result Result; | |
| 1671 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1672 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1673 GLfloat* params = result ? result->GetData() : NULL; | |
| 1674 if (params == NULL) { | |
| 1675 return error::kOutOfBounds; | |
| 1676 } | |
| 1677 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1678 GLsizei written_values = 0; | |
| 1679 GLsizei* length = &written_values; | |
| 1680 error::Error error = | |
| 1681 DoGetVertexAttribfv(index, pname, bufsize, length, params); | |
| 1682 if (error != error::kNoError) { | |
| 1683 return error; | |
| 1684 } | |
| 1685 if (written_values > bufsize) { | |
| 1686 return error::kOutOfBounds; | |
| 1687 } | |
| 1688 result->SetNumResults(written_values); | |
| 1689 return error::kNoError; | |
| 1690 } | |
| 1691 | |
| 1692 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribiv( | |
| 1693 uint32_t immediate_data_size, | |
| 1694 const void* cmd_data) { | |
| 1695 const gles2::cmds::GetVertexAttribiv& c = | |
| 1696 *static_cast<const gles2::cmds::GetVertexAttribiv*>(cmd_data); | |
| 1697 (void)c; | |
| 1698 GLuint index = static_cast<GLuint>(c.index); | |
| 1699 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1700 unsigned int buffer_size = 0; | |
| 1701 typedef cmds::GetVertexAttribiv::Result Result; | |
| 1702 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1703 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1704 GLint* params = result ? result->GetData() : NULL; | |
| 1705 if (params == NULL) { | |
| 1706 return error::kOutOfBounds; | |
| 1707 } | |
| 1708 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1709 GLsizei written_values = 0; | |
| 1710 GLsizei* length = &written_values; | |
| 1711 error::Error error = | |
| 1712 DoGetVertexAttribiv(index, pname, bufsize, length, params); | |
| 1713 if (error != error::kNoError) { | |
| 1714 return error; | |
| 1715 } | |
| 1716 if (written_values > bufsize) { | |
| 1717 return error::kOutOfBounds; | |
| 1718 } | |
| 1719 result->SetNumResults(written_values); | |
| 1720 return error::kNoError; | |
| 1721 } | |
| 1722 | |
| 1723 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribIiv( | |
| 1724 uint32_t immediate_data_size, | |
| 1725 const void* cmd_data) { | |
| 1726 const gles2::cmds::GetVertexAttribIiv& c = | |
| 1727 *static_cast<const gles2::cmds::GetVertexAttribIiv*>(cmd_data); | |
| 1728 (void)c; | |
| 1729 GLuint index = static_cast<GLuint>(c.index); | |
| 1730 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1731 unsigned int buffer_size = 0; | |
| 1732 typedef cmds::GetVertexAttribIiv::Result Result; | |
| 1733 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1734 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1735 GLint* params = result ? result->GetData() : NULL; | |
| 1736 if (params == NULL) { | |
| 1737 return error::kOutOfBounds; | |
| 1738 } | |
| 1739 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1740 GLsizei written_values = 0; | |
| 1741 GLsizei* length = &written_values; | |
| 1742 error::Error error = | |
| 1743 DoGetVertexAttribIiv(index, pname, bufsize, length, params); | |
| 1744 if (error != error::kNoError) { | |
| 1745 return error; | |
| 1746 } | |
| 1747 if (written_values > bufsize) { | |
| 1748 return error::kOutOfBounds; | |
| 1749 } | |
| 1750 result->SetNumResults(written_values); | |
| 1751 return error::kNoError; | |
| 1752 } | |
| 1753 | |
| 1754 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribIuiv( | |
| 1755 uint32_t immediate_data_size, | |
| 1756 const void* cmd_data) { | |
| 1757 const gles2::cmds::GetVertexAttribIuiv& c = | |
| 1758 *static_cast<const gles2::cmds::GetVertexAttribIuiv*>(cmd_data); | |
| 1759 (void)c; | |
| 1760 GLuint index = static_cast<GLuint>(c.index); | |
| 1761 GLenum pname = static_cast<GLenum>(c.pname); | |
| 1762 unsigned int buffer_size = 0; | |
| 1763 typedef cmds::GetVertexAttribIuiv::Result Result; | |
| 1764 Result* result = GetSharedMemoryAndSizeAs<Result*>( | |
| 1765 c.params_shm_id, c.params_shm_offset, &buffer_size); | |
| 1766 GLuint* params = result ? result->GetData() : NULL; | |
| 1767 if (params == NULL) { | |
| 1768 return error::kOutOfBounds; | |
| 1769 } | |
| 1770 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | |
| 1771 GLsizei written_values = 0; | |
| 1772 GLsizei* length = &written_values; | |
| 1773 error::Error error = | |
| 1774 DoGetVertexAttribIuiv(index, pname, bufsize, length, params); | |
| 1775 if (error != error::kNoError) { | |
| 1776 return error; | |
| 1777 } | |
| 1778 if (written_values > bufsize) { | |
| 1779 return error::kOutOfBounds; | |
| 1780 } | |
| 1781 result->SetNumResults(written_values); | |
| 1782 return error::kNoError; | |
| 1783 } | |
| 1784 | |
| 1785 error::Error GLES2DecoderPassthroughImpl::HandleHint( | |
| 1786 uint32_t immediate_data_size, | |
| 1787 const void* cmd_data) { | |
| 1788 const gles2::cmds::Hint& c = *static_cast<const gles2::cmds::Hint*>(cmd_data); | |
| 1789 (void)c; | |
| 1790 GLenum target = static_cast<GLenum>(c.target); | |
| 1791 GLenum mode = static_cast<GLenum>(c.mode); | |
| 1792 error::Error error = DoHint(target, mode); | |
| 1793 if (error != error::kNoError) { | |
| 1794 return error; | |
| 1795 } | |
| 1796 return error::kNoError; | |
| 1797 } | |
| 1798 | |
| 1799 error::Error GLES2DecoderPassthroughImpl::HandleInvalidateFramebufferImmediate( | |
| 1800 uint32_t immediate_data_size, | |
| 1801 const void* cmd_data) { | |
| 1802 const gles2::cmds::InvalidateFramebufferImmediate& c = | |
| 1803 *static_cast<const gles2::cmds::InvalidateFramebufferImmediate*>( | |
| 1804 cmd_data); | |
| 1805 (void)c; | |
| 1806 GLenum target = static_cast<GLenum>(c.target); | |
| 1807 GLsizei count = static_cast<GLsizei>(c.count); | |
| 1808 uint32_t data_size = 0; | |
| 1809 if (count >= 0 && | |
| 1810 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { | |
| 1811 return error::kOutOfBounds; | |
| 1812 } | |
| 1813 if (data_size > immediate_data_size) { | |
| 1814 return error::kOutOfBounds; | |
| 1815 } | |
| 1816 const GLenum* attachments = | |
| 1817 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); | |
| 1818 error::Error error = DoInvalidateFramebuffer(target, count, attachments); | |
| 1819 if (error != error::kNoError) { | |
| 1820 return error; | |
| 1821 } | |
| 1822 return error::kNoError; | |
| 1823 } | |
| 1824 | |
| 1825 error::Error | |
| 1826 GLES2DecoderPassthroughImpl::HandleInvalidateSubFramebufferImmediate( | |
| 1827 uint32_t immediate_data_size, | |
| 1828 const void* cmd_data) { | |
| 1829 const gles2::cmds::InvalidateSubFramebufferImmediate& c = | |
| 1830 *static_cast<const gles2::cmds::InvalidateSubFramebufferImmediate*>( | |
| 1831 cmd_data); | |
| 1832 (void)c; | |
| 1833 GLenum target = static_cast<GLenum>(c.target); | |
| 1834 GLsizei count = static_cast<GLsizei>(c.count); | |
| 1835 uint32_t data_size = 0; | |
| 1836 if (count >= 0 && | |
| 1837 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { | |
| 1838 return error::kOutOfBounds; | |
| 1839 } | |
| 1840 if (data_size > immediate_data_size) { | |
| 1841 return error::kOutOfBounds; | |
| 1842 } | |
| 1843 const GLenum* attachments = | |
| 1844 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); | |
| 1845 GLint x = static_cast<GLint>(c.x); | |
| 1846 GLint y = static_cast<GLint>(c.y); | |
| 1847 GLsizei width = static_cast<GLsizei>(c.width); | |
| 1848 GLsizei height = static_cast<GLsizei>(c.height); | |
| 1849 error::Error error = DoInvalidateSubFramebuffer(target, count, attachments, x, | |
| 1850 y, width, height); | |
| 1851 if (error != error::kNoError) { | |
| 1852 return error; | |
| 1853 } | |
| 1854 return error::kNoError; | |
| 1855 } | |
| 1856 | |
| 1857 error::Error GLES2DecoderPassthroughImpl::HandleIsBuffer( | |
| 1858 uint32_t immediate_data_size, | |
| 1859 const void* cmd_data) { | |
| 1860 const gles2::cmds::IsBuffer& c = | |
| 1861 *static_cast<const gles2::cmds::IsBuffer*>(cmd_data); | |
| 1862 (void)c; | |
| 1863 GLuint buffer = c.buffer; | |
| 1864 typedef cmds::IsBuffer::Result Result; | |
| 1865 Result* result = GetSharedMemoryAs<Result*>( | |
| 1866 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1867 if (!result) { | |
| 1868 return error::kOutOfBounds; | |
| 1869 } | |
| 1870 error::Error error = DoIsBuffer(buffer, result); | |
| 1871 if (error != error::kNoError) { | |
| 1872 return error; | |
| 1873 } | |
| 1874 return error::kNoError; | |
| 1875 } | |
| 1876 | |
| 1877 error::Error GLES2DecoderPassthroughImpl::HandleIsEnabled( | |
| 1878 uint32_t immediate_data_size, | |
| 1879 const void* cmd_data) { | |
| 1880 const gles2::cmds::IsEnabled& c = | |
| 1881 *static_cast<const gles2::cmds::IsEnabled*>(cmd_data); | |
| 1882 (void)c; | |
| 1883 GLenum cap = static_cast<GLenum>(c.cap); | |
| 1884 typedef cmds::IsEnabled::Result Result; | |
| 1885 Result* result = GetSharedMemoryAs<Result*>( | |
| 1886 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1887 if (!result) { | |
| 1888 return error::kOutOfBounds; | |
| 1889 } | |
| 1890 error::Error error = DoIsEnabled(cap, result); | |
| 1891 if (error != error::kNoError) { | |
| 1892 return error; | |
| 1893 } | |
| 1894 return error::kNoError; | |
| 1895 } | |
| 1896 | |
| 1897 error::Error GLES2DecoderPassthroughImpl::HandleIsFramebuffer( | |
| 1898 uint32_t immediate_data_size, | |
| 1899 const void* cmd_data) { | |
| 1900 const gles2::cmds::IsFramebuffer& c = | |
| 1901 *static_cast<const gles2::cmds::IsFramebuffer*>(cmd_data); | |
| 1902 (void)c; | |
| 1903 GLuint framebuffer = c.framebuffer; | |
| 1904 typedef cmds::IsFramebuffer::Result Result; | |
| 1905 Result* result = GetSharedMemoryAs<Result*>( | |
| 1906 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1907 if (!result) { | |
| 1908 return error::kOutOfBounds; | |
| 1909 } | |
| 1910 error::Error error = DoIsFramebuffer(framebuffer, result); | |
| 1911 if (error != error::kNoError) { | |
| 1912 return error; | |
| 1913 } | |
| 1914 return error::kNoError; | |
| 1915 } | |
| 1916 | |
| 1917 error::Error GLES2DecoderPassthroughImpl::HandleIsProgram( | |
| 1918 uint32_t immediate_data_size, | |
| 1919 const void* cmd_data) { | |
| 1920 const gles2::cmds::IsProgram& c = | |
| 1921 *static_cast<const gles2::cmds::IsProgram*>(cmd_data); | |
| 1922 (void)c; | |
| 1923 GLuint program = c.program; | |
| 1924 typedef cmds::IsProgram::Result Result; | |
| 1925 Result* result = GetSharedMemoryAs<Result*>( | |
| 1926 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1927 if (!result) { | |
| 1928 return error::kOutOfBounds; | |
| 1929 } | |
| 1930 error::Error error = DoIsProgram(program, result); | |
| 1931 if (error != error::kNoError) { | |
| 1932 return error; | |
| 1933 } | |
| 1934 return error::kNoError; | |
| 1935 } | |
| 1936 | |
| 1937 error::Error GLES2DecoderPassthroughImpl::HandleIsRenderbuffer( | |
| 1938 uint32_t immediate_data_size, | |
| 1939 const void* cmd_data) { | |
| 1940 const gles2::cmds::IsRenderbuffer& c = | |
| 1941 *static_cast<const gles2::cmds::IsRenderbuffer*>(cmd_data); | |
| 1942 (void)c; | |
| 1943 GLuint renderbuffer = c.renderbuffer; | |
| 1944 typedef cmds::IsRenderbuffer::Result Result; | |
| 1945 Result* result = GetSharedMemoryAs<Result*>( | |
| 1946 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1947 if (!result) { | |
| 1948 return error::kOutOfBounds; | |
| 1949 } | |
| 1950 error::Error error = DoIsRenderbuffer(renderbuffer, result); | |
| 1951 if (error != error::kNoError) { | |
| 1952 return error; | |
| 1953 } | |
| 1954 return error::kNoError; | |
| 1955 } | |
| 1956 | |
| 1957 error::Error GLES2DecoderPassthroughImpl::HandleIsSampler( | |
| 1958 uint32_t immediate_data_size, | |
| 1959 const void* cmd_data) { | |
| 1960 const gles2::cmds::IsSampler& c = | |
| 1961 *static_cast<const gles2::cmds::IsSampler*>(cmd_data); | |
| 1962 (void)c; | |
| 1963 GLuint sampler = c.sampler; | |
| 1964 typedef cmds::IsSampler::Result Result; | |
| 1965 Result* result = GetSharedMemoryAs<Result*>( | |
| 1966 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1967 if (!result) { | |
| 1968 return error::kOutOfBounds; | |
| 1969 } | |
| 1970 error::Error error = DoIsSampler(sampler, result); | |
| 1971 if (error != error::kNoError) { | |
| 1972 return error; | |
| 1973 } | |
| 1974 return error::kNoError; | |
| 1975 } | |
| 1976 | |
| 1977 error::Error GLES2DecoderPassthroughImpl::HandleIsShader( | |
| 1978 uint32_t immediate_data_size, | |
| 1979 const void* cmd_data) { | |
| 1980 const gles2::cmds::IsShader& c = | |
| 1981 *static_cast<const gles2::cmds::IsShader*>(cmd_data); | |
| 1982 (void)c; | |
| 1983 GLuint shader = c.shader; | |
| 1984 typedef cmds::IsShader::Result Result; | |
| 1985 Result* result = GetSharedMemoryAs<Result*>( | |
| 1986 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 1987 if (!result) { | |
| 1988 return error::kOutOfBounds; | |
| 1989 } | |
| 1990 error::Error error = DoIsShader(shader, result); | |
| 1991 if (error != error::kNoError) { | |
| 1992 return error; | |
| 1993 } | |
| 1994 return error::kNoError; | |
| 1995 } | |
| 1996 | |
| 1997 error::Error GLES2DecoderPassthroughImpl::HandleIsSync( | |
| 1998 uint32_t immediate_data_size, | |
| 1999 const void* cmd_data) { | |
| 2000 const gles2::cmds::IsSync& c = | |
| 2001 *static_cast<const gles2::cmds::IsSync*>(cmd_data); | |
| 2002 (void)c; | |
| 2003 GLuint sync = c.sync; | |
| 2004 typedef cmds::IsSync::Result Result; | |
| 2005 Result* result = GetSharedMemoryAs<Result*>( | |
| 2006 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 2007 if (!result) { | |
| 2008 return error::kOutOfBounds; | |
| 2009 } | |
| 2010 error::Error error = DoIsSync(sync, result); | |
| 2011 if (error != error::kNoError) { | |
| 2012 return error; | |
| 2013 } | |
| 2014 return error::kNoError; | |
| 2015 } | |
| 2016 | |
| 2017 error::Error GLES2DecoderPassthroughImpl::HandleIsTexture( | |
| 2018 uint32_t immediate_data_size, | |
| 2019 const void* cmd_data) { | |
| 2020 const gles2::cmds::IsTexture& c = | |
| 2021 *static_cast<const gles2::cmds::IsTexture*>(cmd_data); | |
| 2022 (void)c; | |
| 2023 GLuint texture = c.texture; | |
| 2024 typedef cmds::IsTexture::Result Result; | |
| 2025 Result* result = GetSharedMemoryAs<Result*>( | |
| 2026 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 2027 if (!result) { | |
| 2028 return error::kOutOfBounds; | |
| 2029 } | |
| 2030 error::Error error = DoIsTexture(texture, result); | |
| 2031 if (error != error::kNoError) { | |
| 2032 return error; | |
| 2033 } | |
| 2034 return error::kNoError; | |
| 2035 } | |
| 2036 | |
| 2037 error::Error GLES2DecoderPassthroughImpl::HandleIsTransformFeedback( | |
| 2038 uint32_t immediate_data_size, | |
| 2039 const void* cmd_data) { | |
| 2040 const gles2::cmds::IsTransformFeedback& c = | |
| 2041 *static_cast<const gles2::cmds::IsTransformFeedback*>(cmd_data); | |
| 2042 (void)c; | |
| 2043 GLuint transformfeedback = c.transformfeedback; | |
| 2044 typedef cmds::IsTransformFeedback::Result Result; | |
| 2045 Result* result = GetSharedMemoryAs<Result*>( | |
| 2046 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 2047 if (!result) { | |
| 2048 return error::kOutOfBounds; | |
| 2049 } | |
| 2050 error::Error error = DoIsTransformFeedback(transformfeedback, result); | |
| 2051 if (error != error::kNoError) { | |
| 2052 return error; | |
| 2053 } | |
| 2054 return error::kNoError; | |
| 2055 } | |
| 2056 | |
| 2057 error::Error GLES2DecoderPassthroughImpl::HandleLineWidth( | |
| 2058 uint32_t immediate_data_size, | |
| 2059 const void* cmd_data) { | |
| 2060 const gles2::cmds::LineWidth& c = | |
| 2061 *static_cast<const gles2::cmds::LineWidth*>(cmd_data); | |
| 2062 (void)c; | |
| 2063 GLfloat width = static_cast<GLfloat>(c.width); | |
| 2064 error::Error error = DoLineWidth(width); | |
| 2065 if (error != error::kNoError) { | |
| 2066 return error; | |
| 2067 } | |
| 2068 return error::kNoError; | |
| 2069 } | |
| 2070 | |
| 2071 error::Error GLES2DecoderPassthroughImpl::HandleLinkProgram( | |
| 2072 uint32_t immediate_data_size, | |
| 2073 const void* cmd_data) { | |
| 2074 const gles2::cmds::LinkProgram& c = | |
| 2075 *static_cast<const gles2::cmds::LinkProgram*>(cmd_data); | |
| 2076 (void)c; | |
| 2077 GLuint program = c.program; | |
| 2078 error::Error error = DoLinkProgram(program); | |
| 2079 if (error != error::kNoError) { | |
| 2080 return error; | |
| 2081 } | |
| 2082 return error::kNoError; | |
| 2083 } | |
| 2084 | |
| 2085 error::Error GLES2DecoderPassthroughImpl::HandlePauseTransformFeedback( | |
| 2086 uint32_t immediate_data_size, | |
| 2087 const void* cmd_data) { | |
| 2088 const gles2::cmds::PauseTransformFeedback& c = | |
| 2089 *static_cast<const gles2::cmds::PauseTransformFeedback*>(cmd_data); | |
| 2090 (void)c; | |
| 2091 error::Error error = DoPauseTransformFeedback(); | |
| 2092 if (error != error::kNoError) { | |
| 2093 return error; | |
| 2094 } | |
| 2095 return error::kNoError; | |
| 2096 } | |
| 2097 | |
| 2098 error::Error GLES2DecoderPassthroughImpl::HandlePolygonOffset( | |
| 2099 uint32_t immediate_data_size, | |
| 2100 const void* cmd_data) { | |
| 2101 const gles2::cmds::PolygonOffset& c = | |
| 2102 *static_cast<const gles2::cmds::PolygonOffset*>(cmd_data); | |
| 2103 (void)c; | |
| 2104 GLfloat factor = static_cast<GLfloat>(c.factor); | |
| 2105 GLfloat units = static_cast<GLfloat>(c.units); | |
| 2106 error::Error error = DoPolygonOffset(factor, units); | |
| 2107 if (error != error::kNoError) { | |
| 2108 return error; | |
| 2109 } | |
| 2110 return error::kNoError; | |
| 2111 } | |
| 2112 | |
| 2113 error::Error GLES2DecoderPassthroughImpl::HandleReadBuffer( | |
| 2114 uint32_t immediate_data_size, | |
| 2115 const void* cmd_data) { | |
| 2116 const gles2::cmds::ReadBuffer& c = | |
| 2117 *static_cast<const gles2::cmds::ReadBuffer*>(cmd_data); | |
| 2118 (void)c; | |
| 2119 GLenum src = static_cast<GLenum>(c.src); | |
| 2120 error::Error error = DoReadBuffer(src); | |
| 2121 if (error != error::kNoError) { | |
| 2122 return error; | |
| 2123 } | |
| 2124 return error::kNoError; | |
| 2125 } | |
| 2126 | |
| 2127 error::Error GLES2DecoderPassthroughImpl::HandleReleaseShaderCompiler( | |
| 2128 uint32_t immediate_data_size, | |
| 2129 const void* cmd_data) { | |
| 2130 const gles2::cmds::ReleaseShaderCompiler& c = | |
| 2131 *static_cast<const gles2::cmds::ReleaseShaderCompiler*>(cmd_data); | |
| 2132 (void)c; | |
| 2133 error::Error error = DoReleaseShaderCompiler(); | |
| 2134 if (error != error::kNoError) { | |
| 2135 return error; | |
| 2136 } | |
| 2137 return error::kNoError; | |
| 2138 } | |
| 2139 | |
| 2140 error::Error GLES2DecoderPassthroughImpl::HandleRenderbufferStorage( | |
| 2141 uint32_t immediate_data_size, | |
| 2142 const void* cmd_data) { | |
| 2143 const gles2::cmds::RenderbufferStorage& c = | |
| 2144 *static_cast<const gles2::cmds::RenderbufferStorage*>(cmd_data); | |
| 2145 (void)c; | |
| 2146 GLenum target = static_cast<GLenum>(c.target); | |
| 2147 GLenum internalformat = static_cast<GLenum>(c.internalformat); | |
| 2148 GLsizei width = static_cast<GLsizei>(c.width); | |
| 2149 GLsizei height = static_cast<GLsizei>(c.height); | |
| 2150 error::Error error = | |
| 2151 DoRenderbufferStorage(target, internalformat, width, height); | |
| 2152 if (error != error::kNoError) { | |
| 2153 return error; | |
| 2154 } | |
| 2155 return error::kNoError; | |
| 2156 } | |
| 2157 | |
| 2158 error::Error GLES2DecoderPassthroughImpl::HandleResumeTransformFeedback( | |
| 2159 uint32_t immediate_data_size, | |
| 2160 const void* cmd_data) { | |
| 2161 const gles2::cmds::ResumeTransformFeedback& c = | |
| 2162 *static_cast<const gles2::cmds::ResumeTransformFeedback*>(cmd_data); | |
| 2163 (void)c; | |
| 2164 error::Error error = DoResumeTransformFeedback(); | |
| 2165 if (error != error::kNoError) { | |
| 2166 return error; | |
| 2167 } | |
| 2168 return error::kNoError; | |
| 2169 } | |
| 2170 | |
| 2171 error::Error GLES2DecoderPassthroughImpl::HandleSampleCoverage( | |
| 2172 uint32_t immediate_data_size, | |
| 2173 const void* cmd_data) { | |
| 2174 const gles2::cmds::SampleCoverage& c = | |
| 2175 *static_cast<const gles2::cmds::SampleCoverage*>(cmd_data); | |
| 2176 (void)c; | |
| 2177 GLclampf value = static_cast<GLclampf>(c.value); | |
| 2178 GLboolean invert = static_cast<GLboolean>(c.invert); | |
| 2179 error::Error error = DoSampleCoverage(value, invert); | |
| 2180 if (error != error::kNoError) { | |
| 2181 return error; | |
| 2182 } | |
| 2183 return error::kNoError; | |
| 2184 } | |
| 2185 | |
| 2186 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameterf( | |
| 2187 uint32_t immediate_data_size, | |
| 2188 const void* cmd_data) { | |
| 2189 const gles2::cmds::SamplerParameterf& c = | |
| 2190 *static_cast<const gles2::cmds::SamplerParameterf*>(cmd_data); | |
| 2191 (void)c; | |
| 2192 GLuint sampler = c.sampler; | |
| 2193 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2194 GLfloat param = static_cast<GLfloat>(c.param); | |
| 2195 error::Error error = DoSamplerParameterf(sampler, pname, param); | |
| 2196 if (error != error::kNoError) { | |
| 2197 return error; | |
| 2198 } | |
| 2199 return error::kNoError; | |
| 2200 } | |
| 2201 | |
| 2202 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameterfvImmediate( | |
| 2203 uint32_t immediate_data_size, | |
| 2204 const void* cmd_data) { | |
| 2205 const gles2::cmds::SamplerParameterfvImmediate& c = | |
| 2206 *static_cast<const gles2::cmds::SamplerParameterfvImmediate*>(cmd_data); | |
| 2207 (void)c; | |
| 2208 GLuint sampler = c.sampler; | |
| 2209 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2210 uint32_t data_size; | |
| 2211 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | |
| 2212 return error::kOutOfBounds; | |
| 2213 } | |
| 2214 if (data_size > immediate_data_size) { | |
| 2215 return error::kOutOfBounds; | |
| 2216 } | |
| 2217 const GLfloat* params = | |
| 2218 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 2219 error::Error error = DoSamplerParameterfv(sampler, pname, params); | |
| 2220 if (error != error::kNoError) { | |
| 2221 return error; | |
| 2222 } | |
| 2223 return error::kNoError; | |
| 2224 } | |
| 2225 | |
| 2226 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameteri( | |
| 2227 uint32_t immediate_data_size, | |
| 2228 const void* cmd_data) { | |
| 2229 const gles2::cmds::SamplerParameteri& c = | |
| 2230 *static_cast<const gles2::cmds::SamplerParameteri*>(cmd_data); | |
| 2231 (void)c; | |
| 2232 GLuint sampler = c.sampler; | |
| 2233 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2234 GLint param = static_cast<GLint>(c.param); | |
| 2235 error::Error error = DoSamplerParameteri(sampler, pname, param); | |
| 2236 if (error != error::kNoError) { | |
| 2237 return error; | |
| 2238 } | |
| 2239 return error::kNoError; | |
| 2240 } | |
| 2241 | |
| 2242 error::Error GLES2DecoderPassthroughImpl::HandleSamplerParameterivImmediate( | |
| 2243 uint32_t immediate_data_size, | |
| 2244 const void* cmd_data) { | |
| 2245 const gles2::cmds::SamplerParameterivImmediate& c = | |
| 2246 *static_cast<const gles2::cmds::SamplerParameterivImmediate*>(cmd_data); | |
| 2247 (void)c; | |
| 2248 GLuint sampler = c.sampler; | |
| 2249 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2250 uint32_t data_size; | |
| 2251 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | |
| 2252 return error::kOutOfBounds; | |
| 2253 } | |
| 2254 if (data_size > immediate_data_size) { | |
| 2255 return error::kOutOfBounds; | |
| 2256 } | |
| 2257 const GLint* params = | |
| 2258 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 2259 error::Error error = DoSamplerParameteriv(sampler, pname, params); | |
| 2260 if (error != error::kNoError) { | |
| 2261 return error; | |
| 2262 } | |
| 2263 return error::kNoError; | |
| 2264 } | |
| 2265 | |
| 2266 error::Error GLES2DecoderPassthroughImpl::HandleScissor( | |
| 2267 uint32_t immediate_data_size, | |
| 2268 const void* cmd_data) { | |
| 2269 const gles2::cmds::Scissor& c = | |
| 2270 *static_cast<const gles2::cmds::Scissor*>(cmd_data); | |
| 2271 (void)c; | |
| 2272 GLint x = static_cast<GLint>(c.x); | |
| 2273 GLint y = static_cast<GLint>(c.y); | |
| 2274 GLsizei width = static_cast<GLsizei>(c.width); | |
| 2275 GLsizei height = static_cast<GLsizei>(c.height); | |
| 2276 error::Error error = DoScissor(x, y, width, height); | |
| 2277 if (error != error::kNoError) { | |
| 2278 return error; | |
| 2279 } | |
| 2280 return error::kNoError; | |
| 2281 } | |
| 2282 | |
| 2283 error::Error GLES2DecoderPassthroughImpl::HandleShaderSourceBucket( | |
| 2284 uint32_t immediate_data_size, | |
| 2285 const void* cmd_data) { | |
| 2286 const gles2::cmds::ShaderSourceBucket& c = | |
| 2287 *static_cast<const gles2::cmds::ShaderSourceBucket*>(cmd_data); | |
| 2288 (void)c; | |
| 2289 GLuint shader = static_cast<GLuint>(c.shader); | |
| 2290 | |
| 2291 Bucket* bucket = GetBucket(c.str_bucket_id); | |
| 2292 if (!bucket) { | |
| 2293 return error::kInvalidArguments; | |
| 2294 } | |
| 2295 GLsizei count = 0; | |
| 2296 std::vector<char*> strs; | |
| 2297 std::vector<GLint> len; | |
| 2298 if (!bucket->GetAsStrings(&count, &strs, &len)) { | |
| 2299 return error::kInvalidArguments; | |
| 2300 } | |
| 2301 const char** str = | |
| 2302 strs.size() > 0 ? const_cast<const char**>(&strs[0]) : NULL; | |
| 2303 const GLint* length = | |
| 2304 len.size() > 0 ? const_cast<const GLint*>(&len[0]) : NULL; | |
| 2305 (void)length; | |
|
Zhenyao Mo
2016/05/31 01:37:22
nit: this is unnecessary.
Geoff Lang
2016/06/01 20:11:51
Hmm, this is also shared autogen code, I can try r
| |
| 2306 error::Error error = DoShaderSource(shader, count, str, length); | |
| 2307 if (error != error::kNoError) { | |
| 2308 return error; | |
| 2309 } | |
| 2310 return error::kNoError; | |
| 2311 } | |
| 2312 | |
| 2313 error::Error GLES2DecoderPassthroughImpl::HandleStencilFunc( | |
| 2314 uint32_t immediate_data_size, | |
| 2315 const void* cmd_data) { | |
| 2316 const gles2::cmds::StencilFunc& c = | |
| 2317 *static_cast<const gles2::cmds::StencilFunc*>(cmd_data); | |
| 2318 (void)c; | |
| 2319 GLenum func = static_cast<GLenum>(c.func); | |
| 2320 GLint ref = static_cast<GLint>(c.ref); | |
| 2321 GLuint mask = static_cast<GLuint>(c.mask); | |
| 2322 error::Error error = DoStencilFunc(func, ref, mask); | |
| 2323 if (error != error::kNoError) { | |
| 2324 return error; | |
| 2325 } | |
| 2326 return error::kNoError; | |
| 2327 } | |
| 2328 | |
| 2329 error::Error GLES2DecoderPassthroughImpl::HandleStencilFuncSeparate( | |
| 2330 uint32_t immediate_data_size, | |
| 2331 const void* cmd_data) { | |
| 2332 const gles2::cmds::StencilFuncSeparate& c = | |
| 2333 *static_cast<const gles2::cmds::StencilFuncSeparate*>(cmd_data); | |
| 2334 (void)c; | |
| 2335 GLenum face = static_cast<GLenum>(c.face); | |
| 2336 GLenum func = static_cast<GLenum>(c.func); | |
| 2337 GLint ref = static_cast<GLint>(c.ref); | |
| 2338 GLuint mask = static_cast<GLuint>(c.mask); | |
| 2339 error::Error error = DoStencilFuncSeparate(face, func, ref, mask); | |
| 2340 if (error != error::kNoError) { | |
| 2341 return error; | |
| 2342 } | |
| 2343 return error::kNoError; | |
| 2344 } | |
| 2345 | |
| 2346 error::Error GLES2DecoderPassthroughImpl::HandleStencilMask( | |
| 2347 uint32_t immediate_data_size, | |
| 2348 const void* cmd_data) { | |
| 2349 const gles2::cmds::StencilMask& c = | |
| 2350 *static_cast<const gles2::cmds::StencilMask*>(cmd_data); | |
| 2351 (void)c; | |
| 2352 GLuint mask = static_cast<GLuint>(c.mask); | |
| 2353 error::Error error = DoStencilMask(mask); | |
| 2354 if (error != error::kNoError) { | |
| 2355 return error; | |
| 2356 } | |
| 2357 return error::kNoError; | |
| 2358 } | |
| 2359 | |
| 2360 error::Error GLES2DecoderPassthroughImpl::HandleStencilMaskSeparate( | |
| 2361 uint32_t immediate_data_size, | |
| 2362 const void* cmd_data) { | |
| 2363 const gles2::cmds::StencilMaskSeparate& c = | |
| 2364 *static_cast<const gles2::cmds::StencilMaskSeparate*>(cmd_data); | |
| 2365 (void)c; | |
| 2366 GLenum face = static_cast<GLenum>(c.face); | |
| 2367 GLuint mask = static_cast<GLuint>(c.mask); | |
| 2368 error::Error error = DoStencilMaskSeparate(face, mask); | |
| 2369 if (error != error::kNoError) { | |
| 2370 return error; | |
| 2371 } | |
| 2372 return error::kNoError; | |
| 2373 } | |
| 2374 | |
| 2375 error::Error GLES2DecoderPassthroughImpl::HandleStencilOp( | |
| 2376 uint32_t immediate_data_size, | |
| 2377 const void* cmd_data) { | |
| 2378 const gles2::cmds::StencilOp& c = | |
| 2379 *static_cast<const gles2::cmds::StencilOp*>(cmd_data); | |
| 2380 (void)c; | |
| 2381 GLenum fail = static_cast<GLenum>(c.fail); | |
| 2382 GLenum zfail = static_cast<GLenum>(c.zfail); | |
| 2383 GLenum zpass = static_cast<GLenum>(c.zpass); | |
| 2384 error::Error error = DoStencilOp(fail, zfail, zpass); | |
| 2385 if (error != error::kNoError) { | |
| 2386 return error; | |
| 2387 } | |
| 2388 return error::kNoError; | |
| 2389 } | |
| 2390 | |
| 2391 error::Error GLES2DecoderPassthroughImpl::HandleStencilOpSeparate( | |
| 2392 uint32_t immediate_data_size, | |
| 2393 const void* cmd_data) { | |
| 2394 const gles2::cmds::StencilOpSeparate& c = | |
| 2395 *static_cast<const gles2::cmds::StencilOpSeparate*>(cmd_data); | |
| 2396 (void)c; | |
| 2397 GLenum face = static_cast<GLenum>(c.face); | |
| 2398 GLenum fail = static_cast<GLenum>(c.fail); | |
| 2399 GLenum zfail = static_cast<GLenum>(c.zfail); | |
| 2400 GLenum zpass = static_cast<GLenum>(c.zpass); | |
| 2401 error::Error error = DoStencilOpSeparate(face, fail, zfail, zpass); | |
| 2402 if (error != error::kNoError) { | |
| 2403 return error; | |
| 2404 } | |
| 2405 return error::kNoError; | |
| 2406 } | |
| 2407 | |
| 2408 error::Error GLES2DecoderPassthroughImpl::HandleTexParameterf( | |
| 2409 uint32_t immediate_data_size, | |
| 2410 const void* cmd_data) { | |
| 2411 const gles2::cmds::TexParameterf& c = | |
| 2412 *static_cast<const gles2::cmds::TexParameterf*>(cmd_data); | |
| 2413 (void)c; | |
| 2414 GLenum target = static_cast<GLenum>(c.target); | |
| 2415 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2416 GLfloat param = static_cast<GLfloat>(c.param); | |
| 2417 error::Error error = DoTexParameterf(target, pname, param); | |
| 2418 if (error != error::kNoError) { | |
| 2419 return error; | |
| 2420 } | |
| 2421 return error::kNoError; | |
| 2422 } | |
| 2423 | |
| 2424 error::Error GLES2DecoderPassthroughImpl::HandleTexParameterfvImmediate( | |
| 2425 uint32_t immediate_data_size, | |
| 2426 const void* cmd_data) { | |
| 2427 const gles2::cmds::TexParameterfvImmediate& c = | |
| 2428 *static_cast<const gles2::cmds::TexParameterfvImmediate*>(cmd_data); | |
| 2429 (void)c; | |
| 2430 GLenum target = static_cast<GLenum>(c.target); | |
| 2431 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2432 uint32_t data_size; | |
| 2433 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | |
| 2434 return error::kOutOfBounds; | |
| 2435 } | |
| 2436 if (data_size > immediate_data_size) { | |
| 2437 return error::kOutOfBounds; | |
| 2438 } | |
| 2439 const GLfloat* params = | |
| 2440 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 2441 error::Error error = DoTexParameterfv(target, pname, params); | |
| 2442 if (error != error::kNoError) { | |
| 2443 return error; | |
| 2444 } | |
| 2445 return error::kNoError; | |
| 2446 } | |
| 2447 | |
| 2448 error::Error GLES2DecoderPassthroughImpl::HandleTexParameteri( | |
| 2449 uint32_t immediate_data_size, | |
| 2450 const void* cmd_data) { | |
| 2451 const gles2::cmds::TexParameteri& c = | |
| 2452 *static_cast<const gles2::cmds::TexParameteri*>(cmd_data); | |
| 2453 (void)c; | |
| 2454 GLenum target = static_cast<GLenum>(c.target); | |
| 2455 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2456 GLint param = static_cast<GLint>(c.param); | |
| 2457 error::Error error = DoTexParameteri(target, pname, param); | |
| 2458 if (error != error::kNoError) { | |
| 2459 return error; | |
| 2460 } | |
| 2461 return error::kNoError; | |
| 2462 } | |
| 2463 | |
| 2464 error::Error GLES2DecoderPassthroughImpl::HandleTexParameterivImmediate( | |
| 2465 uint32_t immediate_data_size, | |
| 2466 const void* cmd_data) { | |
| 2467 const gles2::cmds::TexParameterivImmediate& c = | |
| 2468 *static_cast<const gles2::cmds::TexParameterivImmediate*>(cmd_data); | |
| 2469 (void)c; | |
| 2470 GLenum target = static_cast<GLenum>(c.target); | |
| 2471 GLenum pname = static_cast<GLenum>(c.pname); | |
| 2472 uint32_t data_size; | |
| 2473 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | |
| 2474 return error::kOutOfBounds; | |
| 2475 } | |
| 2476 if (data_size > immediate_data_size) { | |
| 2477 return error::kOutOfBounds; | |
| 2478 } | |
| 2479 const GLint* params = | |
| 2480 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 2481 error::Error error = DoTexParameteriv(target, pname, params); | |
| 2482 if (error != error::kNoError) { | |
| 2483 return error; | |
| 2484 } | |
| 2485 return error::kNoError; | |
| 2486 } | |
| 2487 | |
| 2488 error::Error GLES2DecoderPassthroughImpl::HandleTexStorage3D( | |
| 2489 uint32_t immediate_data_size, | |
| 2490 const void* cmd_data) { | |
| 2491 const gles2::cmds::TexStorage3D& c = | |
| 2492 *static_cast<const gles2::cmds::TexStorage3D*>(cmd_data); | |
| 2493 (void)c; | |
| 2494 GLenum target = static_cast<GLenum>(c.target); | |
| 2495 GLsizei levels = static_cast<GLsizei>(c.levels); | |
| 2496 GLenum internalFormat = static_cast<GLenum>(c.internalFormat); | |
| 2497 GLsizei width = static_cast<GLsizei>(c.width); | |
| 2498 GLsizei height = static_cast<GLsizei>(c.height); | |
| 2499 GLsizei depth = static_cast<GLsizei>(c.depth); | |
| 2500 error::Error error = | |
| 2501 DoTexStorage3D(target, levels, internalFormat, width, height, depth); | |
| 2502 if (error != error::kNoError) { | |
| 2503 return error; | |
| 2504 } | |
| 2505 return error::kNoError; | |
| 2506 } | |
| 2507 | |
| 2508 error::Error GLES2DecoderPassthroughImpl::HandleTransformFeedbackVaryingsBucket( | |
| 2509 uint32_t immediate_data_size, | |
| 2510 const void* cmd_data) { | |
| 2511 const gles2::cmds::TransformFeedbackVaryingsBucket& c = | |
| 2512 *static_cast<const gles2::cmds::TransformFeedbackVaryingsBucket*>( | |
| 2513 cmd_data); | |
| 2514 (void)c; | |
| 2515 GLuint program = static_cast<GLuint>(c.program); | |
| 2516 | |
| 2517 Bucket* bucket = GetBucket(c.varyings_bucket_id); | |
| 2518 if (!bucket) { | |
| 2519 return error::kInvalidArguments; | |
| 2520 } | |
| 2521 GLsizei count = 0; | |
| 2522 std::vector<char*> strs; | |
| 2523 std::vector<GLint> len; | |
| 2524 if (!bucket->GetAsStrings(&count, &strs, &len)) { | |
| 2525 return error::kInvalidArguments; | |
| 2526 } | |
| 2527 const char** varyings = | |
| 2528 strs.size() > 0 ? const_cast<const char**>(&strs[0]) : NULL; | |
| 2529 const GLint* length = | |
| 2530 len.size() > 0 ? const_cast<const GLint*>(&len[0]) : NULL; | |
| 2531 (void)length; | |
| 2532 GLenum buffermode = static_cast<GLenum>(c.buffermode); | |
| 2533 error::Error error = | |
| 2534 DoTransformFeedbackVaryings(program, count, varyings, buffermode); | |
| 2535 if (error != error::kNoError) { | |
| 2536 return error; | |
| 2537 } | |
| 2538 return error::kNoError; | |
| 2539 } | |
| 2540 | |
| 2541 error::Error GLES2DecoderPassthroughImpl::HandleUniform1f( | |
| 2542 uint32_t immediate_data_size, | |
| 2543 const void* cmd_data) { | |
| 2544 const gles2::cmds::Uniform1f& c = | |
| 2545 *static_cast<const gles2::cmds::Uniform1f*>(cmd_data); | |
| 2546 (void)c; | |
| 2547 GLint location = static_cast<GLint>(c.location); | |
| 2548 GLfloat x = static_cast<GLfloat>(c.x); | |
| 2549 error::Error error = DoUniform1f(location, x); | |
| 2550 if (error != error::kNoError) { | |
| 2551 return error; | |
| 2552 } | |
| 2553 return error::kNoError; | |
| 2554 } | |
| 2555 | |
| 2556 error::Error GLES2DecoderPassthroughImpl::HandleUniform1fvImmediate( | |
| 2557 uint32_t immediate_data_size, | |
| 2558 const void* cmd_data) { | |
| 2559 const gles2::cmds::Uniform1fvImmediate& c = | |
| 2560 *static_cast<const gles2::cmds::Uniform1fvImmediate*>(cmd_data); | |
| 2561 (void)c; | |
| 2562 GLint location = static_cast<GLint>(c.location); | |
| 2563 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2564 uint32_t data_size = 0; | |
| 2565 if (count >= 0 && | |
| 2566 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 1, &data_size)) { | |
| 2567 return error::kOutOfBounds; | |
| 2568 } | |
| 2569 if (data_size > immediate_data_size) { | |
| 2570 return error::kOutOfBounds; | |
| 2571 } | |
| 2572 const GLfloat* v = | |
| 2573 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 2574 error::Error error = DoUniform1fv(location, count, v); | |
| 2575 if (error != error::kNoError) { | |
| 2576 return error; | |
| 2577 } | |
| 2578 return error::kNoError; | |
| 2579 } | |
| 2580 | |
| 2581 error::Error GLES2DecoderPassthroughImpl::HandleUniform1i( | |
| 2582 uint32_t immediate_data_size, | |
| 2583 const void* cmd_data) { | |
| 2584 const gles2::cmds::Uniform1i& c = | |
| 2585 *static_cast<const gles2::cmds::Uniform1i*>(cmd_data); | |
| 2586 (void)c; | |
| 2587 GLint location = static_cast<GLint>(c.location); | |
| 2588 GLint x = static_cast<GLint>(c.x); | |
| 2589 error::Error error = DoUniform1i(location, x); | |
| 2590 if (error != error::kNoError) { | |
| 2591 return error; | |
| 2592 } | |
| 2593 return error::kNoError; | |
| 2594 } | |
| 2595 | |
| 2596 error::Error GLES2DecoderPassthroughImpl::HandleUniform1ivImmediate( | |
| 2597 uint32_t immediate_data_size, | |
| 2598 const void* cmd_data) { | |
| 2599 const gles2::cmds::Uniform1ivImmediate& c = | |
| 2600 *static_cast<const gles2::cmds::Uniform1ivImmediate*>(cmd_data); | |
| 2601 (void)c; | |
| 2602 GLint location = static_cast<GLint>(c.location); | |
| 2603 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2604 uint32_t data_size = 0; | |
| 2605 if (count >= 0 && | |
| 2606 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 1, &data_size)) { | |
| 2607 return error::kOutOfBounds; | |
| 2608 } | |
| 2609 if (data_size > immediate_data_size) { | |
| 2610 return error::kOutOfBounds; | |
| 2611 } | |
| 2612 const GLint* v = | |
| 2613 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 2614 error::Error error = DoUniform1iv(location, count, v); | |
| 2615 if (error != error::kNoError) { | |
| 2616 return error; | |
| 2617 } | |
| 2618 return error::kNoError; | |
| 2619 } | |
| 2620 | |
| 2621 error::Error GLES2DecoderPassthroughImpl::HandleUniform1ui( | |
| 2622 uint32_t immediate_data_size, | |
| 2623 const void* cmd_data) { | |
| 2624 const gles2::cmds::Uniform1ui& c = | |
| 2625 *static_cast<const gles2::cmds::Uniform1ui*>(cmd_data); | |
| 2626 (void)c; | |
| 2627 GLint location = static_cast<GLint>(c.location); | |
| 2628 GLuint x = static_cast<GLuint>(c.x); | |
| 2629 error::Error error = DoUniform1ui(location, x); | |
| 2630 if (error != error::kNoError) { | |
| 2631 return error; | |
| 2632 } | |
| 2633 return error::kNoError; | |
| 2634 } | |
| 2635 | |
| 2636 error::Error GLES2DecoderPassthroughImpl::HandleUniform1uivImmediate( | |
| 2637 uint32_t immediate_data_size, | |
| 2638 const void* cmd_data) { | |
| 2639 const gles2::cmds::Uniform1uivImmediate& c = | |
| 2640 *static_cast<const gles2::cmds::Uniform1uivImmediate*>(cmd_data); | |
| 2641 (void)c; | |
| 2642 GLint location = static_cast<GLint>(c.location); | |
| 2643 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2644 uint32_t data_size = 0; | |
| 2645 if (count >= 0 && | |
| 2646 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 1, &data_size)) { | |
| 2647 return error::kOutOfBounds; | |
| 2648 } | |
| 2649 if (data_size > immediate_data_size) { | |
| 2650 return error::kOutOfBounds; | |
| 2651 } | |
| 2652 const GLuint* v = | |
| 2653 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 2654 error::Error error = DoUniform1uiv(location, count, v); | |
| 2655 if (error != error::kNoError) { | |
| 2656 return error; | |
| 2657 } | |
| 2658 return error::kNoError; | |
| 2659 } | |
| 2660 | |
| 2661 error::Error GLES2DecoderPassthroughImpl::HandleUniform2f( | |
| 2662 uint32_t immediate_data_size, | |
| 2663 const void* cmd_data) { | |
| 2664 const gles2::cmds::Uniform2f& c = | |
| 2665 *static_cast<const gles2::cmds::Uniform2f*>(cmd_data); | |
| 2666 (void)c; | |
| 2667 GLint location = static_cast<GLint>(c.location); | |
| 2668 GLfloat x = static_cast<GLfloat>(c.x); | |
| 2669 GLfloat y = static_cast<GLfloat>(c.y); | |
| 2670 error::Error error = DoUniform2f(location, x, y); | |
| 2671 if (error != error::kNoError) { | |
| 2672 return error; | |
| 2673 } | |
| 2674 return error::kNoError; | |
| 2675 } | |
| 2676 | |
| 2677 error::Error GLES2DecoderPassthroughImpl::HandleUniform2fvImmediate( | |
| 2678 uint32_t immediate_data_size, | |
| 2679 const void* cmd_data) { | |
| 2680 const gles2::cmds::Uniform2fvImmediate& c = | |
| 2681 *static_cast<const gles2::cmds::Uniform2fvImmediate*>(cmd_data); | |
| 2682 (void)c; | |
| 2683 GLint location = static_cast<GLint>(c.location); | |
| 2684 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2685 uint32_t data_size = 0; | |
| 2686 if (count >= 0 && | |
| 2687 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 2, &data_size)) { | |
| 2688 return error::kOutOfBounds; | |
| 2689 } | |
| 2690 if (data_size > immediate_data_size) { | |
| 2691 return error::kOutOfBounds; | |
| 2692 } | |
| 2693 const GLfloat* v = | |
| 2694 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 2695 error::Error error = DoUniform2fv(location, count, v); | |
| 2696 if (error != error::kNoError) { | |
| 2697 return error; | |
| 2698 } | |
| 2699 return error::kNoError; | |
| 2700 } | |
| 2701 | |
| 2702 error::Error GLES2DecoderPassthroughImpl::HandleUniform2i( | |
| 2703 uint32_t immediate_data_size, | |
| 2704 const void* cmd_data) { | |
| 2705 const gles2::cmds::Uniform2i& c = | |
| 2706 *static_cast<const gles2::cmds::Uniform2i*>(cmd_data); | |
| 2707 (void)c; | |
| 2708 GLint location = static_cast<GLint>(c.location); | |
| 2709 GLint x = static_cast<GLint>(c.x); | |
| 2710 GLint y = static_cast<GLint>(c.y); | |
| 2711 error::Error error = DoUniform2i(location, x, y); | |
| 2712 if (error != error::kNoError) { | |
| 2713 return error; | |
| 2714 } | |
| 2715 return error::kNoError; | |
| 2716 } | |
| 2717 | |
| 2718 error::Error GLES2DecoderPassthroughImpl::HandleUniform2ivImmediate( | |
| 2719 uint32_t immediate_data_size, | |
| 2720 const void* cmd_data) { | |
| 2721 const gles2::cmds::Uniform2ivImmediate& c = | |
| 2722 *static_cast<const gles2::cmds::Uniform2ivImmediate*>(cmd_data); | |
| 2723 (void)c; | |
| 2724 GLint location = static_cast<GLint>(c.location); | |
| 2725 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2726 uint32_t data_size = 0; | |
| 2727 if (count >= 0 && | |
| 2728 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 2, &data_size)) { | |
| 2729 return error::kOutOfBounds; | |
| 2730 } | |
| 2731 if (data_size > immediate_data_size) { | |
| 2732 return error::kOutOfBounds; | |
| 2733 } | |
| 2734 const GLint* v = | |
| 2735 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 2736 error::Error error = DoUniform2iv(location, count, v); | |
| 2737 if (error != error::kNoError) { | |
| 2738 return error; | |
| 2739 } | |
| 2740 return error::kNoError; | |
| 2741 } | |
| 2742 | |
| 2743 error::Error GLES2DecoderPassthroughImpl::HandleUniform2ui( | |
| 2744 uint32_t immediate_data_size, | |
| 2745 const void* cmd_data) { | |
| 2746 const gles2::cmds::Uniform2ui& c = | |
| 2747 *static_cast<const gles2::cmds::Uniform2ui*>(cmd_data); | |
| 2748 (void)c; | |
| 2749 GLint location = static_cast<GLint>(c.location); | |
| 2750 GLuint x = static_cast<GLuint>(c.x); | |
| 2751 GLuint y = static_cast<GLuint>(c.y); | |
| 2752 error::Error error = DoUniform2ui(location, x, y); | |
| 2753 if (error != error::kNoError) { | |
| 2754 return error; | |
| 2755 } | |
| 2756 return error::kNoError; | |
| 2757 } | |
| 2758 | |
| 2759 error::Error GLES2DecoderPassthroughImpl::HandleUniform2uivImmediate( | |
| 2760 uint32_t immediate_data_size, | |
| 2761 const void* cmd_data) { | |
| 2762 const gles2::cmds::Uniform2uivImmediate& c = | |
| 2763 *static_cast<const gles2::cmds::Uniform2uivImmediate*>(cmd_data); | |
| 2764 (void)c; | |
| 2765 GLint location = static_cast<GLint>(c.location); | |
| 2766 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2767 uint32_t data_size = 0; | |
| 2768 if (count >= 0 && | |
| 2769 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 2, &data_size)) { | |
| 2770 return error::kOutOfBounds; | |
| 2771 } | |
| 2772 if (data_size > immediate_data_size) { | |
| 2773 return error::kOutOfBounds; | |
| 2774 } | |
| 2775 const GLuint* v = | |
| 2776 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 2777 error::Error error = DoUniform2uiv(location, count, v); | |
| 2778 if (error != error::kNoError) { | |
| 2779 return error; | |
| 2780 } | |
| 2781 return error::kNoError; | |
| 2782 } | |
| 2783 | |
| 2784 error::Error GLES2DecoderPassthroughImpl::HandleUniform3f( | |
| 2785 uint32_t immediate_data_size, | |
| 2786 const void* cmd_data) { | |
| 2787 const gles2::cmds::Uniform3f& c = | |
| 2788 *static_cast<const gles2::cmds::Uniform3f*>(cmd_data); | |
| 2789 (void)c; | |
| 2790 GLint location = static_cast<GLint>(c.location); | |
| 2791 GLfloat x = static_cast<GLfloat>(c.x); | |
| 2792 GLfloat y = static_cast<GLfloat>(c.y); | |
| 2793 GLfloat z = static_cast<GLfloat>(c.z); | |
| 2794 error::Error error = DoUniform3f(location, x, y, z); | |
| 2795 if (error != error::kNoError) { | |
| 2796 return error; | |
| 2797 } | |
| 2798 return error::kNoError; | |
| 2799 } | |
| 2800 | |
| 2801 error::Error GLES2DecoderPassthroughImpl::HandleUniform3fvImmediate( | |
| 2802 uint32_t immediate_data_size, | |
| 2803 const void* cmd_data) { | |
| 2804 const gles2::cmds::Uniform3fvImmediate& c = | |
| 2805 *static_cast<const gles2::cmds::Uniform3fvImmediate*>(cmd_data); | |
| 2806 (void)c; | |
| 2807 GLint location = static_cast<GLint>(c.location); | |
| 2808 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2809 uint32_t data_size = 0; | |
| 2810 if (count >= 0 && | |
| 2811 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 3, &data_size)) { | |
| 2812 return error::kOutOfBounds; | |
| 2813 } | |
| 2814 if (data_size > immediate_data_size) { | |
| 2815 return error::kOutOfBounds; | |
| 2816 } | |
| 2817 const GLfloat* v = | |
| 2818 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 2819 error::Error error = DoUniform3fv(location, count, v); | |
| 2820 if (error != error::kNoError) { | |
| 2821 return error; | |
| 2822 } | |
| 2823 return error::kNoError; | |
| 2824 } | |
| 2825 | |
| 2826 error::Error GLES2DecoderPassthroughImpl::HandleUniform3i( | |
| 2827 uint32_t immediate_data_size, | |
| 2828 const void* cmd_data) { | |
| 2829 const gles2::cmds::Uniform3i& c = | |
| 2830 *static_cast<const gles2::cmds::Uniform3i*>(cmd_data); | |
| 2831 (void)c; | |
| 2832 GLint location = static_cast<GLint>(c.location); | |
| 2833 GLint x = static_cast<GLint>(c.x); | |
| 2834 GLint y = static_cast<GLint>(c.y); | |
| 2835 GLint z = static_cast<GLint>(c.z); | |
| 2836 error::Error error = DoUniform3i(location, x, y, z); | |
| 2837 if (error != error::kNoError) { | |
| 2838 return error; | |
| 2839 } | |
| 2840 return error::kNoError; | |
| 2841 } | |
| 2842 | |
| 2843 error::Error GLES2DecoderPassthroughImpl::HandleUniform3ivImmediate( | |
| 2844 uint32_t immediate_data_size, | |
| 2845 const void* cmd_data) { | |
| 2846 const gles2::cmds::Uniform3ivImmediate& c = | |
| 2847 *static_cast<const gles2::cmds::Uniform3ivImmediate*>(cmd_data); | |
| 2848 (void)c; | |
| 2849 GLint location = static_cast<GLint>(c.location); | |
| 2850 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2851 uint32_t data_size = 0; | |
| 2852 if (count >= 0 && | |
| 2853 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 3, &data_size)) { | |
| 2854 return error::kOutOfBounds; | |
| 2855 } | |
| 2856 if (data_size > immediate_data_size) { | |
| 2857 return error::kOutOfBounds; | |
| 2858 } | |
| 2859 const GLint* v = | |
| 2860 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 2861 error::Error error = DoUniform3iv(location, count, v); | |
| 2862 if (error != error::kNoError) { | |
| 2863 return error; | |
| 2864 } | |
| 2865 return error::kNoError; | |
| 2866 } | |
| 2867 | |
| 2868 error::Error GLES2DecoderPassthroughImpl::HandleUniform3ui( | |
| 2869 uint32_t immediate_data_size, | |
| 2870 const void* cmd_data) { | |
| 2871 const gles2::cmds::Uniform3ui& c = | |
| 2872 *static_cast<const gles2::cmds::Uniform3ui*>(cmd_data); | |
| 2873 (void)c; | |
| 2874 GLint location = static_cast<GLint>(c.location); | |
| 2875 GLuint x = static_cast<GLuint>(c.x); | |
| 2876 GLuint y = static_cast<GLuint>(c.y); | |
| 2877 GLuint z = static_cast<GLuint>(c.z); | |
| 2878 error::Error error = DoUniform3ui(location, x, y, z); | |
| 2879 if (error != error::kNoError) { | |
| 2880 return error; | |
| 2881 } | |
| 2882 return error::kNoError; | |
| 2883 } | |
| 2884 | |
| 2885 error::Error GLES2DecoderPassthroughImpl::HandleUniform3uivImmediate( | |
| 2886 uint32_t immediate_data_size, | |
| 2887 const void* cmd_data) { | |
| 2888 const gles2::cmds::Uniform3uivImmediate& c = | |
| 2889 *static_cast<const gles2::cmds::Uniform3uivImmediate*>(cmd_data); | |
| 2890 (void)c; | |
| 2891 GLint location = static_cast<GLint>(c.location); | |
| 2892 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2893 uint32_t data_size = 0; | |
| 2894 if (count >= 0 && | |
| 2895 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 3, &data_size)) { | |
| 2896 return error::kOutOfBounds; | |
| 2897 } | |
| 2898 if (data_size > immediate_data_size) { | |
| 2899 return error::kOutOfBounds; | |
| 2900 } | |
| 2901 const GLuint* v = | |
| 2902 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 2903 error::Error error = DoUniform3uiv(location, count, v); | |
| 2904 if (error != error::kNoError) { | |
| 2905 return error; | |
| 2906 } | |
| 2907 return error::kNoError; | |
| 2908 } | |
| 2909 | |
| 2910 error::Error GLES2DecoderPassthroughImpl::HandleUniform4f( | |
| 2911 uint32_t immediate_data_size, | |
| 2912 const void* cmd_data) { | |
| 2913 const gles2::cmds::Uniform4f& c = | |
| 2914 *static_cast<const gles2::cmds::Uniform4f*>(cmd_data); | |
| 2915 (void)c; | |
| 2916 GLint location = static_cast<GLint>(c.location); | |
| 2917 GLfloat x = static_cast<GLfloat>(c.x); | |
| 2918 GLfloat y = static_cast<GLfloat>(c.y); | |
| 2919 GLfloat z = static_cast<GLfloat>(c.z); | |
| 2920 GLfloat w = static_cast<GLfloat>(c.w); | |
| 2921 error::Error error = DoUniform4f(location, x, y, z, w); | |
| 2922 if (error != error::kNoError) { | |
| 2923 return error; | |
| 2924 } | |
| 2925 return error::kNoError; | |
| 2926 } | |
| 2927 | |
| 2928 error::Error GLES2DecoderPassthroughImpl::HandleUniform4fvImmediate( | |
| 2929 uint32_t immediate_data_size, | |
| 2930 const void* cmd_data) { | |
| 2931 const gles2::cmds::Uniform4fvImmediate& c = | |
| 2932 *static_cast<const gles2::cmds::Uniform4fvImmediate*>(cmd_data); | |
| 2933 (void)c; | |
| 2934 GLint location = static_cast<GLint>(c.location); | |
| 2935 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2936 uint32_t data_size = 0; | |
| 2937 if (count >= 0 && | |
| 2938 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { | |
| 2939 return error::kOutOfBounds; | |
| 2940 } | |
| 2941 if (data_size > immediate_data_size) { | |
| 2942 return error::kOutOfBounds; | |
| 2943 } | |
| 2944 const GLfloat* v = | |
| 2945 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 2946 error::Error error = DoUniform4fv(location, count, v); | |
| 2947 if (error != error::kNoError) { | |
| 2948 return error; | |
| 2949 } | |
| 2950 return error::kNoError; | |
| 2951 } | |
| 2952 | |
| 2953 error::Error GLES2DecoderPassthroughImpl::HandleUniform4i( | |
| 2954 uint32_t immediate_data_size, | |
| 2955 const void* cmd_data) { | |
| 2956 const gles2::cmds::Uniform4i& c = | |
| 2957 *static_cast<const gles2::cmds::Uniform4i*>(cmd_data); | |
| 2958 (void)c; | |
| 2959 GLint location = static_cast<GLint>(c.location); | |
| 2960 GLint x = static_cast<GLint>(c.x); | |
| 2961 GLint y = static_cast<GLint>(c.y); | |
| 2962 GLint z = static_cast<GLint>(c.z); | |
| 2963 GLint w = static_cast<GLint>(c.w); | |
| 2964 error::Error error = DoUniform4i(location, x, y, z, w); | |
| 2965 if (error != error::kNoError) { | |
| 2966 return error; | |
| 2967 } | |
| 2968 return error::kNoError; | |
| 2969 } | |
| 2970 | |
| 2971 error::Error GLES2DecoderPassthroughImpl::HandleUniform4ivImmediate( | |
| 2972 uint32_t immediate_data_size, | |
| 2973 const void* cmd_data) { | |
| 2974 const gles2::cmds::Uniform4ivImmediate& c = | |
| 2975 *static_cast<const gles2::cmds::Uniform4ivImmediate*>(cmd_data); | |
| 2976 (void)c; | |
| 2977 GLint location = static_cast<GLint>(c.location); | |
| 2978 GLsizei count = static_cast<GLsizei>(c.count); | |
| 2979 uint32_t data_size = 0; | |
| 2980 if (count >= 0 && | |
| 2981 !GLES2Util::ComputeDataSize(count, sizeof(GLint), 4, &data_size)) { | |
| 2982 return error::kOutOfBounds; | |
| 2983 } | |
| 2984 if (data_size > immediate_data_size) { | |
| 2985 return error::kOutOfBounds; | |
| 2986 } | |
| 2987 const GLint* v = | |
| 2988 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 2989 error::Error error = DoUniform4iv(location, count, v); | |
| 2990 if (error != error::kNoError) { | |
| 2991 return error; | |
| 2992 } | |
| 2993 return error::kNoError; | |
| 2994 } | |
| 2995 | |
| 2996 error::Error GLES2DecoderPassthroughImpl::HandleUniform4ui( | |
| 2997 uint32_t immediate_data_size, | |
| 2998 const void* cmd_data) { | |
| 2999 const gles2::cmds::Uniform4ui& c = | |
| 3000 *static_cast<const gles2::cmds::Uniform4ui*>(cmd_data); | |
| 3001 (void)c; | |
| 3002 GLint location = static_cast<GLint>(c.location); | |
| 3003 GLuint x = static_cast<GLuint>(c.x); | |
| 3004 GLuint y = static_cast<GLuint>(c.y); | |
| 3005 GLuint z = static_cast<GLuint>(c.z); | |
| 3006 GLuint w = static_cast<GLuint>(c.w); | |
| 3007 error::Error error = DoUniform4ui(location, x, y, z, w); | |
| 3008 if (error != error::kNoError) { | |
| 3009 return error; | |
| 3010 } | |
| 3011 return error::kNoError; | |
| 3012 } | |
| 3013 | |
| 3014 error::Error GLES2DecoderPassthroughImpl::HandleUniform4uivImmediate( | |
| 3015 uint32_t immediate_data_size, | |
| 3016 const void* cmd_data) { | |
| 3017 const gles2::cmds::Uniform4uivImmediate& c = | |
| 3018 *static_cast<const gles2::cmds::Uniform4uivImmediate*>(cmd_data); | |
| 3019 (void)c; | |
| 3020 GLint location = static_cast<GLint>(c.location); | |
| 3021 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3022 uint32_t data_size = 0; | |
| 3023 if (count >= 0 && | |
| 3024 !GLES2Util::ComputeDataSize(count, sizeof(GLuint), 4, &data_size)) { | |
| 3025 return error::kOutOfBounds; | |
| 3026 } | |
| 3027 if (data_size > immediate_data_size) { | |
| 3028 return error::kOutOfBounds; | |
| 3029 } | |
| 3030 const GLuint* v = | |
| 3031 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 3032 error::Error error = DoUniform4uiv(location, count, v); | |
| 3033 if (error != error::kNoError) { | |
| 3034 return error; | |
| 3035 } | |
| 3036 return error::kNoError; | |
| 3037 } | |
| 3038 | |
| 3039 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix2fvImmediate( | |
| 3040 uint32_t immediate_data_size, | |
| 3041 const void* cmd_data) { | |
| 3042 const gles2::cmds::UniformMatrix2fvImmediate& c = | |
| 3043 *static_cast<const gles2::cmds::UniformMatrix2fvImmediate*>(cmd_data); | |
| 3044 (void)c; | |
| 3045 GLint location = static_cast<GLint>(c.location); | |
| 3046 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3047 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3048 uint32_t data_size = 0; | |
| 3049 if (count >= 0 && | |
| 3050 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 4, &data_size)) { | |
| 3051 return error::kOutOfBounds; | |
| 3052 } | |
| 3053 if (data_size > immediate_data_size) { | |
| 3054 return error::kOutOfBounds; | |
| 3055 } | |
| 3056 const GLfloat* value = | |
| 3057 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3058 error::Error error = DoUniformMatrix2fv(location, count, transpose, value); | |
| 3059 if (error != error::kNoError) { | |
| 3060 return error; | |
| 3061 } | |
| 3062 return error::kNoError; | |
| 3063 } | |
| 3064 | |
| 3065 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix2x3fvImmediate( | |
| 3066 uint32_t immediate_data_size, | |
| 3067 const void* cmd_data) { | |
| 3068 const gles2::cmds::UniformMatrix2x3fvImmediate& c = | |
| 3069 *static_cast<const gles2::cmds::UniformMatrix2x3fvImmediate*>(cmd_data); | |
| 3070 (void)c; | |
| 3071 GLint location = static_cast<GLint>(c.location); | |
| 3072 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3073 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3074 uint32_t data_size = 0; | |
| 3075 if (count >= 0 && | |
| 3076 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 6, &data_size)) { | |
| 3077 return error::kOutOfBounds; | |
| 3078 } | |
| 3079 if (data_size > immediate_data_size) { | |
| 3080 return error::kOutOfBounds; | |
| 3081 } | |
| 3082 const GLfloat* value = | |
| 3083 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3084 error::Error error = DoUniformMatrix2x3fv(location, count, transpose, value); | |
| 3085 if (error != error::kNoError) { | |
| 3086 return error; | |
| 3087 } | |
| 3088 return error::kNoError; | |
| 3089 } | |
| 3090 | |
| 3091 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix2x4fvImmediate( | |
| 3092 uint32_t immediate_data_size, | |
| 3093 const void* cmd_data) { | |
| 3094 const gles2::cmds::UniformMatrix2x4fvImmediate& c = | |
| 3095 *static_cast<const gles2::cmds::UniformMatrix2x4fvImmediate*>(cmd_data); | |
| 3096 (void)c; | |
| 3097 GLint location = static_cast<GLint>(c.location); | |
| 3098 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3099 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3100 uint32_t data_size = 0; | |
| 3101 if (count >= 0 && | |
| 3102 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 8, &data_size)) { | |
| 3103 return error::kOutOfBounds; | |
| 3104 } | |
| 3105 if (data_size > immediate_data_size) { | |
| 3106 return error::kOutOfBounds; | |
| 3107 } | |
| 3108 const GLfloat* value = | |
| 3109 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3110 error::Error error = DoUniformMatrix2x4fv(location, count, transpose, value); | |
| 3111 if (error != error::kNoError) { | |
| 3112 return error; | |
| 3113 } | |
| 3114 return error::kNoError; | |
| 3115 } | |
| 3116 | |
| 3117 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix3fvImmediate( | |
| 3118 uint32_t immediate_data_size, | |
| 3119 const void* cmd_data) { | |
| 3120 const gles2::cmds::UniformMatrix3fvImmediate& c = | |
| 3121 *static_cast<const gles2::cmds::UniformMatrix3fvImmediate*>(cmd_data); | |
| 3122 (void)c; | |
| 3123 GLint location = static_cast<GLint>(c.location); | |
| 3124 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3125 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3126 uint32_t data_size = 0; | |
| 3127 if (count >= 0 && | |
| 3128 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 9, &data_size)) { | |
| 3129 return error::kOutOfBounds; | |
| 3130 } | |
| 3131 if (data_size > immediate_data_size) { | |
| 3132 return error::kOutOfBounds; | |
| 3133 } | |
| 3134 const GLfloat* value = | |
| 3135 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3136 error::Error error = DoUniformMatrix3fv(location, count, transpose, value); | |
| 3137 if (error != error::kNoError) { | |
| 3138 return error; | |
| 3139 } | |
| 3140 return error::kNoError; | |
| 3141 } | |
| 3142 | |
| 3143 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix3x2fvImmediate( | |
| 3144 uint32_t immediate_data_size, | |
| 3145 const void* cmd_data) { | |
| 3146 const gles2::cmds::UniformMatrix3x2fvImmediate& c = | |
| 3147 *static_cast<const gles2::cmds::UniformMatrix3x2fvImmediate*>(cmd_data); | |
| 3148 (void)c; | |
| 3149 GLint location = static_cast<GLint>(c.location); | |
| 3150 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3151 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3152 uint32_t data_size = 0; | |
| 3153 if (count >= 0 && | |
| 3154 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 6, &data_size)) { | |
| 3155 return error::kOutOfBounds; | |
| 3156 } | |
| 3157 if (data_size > immediate_data_size) { | |
| 3158 return error::kOutOfBounds; | |
| 3159 } | |
| 3160 const GLfloat* value = | |
| 3161 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3162 error::Error error = DoUniformMatrix3x2fv(location, count, transpose, value); | |
| 3163 if (error != error::kNoError) { | |
| 3164 return error; | |
| 3165 } | |
| 3166 return error::kNoError; | |
| 3167 } | |
| 3168 | |
| 3169 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix3x4fvImmediate( | |
| 3170 uint32_t immediate_data_size, | |
| 3171 const void* cmd_data) { | |
| 3172 const gles2::cmds::UniformMatrix3x4fvImmediate& c = | |
| 3173 *static_cast<const gles2::cmds::UniformMatrix3x4fvImmediate*>(cmd_data); | |
| 3174 (void)c; | |
| 3175 GLint location = static_cast<GLint>(c.location); | |
| 3176 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3177 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3178 uint32_t data_size = 0; | |
| 3179 if (count >= 0 && | |
| 3180 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 12, &data_size)) { | |
| 3181 return error::kOutOfBounds; | |
| 3182 } | |
| 3183 if (data_size > immediate_data_size) { | |
| 3184 return error::kOutOfBounds; | |
| 3185 } | |
| 3186 const GLfloat* value = | |
| 3187 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3188 error::Error error = DoUniformMatrix3x4fv(location, count, transpose, value); | |
| 3189 if (error != error::kNoError) { | |
| 3190 return error; | |
| 3191 } | |
| 3192 return error::kNoError; | |
| 3193 } | |
| 3194 | |
| 3195 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix4fvImmediate( | |
| 3196 uint32_t immediate_data_size, | |
| 3197 const void* cmd_data) { | |
| 3198 const gles2::cmds::UniformMatrix4fvImmediate& c = | |
| 3199 *static_cast<const gles2::cmds::UniformMatrix4fvImmediate*>(cmd_data); | |
| 3200 (void)c; | |
| 3201 GLint location = static_cast<GLint>(c.location); | |
| 3202 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3203 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3204 uint32_t data_size = 0; | |
| 3205 if (count >= 0 && | |
| 3206 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 16, &data_size)) { | |
| 3207 return error::kOutOfBounds; | |
| 3208 } | |
| 3209 if (data_size > immediate_data_size) { | |
| 3210 return error::kOutOfBounds; | |
| 3211 } | |
| 3212 const GLfloat* value = | |
| 3213 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3214 error::Error error = DoUniformMatrix4fv(location, count, transpose, value); | |
| 3215 if (error != error::kNoError) { | |
| 3216 return error; | |
| 3217 } | |
| 3218 return error::kNoError; | |
| 3219 } | |
| 3220 | |
| 3221 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix4x2fvImmediate( | |
| 3222 uint32_t immediate_data_size, | |
| 3223 const void* cmd_data) { | |
| 3224 const gles2::cmds::UniformMatrix4x2fvImmediate& c = | |
| 3225 *static_cast<const gles2::cmds::UniformMatrix4x2fvImmediate*>(cmd_data); | |
| 3226 (void)c; | |
| 3227 GLint location = static_cast<GLint>(c.location); | |
| 3228 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3229 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3230 uint32_t data_size = 0; | |
| 3231 if (count >= 0 && | |
| 3232 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 8, &data_size)) { | |
| 3233 return error::kOutOfBounds; | |
| 3234 } | |
| 3235 if (data_size > immediate_data_size) { | |
| 3236 return error::kOutOfBounds; | |
| 3237 } | |
| 3238 const GLfloat* value = | |
| 3239 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3240 error::Error error = DoUniformMatrix4x2fv(location, count, transpose, value); | |
| 3241 if (error != error::kNoError) { | |
| 3242 return error; | |
| 3243 } | |
| 3244 return error::kNoError; | |
| 3245 } | |
| 3246 | |
| 3247 error::Error GLES2DecoderPassthroughImpl::HandleUniformMatrix4x3fvImmediate( | |
| 3248 uint32_t immediate_data_size, | |
| 3249 const void* cmd_data) { | |
| 3250 const gles2::cmds::UniformMatrix4x3fvImmediate& c = | |
| 3251 *static_cast<const gles2::cmds::UniformMatrix4x3fvImmediate*>(cmd_data); | |
| 3252 (void)c; | |
| 3253 GLint location = static_cast<GLint>(c.location); | |
| 3254 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3255 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 3256 uint32_t data_size = 0; | |
| 3257 if (count >= 0 && | |
| 3258 !GLES2Util::ComputeDataSize(count, sizeof(GLfloat), 12, &data_size)) { | |
| 3259 return error::kOutOfBounds; | |
| 3260 } | |
| 3261 if (data_size > immediate_data_size) { | |
| 3262 return error::kOutOfBounds; | |
| 3263 } | |
| 3264 const GLfloat* value = | |
| 3265 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3266 error::Error error = DoUniformMatrix4x3fv(location, count, transpose, value); | |
| 3267 if (error != error::kNoError) { | |
| 3268 return error; | |
| 3269 } | |
| 3270 return error::kNoError; | |
| 3271 } | |
| 3272 | |
| 3273 error::Error GLES2DecoderPassthroughImpl::HandleUseProgram( | |
| 3274 uint32_t immediate_data_size, | |
| 3275 const void* cmd_data) { | |
| 3276 const gles2::cmds::UseProgram& c = | |
| 3277 *static_cast<const gles2::cmds::UseProgram*>(cmd_data); | |
| 3278 (void)c; | |
| 3279 GLuint program = c.program; | |
| 3280 error::Error error = DoUseProgram(program); | |
| 3281 if (error != error::kNoError) { | |
| 3282 return error; | |
| 3283 } | |
| 3284 return error::kNoError; | |
| 3285 } | |
| 3286 | |
| 3287 error::Error GLES2DecoderPassthroughImpl::HandleValidateProgram( | |
| 3288 uint32_t immediate_data_size, | |
| 3289 const void* cmd_data) { | |
| 3290 const gles2::cmds::ValidateProgram& c = | |
| 3291 *static_cast<const gles2::cmds::ValidateProgram*>(cmd_data); | |
| 3292 (void)c; | |
| 3293 GLuint program = c.program; | |
| 3294 error::Error error = DoValidateProgram(program); | |
| 3295 if (error != error::kNoError) { | |
| 3296 return error; | |
| 3297 } | |
| 3298 return error::kNoError; | |
| 3299 } | |
| 3300 | |
| 3301 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib1f( | |
| 3302 uint32_t immediate_data_size, | |
| 3303 const void* cmd_data) { | |
| 3304 const gles2::cmds::VertexAttrib1f& c = | |
| 3305 *static_cast<const gles2::cmds::VertexAttrib1f*>(cmd_data); | |
| 3306 (void)c; | |
| 3307 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3308 GLfloat x = static_cast<GLfloat>(c.x); | |
| 3309 error::Error error = DoVertexAttrib1f(indx, x); | |
| 3310 if (error != error::kNoError) { | |
| 3311 return error; | |
| 3312 } | |
| 3313 return error::kNoError; | |
| 3314 } | |
| 3315 | |
| 3316 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib1fvImmediate( | |
| 3317 uint32_t immediate_data_size, | |
| 3318 const void* cmd_data) { | |
| 3319 const gles2::cmds::VertexAttrib1fvImmediate& c = | |
| 3320 *static_cast<const gles2::cmds::VertexAttrib1fvImmediate*>(cmd_data); | |
| 3321 (void)c; | |
| 3322 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3323 uint32_t data_size; | |
| 3324 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | |
| 3325 return error::kOutOfBounds; | |
| 3326 } | |
| 3327 if (data_size > immediate_data_size) { | |
| 3328 return error::kOutOfBounds; | |
| 3329 } | |
| 3330 const GLfloat* values = | |
| 3331 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3332 error::Error error = DoVertexAttrib1fv(indx, values); | |
| 3333 if (error != error::kNoError) { | |
| 3334 return error; | |
| 3335 } | |
| 3336 return error::kNoError; | |
| 3337 } | |
| 3338 | |
| 3339 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib2f( | |
| 3340 uint32_t immediate_data_size, | |
| 3341 const void* cmd_data) { | |
| 3342 const gles2::cmds::VertexAttrib2f& c = | |
| 3343 *static_cast<const gles2::cmds::VertexAttrib2f*>(cmd_data); | |
| 3344 (void)c; | |
| 3345 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3346 GLfloat x = static_cast<GLfloat>(c.x); | |
| 3347 GLfloat y = static_cast<GLfloat>(c.y); | |
| 3348 error::Error error = DoVertexAttrib2f(indx, x, y); | |
| 3349 if (error != error::kNoError) { | |
| 3350 return error; | |
| 3351 } | |
| 3352 return error::kNoError; | |
| 3353 } | |
| 3354 | |
| 3355 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib2fvImmediate( | |
| 3356 uint32_t immediate_data_size, | |
| 3357 const void* cmd_data) { | |
| 3358 const gles2::cmds::VertexAttrib2fvImmediate& c = | |
| 3359 *static_cast<const gles2::cmds::VertexAttrib2fvImmediate*>(cmd_data); | |
| 3360 (void)c; | |
| 3361 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3362 uint32_t data_size; | |
| 3363 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 2, &data_size)) { | |
| 3364 return error::kOutOfBounds; | |
| 3365 } | |
| 3366 if (data_size > immediate_data_size) { | |
| 3367 return error::kOutOfBounds; | |
| 3368 } | |
| 3369 const GLfloat* values = | |
| 3370 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3371 error::Error error = DoVertexAttrib2fv(indx, values); | |
| 3372 if (error != error::kNoError) { | |
| 3373 return error; | |
| 3374 } | |
| 3375 return error::kNoError; | |
| 3376 } | |
| 3377 | |
| 3378 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib3f( | |
| 3379 uint32_t immediate_data_size, | |
| 3380 const void* cmd_data) { | |
| 3381 const gles2::cmds::VertexAttrib3f& c = | |
| 3382 *static_cast<const gles2::cmds::VertexAttrib3f*>(cmd_data); | |
| 3383 (void)c; | |
| 3384 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3385 GLfloat x = static_cast<GLfloat>(c.x); | |
| 3386 GLfloat y = static_cast<GLfloat>(c.y); | |
| 3387 GLfloat z = static_cast<GLfloat>(c.z); | |
| 3388 error::Error error = DoVertexAttrib3f(indx, x, y, z); | |
| 3389 if (error != error::kNoError) { | |
| 3390 return error; | |
| 3391 } | |
| 3392 return error::kNoError; | |
| 3393 } | |
| 3394 | |
| 3395 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib3fvImmediate( | |
| 3396 uint32_t immediate_data_size, | |
| 3397 const void* cmd_data) { | |
| 3398 const gles2::cmds::VertexAttrib3fvImmediate& c = | |
| 3399 *static_cast<const gles2::cmds::VertexAttrib3fvImmediate*>(cmd_data); | |
| 3400 (void)c; | |
| 3401 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3402 uint32_t data_size; | |
| 3403 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 3, &data_size)) { | |
| 3404 return error::kOutOfBounds; | |
| 3405 } | |
| 3406 if (data_size > immediate_data_size) { | |
| 3407 return error::kOutOfBounds; | |
| 3408 } | |
| 3409 const GLfloat* values = | |
| 3410 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3411 error::Error error = DoVertexAttrib3fv(indx, values); | |
| 3412 if (error != error::kNoError) { | |
| 3413 return error; | |
| 3414 } | |
| 3415 return error::kNoError; | |
| 3416 } | |
| 3417 | |
| 3418 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib4f( | |
| 3419 uint32_t immediate_data_size, | |
| 3420 const void* cmd_data) { | |
| 3421 const gles2::cmds::VertexAttrib4f& c = | |
| 3422 *static_cast<const gles2::cmds::VertexAttrib4f*>(cmd_data); | |
| 3423 (void)c; | |
| 3424 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3425 GLfloat x = static_cast<GLfloat>(c.x); | |
| 3426 GLfloat y = static_cast<GLfloat>(c.y); | |
| 3427 GLfloat z = static_cast<GLfloat>(c.z); | |
| 3428 GLfloat w = static_cast<GLfloat>(c.w); | |
| 3429 error::Error error = DoVertexAttrib4f(indx, x, y, z, w); | |
| 3430 if (error != error::kNoError) { | |
| 3431 return error; | |
| 3432 } | |
| 3433 return error::kNoError; | |
| 3434 } | |
| 3435 | |
| 3436 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttrib4fvImmediate( | |
| 3437 uint32_t immediate_data_size, | |
| 3438 const void* cmd_data) { | |
| 3439 const gles2::cmds::VertexAttrib4fvImmediate& c = | |
| 3440 *static_cast<const gles2::cmds::VertexAttrib4fvImmediate*>(cmd_data); | |
| 3441 (void)c; | |
| 3442 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3443 uint32_t data_size; | |
| 3444 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { | |
| 3445 return error::kOutOfBounds; | |
| 3446 } | |
| 3447 if (data_size > immediate_data_size) { | |
| 3448 return error::kOutOfBounds; | |
| 3449 } | |
| 3450 const GLfloat* values = | |
| 3451 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 3452 error::Error error = DoVertexAttrib4fv(indx, values); | |
| 3453 if (error != error::kNoError) { | |
| 3454 return error; | |
| 3455 } | |
| 3456 return error::kNoError; | |
| 3457 } | |
| 3458 | |
| 3459 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4i( | |
| 3460 uint32_t immediate_data_size, | |
| 3461 const void* cmd_data) { | |
| 3462 const gles2::cmds::VertexAttribI4i& c = | |
| 3463 *static_cast<const gles2::cmds::VertexAttribI4i*>(cmd_data); | |
| 3464 (void)c; | |
| 3465 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3466 GLint x = static_cast<GLint>(c.x); | |
| 3467 GLint y = static_cast<GLint>(c.y); | |
| 3468 GLint z = static_cast<GLint>(c.z); | |
| 3469 GLint w = static_cast<GLint>(c.w); | |
| 3470 error::Error error = DoVertexAttribI4i(indx, x, y, z, w); | |
| 3471 if (error != error::kNoError) { | |
| 3472 return error; | |
| 3473 } | |
| 3474 return error::kNoError; | |
| 3475 } | |
| 3476 | |
| 3477 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4ivImmediate( | |
| 3478 uint32_t immediate_data_size, | |
| 3479 const void* cmd_data) { | |
| 3480 const gles2::cmds::VertexAttribI4ivImmediate& c = | |
| 3481 *static_cast<const gles2::cmds::VertexAttribI4ivImmediate*>(cmd_data); | |
| 3482 (void)c; | |
| 3483 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3484 uint32_t data_size; | |
| 3485 if (!GLES2Util::ComputeDataSize(1, sizeof(GLint), 4, &data_size)) { | |
| 3486 return error::kOutOfBounds; | |
| 3487 } | |
| 3488 if (data_size > immediate_data_size) { | |
| 3489 return error::kOutOfBounds; | |
| 3490 } | |
| 3491 const GLint* values = | |
| 3492 GetImmediateDataAs<const GLint*>(c, data_size, immediate_data_size); | |
| 3493 error::Error error = DoVertexAttribI4iv(indx, values); | |
| 3494 if (error != error::kNoError) { | |
| 3495 return error; | |
| 3496 } | |
| 3497 return error::kNoError; | |
| 3498 } | |
| 3499 | |
| 3500 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4ui( | |
| 3501 uint32_t immediate_data_size, | |
| 3502 const void* cmd_data) { | |
| 3503 const gles2::cmds::VertexAttribI4ui& c = | |
| 3504 *static_cast<const gles2::cmds::VertexAttribI4ui*>(cmd_data); | |
| 3505 (void)c; | |
| 3506 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3507 GLuint x = static_cast<GLuint>(c.x); | |
| 3508 GLuint y = static_cast<GLuint>(c.y); | |
| 3509 GLuint z = static_cast<GLuint>(c.z); | |
| 3510 GLuint w = static_cast<GLuint>(c.w); | |
| 3511 error::Error error = DoVertexAttribI4ui(indx, x, y, z, w); | |
| 3512 if (error != error::kNoError) { | |
| 3513 return error; | |
| 3514 } | |
| 3515 return error::kNoError; | |
| 3516 } | |
| 3517 | |
| 3518 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribI4uivImmediate( | |
| 3519 uint32_t immediate_data_size, | |
| 3520 const void* cmd_data) { | |
| 3521 const gles2::cmds::VertexAttribI4uivImmediate& c = | |
| 3522 *static_cast<const gles2::cmds::VertexAttribI4uivImmediate*>(cmd_data); | |
| 3523 (void)c; | |
| 3524 GLuint indx = static_cast<GLuint>(c.indx); | |
| 3525 uint32_t data_size; | |
| 3526 if (!GLES2Util::ComputeDataSize(1, sizeof(GLuint), 4, &data_size)) { | |
| 3527 return error::kOutOfBounds; | |
| 3528 } | |
| 3529 if (data_size > immediate_data_size) { | |
| 3530 return error::kOutOfBounds; | |
| 3531 } | |
| 3532 const GLuint* values = | |
| 3533 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 3534 error::Error error = DoVertexAttribI4uiv(indx, values); | |
| 3535 if (error != error::kNoError) { | |
| 3536 return error; | |
| 3537 } | |
| 3538 return error::kNoError; | |
| 3539 } | |
| 3540 | |
| 3541 error::Error GLES2DecoderPassthroughImpl::HandleViewport( | |
| 3542 uint32_t immediate_data_size, | |
| 3543 const void* cmd_data) { | |
| 3544 const gles2::cmds::Viewport& c = | |
| 3545 *static_cast<const gles2::cmds::Viewport*>(cmd_data); | |
| 3546 (void)c; | |
| 3547 GLint x = static_cast<GLint>(c.x); | |
| 3548 GLint y = static_cast<GLint>(c.y); | |
| 3549 GLsizei width = static_cast<GLsizei>(c.width); | |
| 3550 GLsizei height = static_cast<GLsizei>(c.height); | |
| 3551 error::Error error = DoViewport(x, y, width, height); | |
| 3552 if (error != error::kNoError) { | |
| 3553 return error; | |
| 3554 } | |
| 3555 return error::kNoError; | |
| 3556 } | |
| 3557 | |
| 3558 error::Error GLES2DecoderPassthroughImpl::HandleBlitFramebufferCHROMIUM( | |
| 3559 uint32_t immediate_data_size, | |
| 3560 const void* cmd_data) { | |
| 3561 const gles2::cmds::BlitFramebufferCHROMIUM& c = | |
| 3562 *static_cast<const gles2::cmds::BlitFramebufferCHROMIUM*>(cmd_data); | |
| 3563 (void)c; | |
| 3564 GLint srcX0 = static_cast<GLint>(c.srcX0); | |
| 3565 GLint srcY0 = static_cast<GLint>(c.srcY0); | |
| 3566 GLint srcX1 = static_cast<GLint>(c.srcX1); | |
| 3567 GLint srcY1 = static_cast<GLint>(c.srcY1); | |
| 3568 GLint dstX0 = static_cast<GLint>(c.dstX0); | |
| 3569 GLint dstY0 = static_cast<GLint>(c.dstY0); | |
| 3570 GLint dstX1 = static_cast<GLint>(c.dstX1); | |
| 3571 GLint dstY1 = static_cast<GLint>(c.dstY1); | |
| 3572 GLbitfield mask = static_cast<GLbitfield>(c.mask); | |
| 3573 GLenum filter = static_cast<GLenum>(c.filter); | |
| 3574 error::Error error = DoBlitFramebufferCHROMIUM( | |
| 3575 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | |
| 3576 if (error != error::kNoError) { | |
| 3577 return error; | |
| 3578 } | |
| 3579 return error::kNoError; | |
| 3580 } | |
| 3581 | |
| 3582 error::Error | |
| 3583 GLES2DecoderPassthroughImpl::HandleRenderbufferStorageMultisampleCHROMIUM( | |
| 3584 uint32_t immediate_data_size, | |
| 3585 const void* cmd_data) { | |
| 3586 const gles2::cmds::RenderbufferStorageMultisampleCHROMIUM& c = | |
| 3587 *static_cast<const gles2::cmds::RenderbufferStorageMultisampleCHROMIUM*>( | |
| 3588 cmd_data); | |
| 3589 (void)c; | |
| 3590 GLenum target = static_cast<GLenum>(c.target); | |
| 3591 GLsizei samples = static_cast<GLsizei>(c.samples); | |
| 3592 GLenum internalformat = static_cast<GLenum>(c.internalformat); | |
| 3593 GLsizei width = static_cast<GLsizei>(c.width); | |
| 3594 GLsizei height = static_cast<GLsizei>(c.height); | |
| 3595 error::Error error = DoRenderbufferStorageMultisampleCHROMIUM( | |
| 3596 target, samples, internalformat, width, height); | |
| 3597 if (error != error::kNoError) { | |
| 3598 return error; | |
| 3599 } | |
| 3600 return error::kNoError; | |
| 3601 } | |
| 3602 | |
| 3603 error::Error | |
| 3604 GLES2DecoderPassthroughImpl::HandleRenderbufferStorageMultisampleEXT( | |
| 3605 uint32_t immediate_data_size, | |
| 3606 const void* cmd_data) { | |
| 3607 const gles2::cmds::RenderbufferStorageMultisampleEXT& c = | |
| 3608 *static_cast<const gles2::cmds::RenderbufferStorageMultisampleEXT*>( | |
| 3609 cmd_data); | |
| 3610 (void)c; | |
| 3611 GLenum target = static_cast<GLenum>(c.target); | |
| 3612 GLsizei samples = static_cast<GLsizei>(c.samples); | |
| 3613 GLenum internalformat = static_cast<GLenum>(c.internalformat); | |
| 3614 GLsizei width = static_cast<GLsizei>(c.width); | |
| 3615 GLsizei height = static_cast<GLsizei>(c.height); | |
| 3616 error::Error error = DoRenderbufferStorageMultisampleEXT( | |
| 3617 target, samples, internalformat, width, height); | |
| 3618 if (error != error::kNoError) { | |
| 3619 return error; | |
| 3620 } | |
| 3621 return error::kNoError; | |
| 3622 } | |
| 3623 | |
| 3624 error::Error | |
| 3625 GLES2DecoderPassthroughImpl::HandleFramebufferTexture2DMultisampleEXT( | |
| 3626 uint32_t immediate_data_size, | |
| 3627 const void* cmd_data) { | |
| 3628 const gles2::cmds::FramebufferTexture2DMultisampleEXT& c = | |
| 3629 *static_cast<const gles2::cmds::FramebufferTexture2DMultisampleEXT*>( | |
| 3630 cmd_data); | |
| 3631 (void)c; | |
| 3632 GLenum target = static_cast<GLenum>(c.target); | |
| 3633 GLenum attachment = static_cast<GLenum>(c.attachment); | |
| 3634 GLenum textarget = static_cast<GLenum>(c.textarget); | |
| 3635 GLuint texture = c.texture; | |
| 3636 GLint level = static_cast<GLint>(c.level); | |
| 3637 GLsizei samples = static_cast<GLsizei>(c.samples); | |
| 3638 error::Error error = DoFramebufferTexture2DMultisampleEXT( | |
| 3639 target, attachment, textarget, texture, level, samples); | |
| 3640 if (error != error::kNoError) { | |
| 3641 return error; | |
| 3642 } | |
| 3643 return error::kNoError; | |
| 3644 } | |
| 3645 | |
| 3646 error::Error GLES2DecoderPassthroughImpl::HandleTexStorage2DEXT( | |
| 3647 uint32_t immediate_data_size, | |
| 3648 const void* cmd_data) { | |
| 3649 const gles2::cmds::TexStorage2DEXT& c = | |
| 3650 *static_cast<const gles2::cmds::TexStorage2DEXT*>(cmd_data); | |
| 3651 (void)c; | |
| 3652 GLenum target = static_cast<GLenum>(c.target); | |
| 3653 GLsizei levels = static_cast<GLsizei>(c.levels); | |
| 3654 GLenum internalFormat = static_cast<GLenum>(c.internalFormat); | |
| 3655 GLsizei width = static_cast<GLsizei>(c.width); | |
| 3656 GLsizei height = static_cast<GLsizei>(c.height); | |
| 3657 error::Error error = | |
| 3658 DoTexStorage2DEXT(target, levels, internalFormat, width, height); | |
| 3659 if (error != error::kNoError) { | |
| 3660 return error; | |
| 3661 } | |
| 3662 return error::kNoError; | |
| 3663 } | |
| 3664 | |
| 3665 error::Error GLES2DecoderPassthroughImpl::HandleGenQueriesEXTImmediate( | |
| 3666 uint32_t immediate_data_size, | |
| 3667 const void* cmd_data) { | |
| 3668 const gles2::cmds::GenQueriesEXTImmediate& c = | |
| 3669 *static_cast<const gles2::cmds::GenQueriesEXTImmediate*>(cmd_data); | |
| 3670 (void)c; | |
| 3671 GLsizei n = static_cast<GLsizei>(c.n); | |
| 3672 uint32_t data_size; | |
| 3673 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 3674 return error::kOutOfBounds; | |
| 3675 } | |
| 3676 GLuint* queries = | |
| 3677 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 3678 error::Error error = DoGenQueriesEXT(n, queries); | |
| 3679 if (error != error::kNoError) { | |
| 3680 return error; | |
| 3681 } | |
| 3682 return error::kNoError; | |
| 3683 } | |
| 3684 | |
| 3685 error::Error GLES2DecoderPassthroughImpl::HandleDeleteQueriesEXTImmediate( | |
| 3686 uint32_t immediate_data_size, | |
| 3687 const void* cmd_data) { | |
| 3688 const gles2::cmds::DeleteQueriesEXTImmediate& c = | |
| 3689 *static_cast<const gles2::cmds::DeleteQueriesEXTImmediate*>(cmd_data); | |
| 3690 (void)c; | |
| 3691 GLsizei n = static_cast<GLsizei>(c.n); | |
| 3692 uint32_t data_size; | |
| 3693 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 3694 return error::kOutOfBounds; | |
| 3695 } | |
| 3696 const GLuint* queries = | |
| 3697 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 3698 error::Error error = DoDeleteQueriesEXT(n, queries); | |
| 3699 if (error != error::kNoError) { | |
| 3700 return error; | |
| 3701 } | |
| 3702 return error::kNoError; | |
| 3703 } | |
| 3704 | |
| 3705 error::Error GLES2DecoderPassthroughImpl::HandleBeginTransformFeedback( | |
| 3706 uint32_t immediate_data_size, | |
| 3707 const void* cmd_data) { | |
| 3708 const gles2::cmds::BeginTransformFeedback& c = | |
| 3709 *static_cast<const gles2::cmds::BeginTransformFeedback*>(cmd_data); | |
| 3710 (void)c; | |
| 3711 GLenum primitivemode = static_cast<GLenum>(c.primitivemode); | |
| 3712 error::Error error = DoBeginTransformFeedback(primitivemode); | |
| 3713 if (error != error::kNoError) { | |
| 3714 return error; | |
| 3715 } | |
| 3716 return error::kNoError; | |
| 3717 } | |
| 3718 | |
| 3719 error::Error GLES2DecoderPassthroughImpl::HandleEndTransformFeedback( | |
| 3720 uint32_t immediate_data_size, | |
| 3721 const void* cmd_data) { | |
| 3722 const gles2::cmds::EndTransformFeedback& c = | |
| 3723 *static_cast<const gles2::cmds::EndTransformFeedback*>(cmd_data); | |
| 3724 (void)c; | |
| 3725 error::Error error = DoEndTransformFeedback(); | |
| 3726 if (error != error::kNoError) { | |
| 3727 return error; | |
| 3728 } | |
| 3729 return error::kNoError; | |
| 3730 } | |
| 3731 | |
| 3732 error::Error GLES2DecoderPassthroughImpl::HandlePopGroupMarkerEXT( | |
| 3733 uint32_t immediate_data_size, | |
| 3734 const void* cmd_data) { | |
| 3735 const gles2::cmds::PopGroupMarkerEXT& c = | |
| 3736 *static_cast<const gles2::cmds::PopGroupMarkerEXT*>(cmd_data); | |
| 3737 (void)c; | |
| 3738 error::Error error = DoPopGroupMarkerEXT(); | |
| 3739 if (error != error::kNoError) { | |
| 3740 return error; | |
| 3741 } | |
| 3742 return error::kNoError; | |
| 3743 } | |
| 3744 | |
| 3745 error::Error GLES2DecoderPassthroughImpl::HandleGenVertexArraysOESImmediate( | |
| 3746 uint32_t immediate_data_size, | |
| 3747 const void* cmd_data) { | |
| 3748 const gles2::cmds::GenVertexArraysOESImmediate& c = | |
| 3749 *static_cast<const gles2::cmds::GenVertexArraysOESImmediate*>(cmd_data); | |
| 3750 (void)c; | |
| 3751 GLsizei n = static_cast<GLsizei>(c.n); | |
| 3752 uint32_t data_size; | |
| 3753 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 3754 return error::kOutOfBounds; | |
| 3755 } | |
| 3756 GLuint* arrays = | |
| 3757 GetImmediateDataAs<GLuint*>(c, data_size, immediate_data_size); | |
| 3758 error::Error error = DoGenVertexArraysOES(n, arrays); | |
| 3759 if (error != error::kNoError) { | |
| 3760 return error; | |
| 3761 } | |
| 3762 return error::kNoError; | |
| 3763 } | |
| 3764 | |
| 3765 error::Error GLES2DecoderPassthroughImpl::HandleDeleteVertexArraysOESImmediate( | |
| 3766 uint32_t immediate_data_size, | |
| 3767 const void* cmd_data) { | |
| 3768 const gles2::cmds::DeleteVertexArraysOESImmediate& c = | |
| 3769 *static_cast<const gles2::cmds::DeleteVertexArraysOESImmediate*>( | |
| 3770 cmd_data); | |
| 3771 (void)c; | |
| 3772 GLsizei n = static_cast<GLsizei>(c.n); | |
| 3773 uint32_t data_size; | |
| 3774 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | |
| 3775 return error::kOutOfBounds; | |
| 3776 } | |
| 3777 const GLuint* arrays = | |
| 3778 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); | |
| 3779 error::Error error = DoDeleteVertexArraysOES(n, arrays); | |
| 3780 if (error != error::kNoError) { | |
| 3781 return error; | |
| 3782 } | |
| 3783 return error::kNoError; | |
| 3784 } | |
| 3785 | |
| 3786 error::Error GLES2DecoderPassthroughImpl::HandleIsVertexArrayOES( | |
| 3787 uint32_t immediate_data_size, | |
| 3788 const void* cmd_data) { | |
| 3789 const gles2::cmds::IsVertexArrayOES& c = | |
| 3790 *static_cast<const gles2::cmds::IsVertexArrayOES*>(cmd_data); | |
| 3791 (void)c; | |
| 3792 GLuint array = c.array; | |
| 3793 typedef cmds::IsVertexArrayOES::Result Result; | |
| 3794 Result* result = GetSharedMemoryAs<Result*>( | |
| 3795 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 3796 if (!result) { | |
| 3797 return error::kOutOfBounds; | |
| 3798 } | |
| 3799 error::Error error = DoIsVertexArrayOES(array, result); | |
| 3800 if (error != error::kNoError) { | |
| 3801 return error; | |
| 3802 } | |
| 3803 return error::kNoError; | |
| 3804 } | |
| 3805 | |
| 3806 error::Error GLES2DecoderPassthroughImpl::HandleBindVertexArrayOES( | |
| 3807 uint32_t immediate_data_size, | |
| 3808 const void* cmd_data) { | |
| 3809 const gles2::cmds::BindVertexArrayOES& c = | |
| 3810 *static_cast<const gles2::cmds::BindVertexArrayOES*>(cmd_data); | |
| 3811 (void)c; | |
| 3812 GLuint array = c.array; | |
| 3813 error::Error error = DoBindVertexArrayOES(array); | |
| 3814 if (error != error::kNoError) { | |
| 3815 return error; | |
| 3816 } | |
| 3817 return error::kNoError; | |
| 3818 } | |
| 3819 | |
| 3820 error::Error GLES2DecoderPassthroughImpl::HandleSwapBuffers( | |
| 3821 uint32_t immediate_data_size, | |
| 3822 const void* cmd_data) { | |
| 3823 const gles2::cmds::SwapBuffers& c = | |
| 3824 *static_cast<const gles2::cmds::SwapBuffers*>(cmd_data); | |
| 3825 (void)c; | |
| 3826 error::Error error = DoSwapBuffers(); | |
| 3827 if (error != error::kNoError) { | |
| 3828 return error; | |
| 3829 } | |
| 3830 return error::kNoError; | |
| 3831 } | |
| 3832 | |
| 3833 error::Error GLES2DecoderPassthroughImpl::HandleGetMaxValueInBufferCHROMIUM( | |
| 3834 uint32_t immediate_data_size, | |
| 3835 const void* cmd_data) { | |
| 3836 const gles2::cmds::GetMaxValueInBufferCHROMIUM& c = | |
| 3837 *static_cast<const gles2::cmds::GetMaxValueInBufferCHROMIUM*>(cmd_data); | |
| 3838 (void)c; | |
| 3839 GLuint buffer_id = c.buffer_id; | |
| 3840 GLsizei count = static_cast<GLsizei>(c.count); | |
| 3841 GLenum type = static_cast<GLenum>(c.type); | |
| 3842 GLuint offset = static_cast<GLuint>(c.offset); | |
| 3843 typedef cmds::GetMaxValueInBufferCHROMIUM::Result Result; | |
| 3844 Result* result = GetSharedMemoryAs<Result*>( | |
| 3845 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 3846 if (!result) { | |
| 3847 return error::kOutOfBounds; | |
| 3848 } | |
| 3849 error::Error error = | |
| 3850 DoGetMaxValueInBufferCHROMIUM(buffer_id, count, type, offset, result); | |
| 3851 if (error != error::kNoError) { | |
| 3852 return error; | |
| 3853 } | |
| 3854 return error::kNoError; | |
| 3855 } | |
| 3856 | |
| 3857 error::Error GLES2DecoderPassthroughImpl::HandleTexImageIOSurface2DCHROMIUM( | |
| 3858 uint32_t immediate_data_size, | |
| 3859 const void* cmd_data) { | |
| 3860 const gles2::cmds::TexImageIOSurface2DCHROMIUM& c = | |
| 3861 *static_cast<const gles2::cmds::TexImageIOSurface2DCHROMIUM*>(cmd_data); | |
| 3862 (void)c; | |
| 3863 GLenum target = static_cast<GLenum>(c.target); | |
| 3864 GLsizei width = static_cast<GLsizei>(c.width); | |
| 3865 GLsizei height = static_cast<GLsizei>(c.height); | |
| 3866 GLuint ioSurfaceId = static_cast<GLuint>(c.ioSurfaceId); | |
| 3867 GLuint plane = static_cast<GLuint>(c.plane); | |
| 3868 error::Error error = | |
| 3869 DoTexImageIOSurface2DCHROMIUM(target, width, height, ioSurfaceId, plane); | |
| 3870 if (error != error::kNoError) { | |
| 3871 return error; | |
| 3872 } | |
| 3873 return error::kNoError; | |
| 3874 } | |
| 3875 | |
| 3876 error::Error GLES2DecoderPassthroughImpl::HandleCopyTextureCHROMIUM( | |
| 3877 uint32_t immediate_data_size, | |
| 3878 const void* cmd_data) { | |
| 3879 const gles2::cmds::CopyTextureCHROMIUM& c = | |
| 3880 *static_cast<const gles2::cmds::CopyTextureCHROMIUM*>(cmd_data); | |
| 3881 (void)c; | |
| 3882 GLenum source_id = static_cast<GLenum>(c.source_id); | |
| 3883 GLenum dest_id = static_cast<GLenum>(c.dest_id); | |
| 3884 GLint internalformat = static_cast<GLint>(c.internalformat); | |
| 3885 GLenum dest_type = static_cast<GLenum>(c.dest_type); | |
| 3886 GLboolean unpack_flip_y = static_cast<GLboolean>(c.unpack_flip_y); | |
| 3887 GLboolean unpack_premultiply_alpha = | |
| 3888 static_cast<GLboolean>(c.unpack_premultiply_alpha); | |
| 3889 GLboolean unpack_unmultiply_alpha = | |
| 3890 static_cast<GLboolean>(c.unpack_unmultiply_alpha); | |
| 3891 error::Error error = DoCopyTextureCHROMIUM( | |
| 3892 source_id, dest_id, internalformat, dest_type, unpack_flip_y, | |
| 3893 unpack_premultiply_alpha, unpack_unmultiply_alpha); | |
| 3894 if (error != error::kNoError) { | |
| 3895 return error; | |
| 3896 } | |
| 3897 return error::kNoError; | |
| 3898 } | |
| 3899 | |
| 3900 error::Error GLES2DecoderPassthroughImpl::HandleCopySubTextureCHROMIUM( | |
| 3901 uint32_t immediate_data_size, | |
| 3902 const void* cmd_data) { | |
| 3903 const gles2::cmds::CopySubTextureCHROMIUM& c = | |
| 3904 *static_cast<const gles2::cmds::CopySubTextureCHROMIUM*>(cmd_data); | |
| 3905 (void)c; | |
| 3906 GLenum source_id = static_cast<GLenum>(c.source_id); | |
| 3907 GLenum dest_id = static_cast<GLenum>(c.dest_id); | |
| 3908 GLint xoffset = static_cast<GLint>(c.xoffset); | |
| 3909 GLint yoffset = static_cast<GLint>(c.yoffset); | |
| 3910 GLint x = static_cast<GLint>(c.x); | |
| 3911 GLint y = static_cast<GLint>(c.y); | |
| 3912 GLsizei width = static_cast<GLsizei>(c.width); | |
| 3913 GLsizei height = static_cast<GLsizei>(c.height); | |
| 3914 GLboolean unpack_flip_y = static_cast<GLboolean>(c.unpack_flip_y); | |
| 3915 GLboolean unpack_premultiply_alpha = | |
| 3916 static_cast<GLboolean>(c.unpack_premultiply_alpha); | |
| 3917 GLboolean unpack_unmultiply_alpha = | |
| 3918 static_cast<GLboolean>(c.unpack_unmultiply_alpha); | |
| 3919 error::Error error = DoCopySubTextureCHROMIUM( | |
| 3920 source_id, dest_id, xoffset, yoffset, x, y, width, height, unpack_flip_y, | |
| 3921 unpack_premultiply_alpha, unpack_unmultiply_alpha); | |
| 3922 if (error != error::kNoError) { | |
| 3923 return error; | |
| 3924 } | |
| 3925 return error::kNoError; | |
| 3926 } | |
| 3927 | |
| 3928 error::Error GLES2DecoderPassthroughImpl::HandleCompressedCopyTextureCHROMIUM( | |
| 3929 uint32_t immediate_data_size, | |
| 3930 const void* cmd_data) { | |
| 3931 const gles2::cmds::CompressedCopyTextureCHROMIUM& c = | |
| 3932 *static_cast<const gles2::cmds::CompressedCopyTextureCHROMIUM*>(cmd_data); | |
| 3933 (void)c; | |
| 3934 GLenum source_id = static_cast<GLenum>(c.source_id); | |
| 3935 GLenum dest_id = static_cast<GLenum>(c.dest_id); | |
| 3936 error::Error error = DoCompressedCopyTextureCHROMIUM(source_id, dest_id); | |
| 3937 if (error != error::kNoError) { | |
| 3938 return error; | |
| 3939 } | |
| 3940 return error::kNoError; | |
| 3941 } | |
| 3942 | |
| 3943 error::Error GLES2DecoderPassthroughImpl::HandleProduceTextureCHROMIUMImmediate( | |
| 3944 uint32_t immediate_data_size, | |
| 3945 const void* cmd_data) { | |
| 3946 const gles2::cmds::ProduceTextureCHROMIUMImmediate& c = | |
| 3947 *static_cast<const gles2::cmds::ProduceTextureCHROMIUMImmediate*>( | |
| 3948 cmd_data); | |
| 3949 (void)c; | |
| 3950 GLenum target = static_cast<GLenum>(c.target); | |
| 3951 uint32_t data_size; | |
| 3952 if (!GLES2Util::ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | |
| 3953 return error::kOutOfBounds; | |
| 3954 } | |
| 3955 if (data_size > immediate_data_size) { | |
| 3956 return error::kOutOfBounds; | |
| 3957 } | |
| 3958 const GLbyte* mailbox = | |
| 3959 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); | |
| 3960 error::Error error = DoProduceTextureCHROMIUM(target, mailbox); | |
| 3961 if (error != error::kNoError) { | |
| 3962 return error; | |
| 3963 } | |
| 3964 return error::kNoError; | |
| 3965 } | |
| 3966 | |
| 3967 error::Error | |
| 3968 GLES2DecoderPassthroughImpl::HandleProduceTextureDirectCHROMIUMImmediate( | |
| 3969 uint32_t immediate_data_size, | |
| 3970 const void* cmd_data) { | |
| 3971 const gles2::cmds::ProduceTextureDirectCHROMIUMImmediate& c = | |
| 3972 *static_cast<const gles2::cmds::ProduceTextureDirectCHROMIUMImmediate*>( | |
| 3973 cmd_data); | |
| 3974 (void)c; | |
| 3975 GLuint texture = c.texture; | |
| 3976 GLenum target = static_cast<GLenum>(c.target); | |
| 3977 uint32_t data_size; | |
| 3978 if (!GLES2Util::ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | |
| 3979 return error::kOutOfBounds; | |
| 3980 } | |
| 3981 if (data_size > immediate_data_size) { | |
| 3982 return error::kOutOfBounds; | |
| 3983 } | |
| 3984 const GLbyte* mailbox = | |
| 3985 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); | |
| 3986 error::Error error = DoProduceTextureDirectCHROMIUM(texture, target, mailbox); | |
| 3987 if (error != error::kNoError) { | |
| 3988 return error; | |
| 3989 } | |
| 3990 return error::kNoError; | |
| 3991 } | |
| 3992 | |
| 3993 error::Error GLES2DecoderPassthroughImpl::HandleConsumeTextureCHROMIUMImmediate( | |
| 3994 uint32_t immediate_data_size, | |
| 3995 const void* cmd_data) { | |
| 3996 const gles2::cmds::ConsumeTextureCHROMIUMImmediate& c = | |
| 3997 *static_cast<const gles2::cmds::ConsumeTextureCHROMIUMImmediate*>( | |
| 3998 cmd_data); | |
| 3999 (void)c; | |
| 4000 GLenum target = static_cast<GLenum>(c.target); | |
| 4001 uint32_t data_size; | |
| 4002 if (!GLES2Util::ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | |
| 4003 return error::kOutOfBounds; | |
| 4004 } | |
| 4005 if (data_size > immediate_data_size) { | |
| 4006 return error::kOutOfBounds; | |
| 4007 } | |
| 4008 const GLbyte* mailbox = | |
| 4009 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); | |
| 4010 error::Error error = DoConsumeTextureCHROMIUM(target, mailbox); | |
| 4011 if (error != error::kNoError) { | |
| 4012 return error; | |
| 4013 } | |
| 4014 return error::kNoError; | |
| 4015 } | |
| 4016 | |
| 4017 error::Error GLES2DecoderPassthroughImpl::HandleBindTexImage2DCHROMIUM( | |
| 4018 uint32_t immediate_data_size, | |
| 4019 const void* cmd_data) { | |
| 4020 const gles2::cmds::BindTexImage2DCHROMIUM& c = | |
| 4021 *static_cast<const gles2::cmds::BindTexImage2DCHROMIUM*>(cmd_data); | |
| 4022 (void)c; | |
| 4023 GLenum target = static_cast<GLenum>(c.target); | |
| 4024 GLint imageId = static_cast<GLint>(c.imageId); | |
| 4025 error::Error error = DoBindTexImage2DCHROMIUM(target, imageId); | |
| 4026 if (error != error::kNoError) { | |
| 4027 return error; | |
| 4028 } | |
| 4029 return error::kNoError; | |
| 4030 } | |
| 4031 | |
| 4032 error::Error GLES2DecoderPassthroughImpl::HandleReleaseTexImage2DCHROMIUM( | |
| 4033 uint32_t immediate_data_size, | |
| 4034 const void* cmd_data) { | |
| 4035 const gles2::cmds::ReleaseTexImage2DCHROMIUM& c = | |
| 4036 *static_cast<const gles2::cmds::ReleaseTexImage2DCHROMIUM*>(cmd_data); | |
| 4037 (void)c; | |
| 4038 GLenum target = static_cast<GLenum>(c.target); | |
| 4039 GLint imageId = static_cast<GLint>(c.imageId); | |
| 4040 error::Error error = DoReleaseTexImage2DCHROMIUM(target, imageId); | |
| 4041 if (error != error::kNoError) { | |
| 4042 return error; | |
| 4043 } | |
| 4044 return error::kNoError; | |
| 4045 } | |
| 4046 | |
| 4047 error::Error GLES2DecoderPassthroughImpl::HandleTraceEndCHROMIUM( | |
| 4048 uint32_t immediate_data_size, | |
| 4049 const void* cmd_data) { | |
| 4050 const gles2::cmds::TraceEndCHROMIUM& c = | |
| 4051 *static_cast<const gles2::cmds::TraceEndCHROMIUM*>(cmd_data); | |
| 4052 (void)c; | |
| 4053 error::Error error = DoTraceEndCHROMIUM(); | |
| 4054 if (error != error::kNoError) { | |
| 4055 return error; | |
| 4056 } | |
| 4057 return error::kNoError; | |
| 4058 } | |
| 4059 | |
| 4060 error::Error GLES2DecoderPassthroughImpl::HandleDiscardFramebufferEXTImmediate( | |
| 4061 uint32_t immediate_data_size, | |
| 4062 const void* cmd_data) { | |
| 4063 const gles2::cmds::DiscardFramebufferEXTImmediate& c = | |
| 4064 *static_cast<const gles2::cmds::DiscardFramebufferEXTImmediate*>( | |
| 4065 cmd_data); | |
| 4066 (void)c; | |
| 4067 GLenum target = static_cast<GLenum>(c.target); | |
| 4068 GLsizei count = static_cast<GLsizei>(c.count); | |
| 4069 uint32_t data_size = 0; | |
| 4070 if (count >= 0 && | |
| 4071 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { | |
| 4072 return error::kOutOfBounds; | |
| 4073 } | |
| 4074 if (data_size > immediate_data_size) { | |
| 4075 return error::kOutOfBounds; | |
| 4076 } | |
| 4077 const GLenum* attachments = | |
| 4078 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); | |
| 4079 error::Error error = DoDiscardFramebufferEXT(target, count, attachments); | |
| 4080 if (error != error::kNoError) { | |
| 4081 return error; | |
| 4082 } | |
| 4083 return error::kNoError; | |
| 4084 } | |
| 4085 | |
| 4086 error::Error GLES2DecoderPassthroughImpl::HandleLoseContextCHROMIUM( | |
| 4087 uint32_t immediate_data_size, | |
| 4088 const void* cmd_data) { | |
| 4089 const gles2::cmds::LoseContextCHROMIUM& c = | |
| 4090 *static_cast<const gles2::cmds::LoseContextCHROMIUM*>(cmd_data); | |
| 4091 (void)c; | |
| 4092 GLenum current = static_cast<GLenum>(c.current); | |
| 4093 GLenum other = static_cast<GLenum>(c.other); | |
| 4094 error::Error error = DoLoseContextCHROMIUM(current, other); | |
| 4095 if (error != error::kNoError) { | |
| 4096 return error; | |
| 4097 } | |
| 4098 return error::kNoError; | |
| 4099 } | |
| 4100 | |
| 4101 error::Error GLES2DecoderPassthroughImpl::HandleDrawBuffersEXTImmediate( | |
| 4102 uint32_t immediate_data_size, | |
| 4103 const void* cmd_data) { | |
| 4104 const gles2::cmds::DrawBuffersEXTImmediate& c = | |
| 4105 *static_cast<const gles2::cmds::DrawBuffersEXTImmediate*>(cmd_data); | |
| 4106 (void)c; | |
| 4107 GLsizei count = static_cast<GLsizei>(c.count); | |
| 4108 uint32_t data_size = 0; | |
| 4109 if (count >= 0 && | |
| 4110 !GLES2Util::ComputeDataSize(count, sizeof(GLenum), 1, &data_size)) { | |
| 4111 return error::kOutOfBounds; | |
| 4112 } | |
| 4113 if (data_size > immediate_data_size) { | |
| 4114 return error::kOutOfBounds; | |
| 4115 } | |
| 4116 const GLenum* bufs = | |
| 4117 GetImmediateDataAs<const GLenum*>(c, data_size, immediate_data_size); | |
| 4118 error::Error error = DoDrawBuffersEXT(count, bufs); | |
| 4119 if (error != error::kNoError) { | |
| 4120 return error; | |
| 4121 } | |
| 4122 return error::kNoError; | |
| 4123 } | |
| 4124 | |
| 4125 error::Error GLES2DecoderPassthroughImpl::HandleCommitOverlayPlanesCHROMIUM( | |
| 4126 uint32_t immediate_data_size, | |
| 4127 const void* cmd_data) { | |
| 4128 const gles2::cmds::CommitOverlayPlanesCHROMIUM& c = | |
| 4129 *static_cast<const gles2::cmds::CommitOverlayPlanesCHROMIUM*>(cmd_data); | |
| 4130 (void)c; | |
| 4131 error::Error error = DoCommitOverlayPlanesCHROMIUM(); | |
| 4132 if (error != error::kNoError) { | |
| 4133 return error; | |
| 4134 } | |
| 4135 return error::kNoError; | |
| 4136 } | |
| 4137 | |
| 4138 error::Error GLES2DecoderPassthroughImpl::HandleSwapInterval( | |
| 4139 uint32_t immediate_data_size, | |
| 4140 const void* cmd_data) { | |
| 4141 const gles2::cmds::SwapInterval& c = | |
| 4142 *static_cast<const gles2::cmds::SwapInterval*>(cmd_data); | |
| 4143 (void)c; | |
| 4144 GLint interval = static_cast<GLint>(c.interval); | |
| 4145 error::Error error = DoSwapInterval(interval); | |
| 4146 if (error != error::kNoError) { | |
| 4147 return error; | |
| 4148 } | |
| 4149 return error::kNoError; | |
| 4150 } | |
| 4151 | |
| 4152 error::Error GLES2DecoderPassthroughImpl::HandleFlushDriverCachesCHROMIUM( | |
| 4153 uint32_t immediate_data_size, | |
| 4154 const void* cmd_data) { | |
| 4155 const gles2::cmds::FlushDriverCachesCHROMIUM& c = | |
| 4156 *static_cast<const gles2::cmds::FlushDriverCachesCHROMIUM*>(cmd_data); | |
| 4157 (void)c; | |
| 4158 error::Error error = DoFlushDriverCachesCHROMIUM(); | |
| 4159 if (error != error::kNoError) { | |
| 4160 return error; | |
| 4161 } | |
| 4162 return error::kNoError; | |
| 4163 } | |
| 4164 | |
| 4165 error::Error GLES2DecoderPassthroughImpl::HandleMatrixLoadfCHROMIUMImmediate( | |
| 4166 uint32_t immediate_data_size, | |
| 4167 const void* cmd_data) { | |
| 4168 const gles2::cmds::MatrixLoadfCHROMIUMImmediate& c = | |
| 4169 *static_cast<const gles2::cmds::MatrixLoadfCHROMIUMImmediate*>(cmd_data); | |
| 4170 (void)c; | |
| 4171 GLenum matrixMode = static_cast<GLenum>(c.matrixMode); | |
| 4172 uint32_t data_size; | |
| 4173 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { | |
| 4174 return error::kOutOfBounds; | |
| 4175 } | |
| 4176 if (data_size > immediate_data_size) { | |
| 4177 return error::kOutOfBounds; | |
| 4178 } | |
| 4179 const GLfloat* m = | |
| 4180 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 4181 error::Error error = DoMatrixLoadfCHROMIUM(matrixMode, m); | |
| 4182 if (error != error::kNoError) { | |
| 4183 return error; | |
| 4184 } | |
| 4185 return error::kNoError; | |
| 4186 } | |
| 4187 | |
| 4188 error::Error GLES2DecoderPassthroughImpl::HandleMatrixLoadIdentityCHROMIUM( | |
| 4189 uint32_t immediate_data_size, | |
| 4190 const void* cmd_data) { | |
| 4191 const gles2::cmds::MatrixLoadIdentityCHROMIUM& c = | |
| 4192 *static_cast<const gles2::cmds::MatrixLoadIdentityCHROMIUM*>(cmd_data); | |
| 4193 (void)c; | |
| 4194 GLenum matrixMode = static_cast<GLenum>(c.matrixMode); | |
| 4195 error::Error error = DoMatrixLoadIdentityCHROMIUM(matrixMode); | |
| 4196 if (error != error::kNoError) { | |
| 4197 return error; | |
| 4198 } | |
| 4199 return error::kNoError; | |
| 4200 } | |
| 4201 | |
| 4202 error::Error GLES2DecoderPassthroughImpl::HandleIsPathCHROMIUM( | |
| 4203 uint32_t immediate_data_size, | |
| 4204 const void* cmd_data) { | |
| 4205 const gles2::cmds::IsPathCHROMIUM& c = | |
| 4206 *static_cast<const gles2::cmds::IsPathCHROMIUM*>(cmd_data); | |
| 4207 (void)c; | |
| 4208 GLuint path = c.path; | |
| 4209 typedef cmds::IsPathCHROMIUM::Result Result; | |
| 4210 Result* result = GetSharedMemoryAs<Result*>( | |
| 4211 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | |
| 4212 if (!result) { | |
| 4213 return error::kOutOfBounds; | |
| 4214 } | |
| 4215 error::Error error = DoIsPathCHROMIUM(path, result); | |
| 4216 if (error != error::kNoError) { | |
| 4217 return error; | |
| 4218 } | |
| 4219 return error::kNoError; | |
| 4220 } | |
| 4221 | |
| 4222 error::Error GLES2DecoderPassthroughImpl::HandlePathStencilFuncCHROMIUM( | |
| 4223 uint32_t immediate_data_size, | |
| 4224 const void* cmd_data) { | |
| 4225 const gles2::cmds::PathStencilFuncCHROMIUM& c = | |
| 4226 *static_cast<const gles2::cmds::PathStencilFuncCHROMIUM*>(cmd_data); | |
| 4227 (void)c; | |
| 4228 GLenum func = static_cast<GLenum>(c.func); | |
| 4229 GLint ref = static_cast<GLint>(c.ref); | |
| 4230 GLuint mask = static_cast<GLuint>(c.mask); | |
| 4231 error::Error error = DoPathStencilFuncCHROMIUM(func, ref, mask); | |
| 4232 if (error != error::kNoError) { | |
| 4233 return error; | |
| 4234 } | |
| 4235 return error::kNoError; | |
| 4236 } | |
| 4237 | |
| 4238 error::Error GLES2DecoderPassthroughImpl::HandleCoverageModulationCHROMIUM( | |
| 4239 uint32_t immediate_data_size, | |
| 4240 const void* cmd_data) { | |
| 4241 const gles2::cmds::CoverageModulationCHROMIUM& c = | |
| 4242 *static_cast<const gles2::cmds::CoverageModulationCHROMIUM*>(cmd_data); | |
| 4243 (void)c; | |
| 4244 GLenum components = static_cast<GLenum>(c.components); | |
| 4245 error::Error error = DoCoverageModulationCHROMIUM(components); | |
| 4246 if (error != error::kNoError) { | |
| 4247 return error; | |
| 4248 } | |
| 4249 return error::kNoError; | |
| 4250 } | |
| 4251 | |
| 4252 error::Error GLES2DecoderPassthroughImpl::HandleBlendBarrierKHR( | |
| 4253 uint32_t immediate_data_size, | |
| 4254 const void* cmd_data) { | |
| 4255 const gles2::cmds::BlendBarrierKHR& c = | |
| 4256 *static_cast<const gles2::cmds::BlendBarrierKHR*>(cmd_data); | |
| 4257 (void)c; | |
| 4258 error::Error error = DoBlendBarrierKHR(); | |
| 4259 if (error != error::kNoError) { | |
| 4260 return error; | |
| 4261 } | |
| 4262 return error::kNoError; | |
| 4263 } | |
| 4264 | |
| 4265 error::Error | |
| 4266 GLES2DecoderPassthroughImpl::HandleApplyScreenSpaceAntialiasingCHROMIUM( | |
| 4267 uint32_t immediate_data_size, | |
| 4268 const void* cmd_data) { | |
| 4269 const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM& c = | |
| 4270 *static_cast<const gles2::cmds::ApplyScreenSpaceAntialiasingCHROMIUM*>( | |
| 4271 cmd_data); | |
| 4272 (void)c; | |
| 4273 error::Error error = DoApplyScreenSpaceAntialiasingCHROMIUM(); | |
| 4274 if (error != error::kNoError) { | |
| 4275 return error; | |
| 4276 } | |
| 4277 return error::kNoError; | |
| 4278 } | |
| 4279 | |
| 4280 error::Error GLES2DecoderPassthroughImpl:: | |
| 4281 HandleUniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate( | |
| 4282 uint32_t immediate_data_size, | |
| 4283 const void* cmd_data) { | |
| 4284 const gles2::cmds::UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate& c = | |
| 4285 *static_cast<const gles2::cmds:: | |
| 4286 UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate*>( | |
| 4287 cmd_data); | |
| 4288 (void)c; | |
| 4289 GLint location = static_cast<GLint>(c.location); | |
| 4290 GLboolean transpose = static_cast<GLboolean>(c.transpose); | |
| 4291 uint32_t data_size; | |
| 4292 if (!GLES2Util::ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { | |
| 4293 return error::kOutOfBounds; | |
| 4294 } | |
| 4295 if (data_size > immediate_data_size) { | |
| 4296 return error::kOutOfBounds; | |
| 4297 } | |
| 4298 const GLfloat* default_value = | |
| 4299 GetImmediateDataAs<const GLfloat*>(c, data_size, immediate_data_size); | |
| 4300 error::Error error = DoUniformMatrix4fvStreamTextureMatrixCHROMIUM( | |
| 4301 location, transpose, default_value); | |
| 4302 if (error != error::kNoError) { | |
| 4303 return error; | |
| 4304 } | |
| 4305 return error::kNoError; | |
| 4306 } | |
| 4307 | |
| 4308 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_HANDLERS_AUT OGEN_H_ | |
| OLD | NEW |