| 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 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) | 10 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) |
| 11 : commands_to_process_(0), | 11 : commands_to_process_(0), |
| 12 debug_marker_manager_(), | 12 debug_marker_manager_(), |
| 13 logger_(&debug_marker_manager_), | 13 logger_(&debug_marker_manager_), |
| 14 surface_(), | 14 surface_(), |
| 15 context_(), | 15 context_(), |
| 16 group_(group), | 16 group_(group), |
| 17 feature_info_(group->feature_info()) { | 17 feature_info_(group->feature_info()) { |
| 18 DCHECK(group); | 18 DCHECK(group); |
| 19 } | 19 } |
| 20 | 20 |
| 21 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} | 21 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} |
| 22 | 22 |
| 23 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( | 23 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( |
| 24 unsigned int num_commands, | 24 unsigned int num_commands, |
| 25 const void* buffer, | 25 const volatile void* buffer, |
| 26 int num_entries, | 26 int num_entries, |
| 27 int* entries_processed) { | 27 int* entries_processed) { |
| 28 commands_to_process_ = num_commands; | 28 commands_to_process_ = num_commands; |
| 29 error::Error result = error::kNoError; | 29 error::Error result = error::kNoError; |
| 30 const CommandBufferEntry* cmd_data = | 30 const volatile CommandBufferEntry* cmd_data = |
| 31 static_cast<const CommandBufferEntry*>(buffer); | 31 static_cast<const volatile CommandBufferEntry*>(buffer); |
| 32 int process_pos = 0; | 32 int process_pos = 0; |
| 33 unsigned int command = 0; | 33 unsigned int command = 0; |
| 34 | 34 |
| 35 while (process_pos < num_entries && result == error::kNoError && | 35 while (process_pos < num_entries && result == error::kNoError && |
| 36 commands_to_process_--) { | 36 commands_to_process_--) { |
| 37 const unsigned int size = cmd_data->value_header.size; | 37 const unsigned int size = cmd_data->value_header.size; |
| 38 command = cmd_data->value_header.command; | 38 command = cmd_data->value_header.command; |
| 39 | 39 |
| 40 if (size == 0) { | 40 if (size == 0) { |
| 41 result = error::kInvalidSize; | 41 result = error::kInvalidSize; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 }, /* NOLINT */ | 382 }, /* NOLINT */ |
| 383 | 383 |
| 384 const GLES2DecoderPassthroughImpl::CommandInfo | 384 const GLES2DecoderPassthroughImpl::CommandInfo |
| 385 GLES2DecoderPassthroughImpl::command_info[] = { | 385 GLES2DecoderPassthroughImpl::command_info[] = { |
| 386 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; | 386 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; |
| 387 | 387 |
| 388 #undef GLES2_CMD_OP | 388 #undef GLES2_CMD_OP |
| 389 | 389 |
| 390 } // namespace gles2 | 390 } // namespace gles2 |
| 391 } // namespace gpu | 391 } // namespace gpu |
| OLD | NEW |