Chromium Code Reviews| 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/command_executor.h" | 5 #include "gpu/command_buffer/service/command_executor.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 if (decoder_) | 53 if (decoder_) |
| 54 decoder_->BeginDecoding(); | 54 decoder_->BeginDecoding(); |
| 55 while (!parser_->IsEmpty()) { | 55 while (!parser_->IsEmpty()) { |
| 56 if (IsPreempted()) | 56 if (IsPreempted()) |
| 57 break; | 57 break; |
| 58 | 58 |
| 59 DCHECK(scheduled()); | 59 DCHECK(scheduled()); |
| 60 | 60 |
| 61 error = parser_->ProcessCommands(CommandParser::kParseCommandsSlice); | 61 error = parser_->ProcessCommands(CommandParser::kParseCommandsSlice); |
| 62 | 62 |
| 63 if (error == error::kDeferCommandUntilLater) { | 63 if (error == error::kDeferCommandUntilLater || |
| 64 error == error::kDeferLaterCommands) { | |
|
piman
2016/05/31 22:39:21
I think we want to update the Get offset (since we
erikchen
2016/05/31 22:52:01
Good point. Done.
| |
| 64 DCHECK(!scheduled()); | 65 DCHECK(!scheduled()); |
| 65 break; | 66 break; |
| 66 } | 67 } |
| 67 | 68 |
| 68 // TODO(piman): various classes duplicate various pieces of state, leading | 69 // TODO(piman): various classes duplicate various pieces of state, leading |
| 69 // to needlessly complex update logic. It should be possible to simply | 70 // to needlessly complex update logic. It should be possible to simply |
| 70 // share the state across all of them. | 71 // share the state across all of them. |
| 71 command_buffer_->SetGetOffset(static_cast<int32_t>(parser_->get())); | 72 command_buffer_->SetGetOffset(static_cast<int32_t>(parser_->get())); |
| 72 | 73 |
| 73 if (error::IsError(error)) { | 74 if (error::IsError(error)) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 return (decoder_ && decoder_->HasMoreIdleWork()); | 172 return (decoder_ && decoder_->HasMoreIdleWork()); |
| 172 } | 173 } |
| 173 | 174 |
| 174 void CommandExecutor::PerformIdleWork() { | 175 void CommandExecutor::PerformIdleWork() { |
| 175 if (!decoder_) | 176 if (!decoder_) |
| 176 return; | 177 return; |
| 177 decoder_->PerformIdleWork(); | 178 decoder_->PerformIdleWork(); |
| 178 } | 179 } |
| 179 | 180 |
| 180 } // namespace gpu | 181 } // namespace gpu |
| OLD | NEW |