OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 5221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5232 // NOTE: 'buffer' is a pointer to the command buffer. As such, it could be | 5232 // NOTE: 'buffer' is a pointer to the command buffer. As such, it could be |
5233 // changed by a (malicious) client at any time, so if validation has to happen, | 5233 // changed by a (malicious) client at any time, so if validation has to happen, |
5234 // it should operate on a copy of them. | 5234 // it should operate on a copy of them. |
5235 // NOTE: This is duplicating code from AsyncAPIInterface::DoCommands() in the | 5235 // NOTE: This is duplicating code from AsyncAPIInterface::DoCommands() in the |
5236 // interest of performance in this critical execution loop. | 5236 // interest of performance in this critical execution loop. |
5237 template <bool DebugImpl> | 5237 template <bool DebugImpl> |
5238 error::Error GLES2DecoderImpl::DoCommandsImpl(unsigned int num_commands, | 5238 error::Error GLES2DecoderImpl::DoCommandsImpl(unsigned int num_commands, |
5239 const volatile void* buffer, | 5239 const volatile void* buffer, |
5240 int num_entries, | 5240 int num_entries, |
5241 int* entries_processed) { | 5241 int* entries_processed) { |
5242 DCHECK(context_->IsCurrent(surface_.get())); | |
5243 commands_to_process_ = num_commands; | 5242 commands_to_process_ = num_commands; |
5244 error::Error result = error::kNoError; | 5243 error::Error result = error::kNoError; |
5245 const volatile CommandBufferEntry* cmd_data = | 5244 const volatile CommandBufferEntry* cmd_data = |
5246 static_cast<const volatile CommandBufferEntry*>(buffer); | 5245 static_cast<const volatile CommandBufferEntry*>(buffer); |
5247 int process_pos = 0; | 5246 int process_pos = 0; |
5248 unsigned int command = 0; | 5247 unsigned int command = 0; |
5249 | 5248 |
5250 while (process_pos < num_entries && result == error::kNoError && | 5249 while (process_pos < num_entries && result == error::kNoError && |
5251 commands_to_process_--) { | 5250 commands_to_process_--) { |
5252 const unsigned int size = cmd_data->value_header.size; | 5251 const unsigned int size = cmd_data->value_header.size; |
(...skipping 14384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19637 } | 19636 } |
19638 | 19637 |
19639 // Include the auto-generated part of this file. We split this because it means | 19638 // Include the auto-generated part of this file. We split this because it means |
19640 // we can easily edit the non-auto generated parts right here in this file | 19639 // we can easily edit the non-auto generated parts right here in this file |
19641 // instead of having to edit some template or the code generator. | 19640 // instead of having to edit some template or the code generator. |
19642 #include "base/macros.h" | 19641 #include "base/macros.h" |
19643 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19642 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19644 | 19643 |
19645 } // namespace gles2 | 19644 } // namespace gles2 |
19646 } // namespace gpu | 19645 } // namespace gpu |
OLD | NEW |