OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" |
6 | 6 |
7 namespace gpu { | 7 namespace gpu { |
8 namespace gles2 { | 8 namespace gles2 { |
9 | 9 |
10 // Custom Handlers | 10 // Custom Handlers |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 error::Error GLES2DecoderPassthroughImpl::HandleGenMailboxCHROMIUM( | 1514 error::Error GLES2DecoderPassthroughImpl::HandleGenMailboxCHROMIUM( |
1515 uint32_t immediate_data_size, | 1515 uint32_t immediate_data_size, |
1516 const void* cmd_data) { | 1516 const void* cmd_data) { |
1517 const gles2::cmds::GenMailboxCHROMIUM& c = | 1517 const gles2::cmds::GenMailboxCHROMIUM& c = |
1518 *static_cast<const gles2::cmds::GenMailboxCHROMIUM*>(cmd_data); | 1518 *static_cast<const gles2::cmds::GenMailboxCHROMIUM*>(cmd_data); |
1519 (void)c; | 1519 (void)c; |
1520 return error::kUnknownCommand; | 1520 return error::kUnknownCommand; |
1521 } | 1521 } |
1522 | 1522 |
1523 error::Error | 1523 error::Error |
1524 GLES2DecoderPassthroughImpl::HandleCreateAndConsumeTextureCHROMIUMImmediate( | |
1525 uint32_t immediate_data_size, | |
1526 const void* cmd_data) { | |
1527 const gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate& c = *static_cast< | |
1528 const gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate*>(cmd_data); | |
1529 GLenum target = static_cast<GLenum>(c.target); | |
1530 uint32_t data_size; | |
1531 if (!GLES2Util::ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | |
1532 return error::kOutOfBounds; | |
1533 } | |
1534 if (data_size > immediate_data_size) { | |
1535 return error::kOutOfBounds; | |
1536 } | |
1537 const GLbyte* mailbox = | |
1538 GetImmediateDataAs<const GLbyte*>(c, data_size, immediate_data_size); | |
1539 if (mailbox == NULL) { | |
1540 return error::kOutOfBounds; | |
1541 } | |
1542 uint32_t client_id = c.client_id; | |
1543 error::Error error = | |
1544 DoCreateAndConsumeTextureCHROMIUM(target, mailbox, client_id); | |
1545 if (error != error::kNoError) { | |
1546 return error; | |
1547 } | |
1548 | |
1549 return error::kNoError; | |
1550 } | |
1551 | |
1552 error::Error | |
1553 GLES2DecoderPassthroughImpl::HandleBindUniformLocationCHROMIUMBucket( | 1524 GLES2DecoderPassthroughImpl::HandleBindUniformLocationCHROMIUMBucket( |
1554 uint32_t immediate_data_size, | 1525 uint32_t immediate_data_size, |
1555 const void* cmd_data) { | 1526 const void* cmd_data) { |
1556 const gles2::cmds::BindUniformLocationCHROMIUMBucket& c = | 1527 const gles2::cmds::BindUniformLocationCHROMIUMBucket& c = |
1557 *static_cast<const gles2::cmds::BindUniformLocationCHROMIUMBucket*>( | 1528 *static_cast<const gles2::cmds::BindUniformLocationCHROMIUMBucket*>( |
1558 cmd_data); | 1529 cmd_data); |
1559 GLuint program = static_cast<GLuint>(c.program); | 1530 GLuint program = static_cast<GLuint>(c.program); |
1560 GLint location = static_cast<GLint>(c.location); | 1531 GLint location = static_cast<GLint>(c.location); |
1561 Bucket* bucket = GetBucket(c.name_bucket_id); | 1532 Bucket* bucket = GetBucket(c.name_bucket_id); |
1562 if (!bucket || bucket->size() == 0) { | 1533 if (!bucket || bucket->size() == 0) { |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2415 } | 2386 } |
2416 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index); | 2387 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index); |
2417 if (error != error::kNoError) { | 2388 if (error != error::kNoError) { |
2418 return error; | 2389 return error; |
2419 } | 2390 } |
2420 return error::kNoError; | 2391 return error::kNoError; |
2421 } | 2392 } |
2422 | 2393 |
2423 } // namespace gles2 | 2394 } // namespace gles2 |
2424 } // namespace gpu | 2395 } // namespace gpu |
OLD | NEW |