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 // This file contains the implementation of the command buffer helper class. | 5 // This file contains the implementation of the command buffer helper class. |
| 6 | 6 |
| 7 #include "../client/cmd_buffer_helper.h" | 7 #include "../client/cmd_buffer_helper.h" |
| 8 #include "../common/command_buffer.h" | 8 #include "../common/command_buffer.h" |
| 9 #include "../common/trace_event.h" | 9 #include "../common/trace_event.h" |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 Finish(); | 170 Finish(); |
| 171 GPU_DCHECK_EQ(token_, last_token_read()); | 171 GPU_DCHECK_EQ(token_, last_token_read()); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 return token_; | 174 return token_; |
| 175 } | 175 } |
| 176 | 176 |
| 177 // Waits until the current token value is greater or equal to the value passed | 177 // Waits until the current token value is greater or equal to the value passed |
| 178 // in argument. | 178 // in argument. |
| 179 void CommandBufferHelper::WaitForToken(int32 token) { | 179 void CommandBufferHelper::WaitForToken(int32 token) { |
| 180 TRACE_EVENT_IF_LONGER_THAN0(50, "gpu", "CommandBufferHelper::WaitForToken"); | 180 TRACE_EVENT0("gpu", "CommandBufferHelper::WaitForToken"); |
|
nduca
2012/12/12 09:31:16
Lets just take this trace out completely.
| |
| 181 if (!usable()) { | 181 if (!usable()) { |
| 182 return; | 182 return; |
| 183 } | 183 } |
| 184 GPU_DCHECK(HaveRingBuffer()); | 184 GPU_DCHECK(HaveRingBuffer()); |
| 185 // Return immediately if corresponding InsertToken failed. | 185 // Return immediately if corresponding InsertToken failed. |
| 186 if (token < 0) | 186 if (token < 0) |
| 187 return; | 187 return; |
| 188 if (token > token_) return; // we wrapped | 188 if (token > token_) return; // we wrapped |
| 189 while (last_token_read() < token) { | 189 while (last_token_read() < token) { |
| 190 if (get_offset() == put_) { | 190 if (get_offset() == put_) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 } | 277 } |
| 278 return space; | 278 return space; |
| 279 } | 279 } |
| 280 | 280 |
| 281 error::Error CommandBufferHelper::GetError() { | 281 error::Error CommandBufferHelper::GetError() { |
| 282 CommandBuffer::State state = command_buffer_->GetState(); | 282 CommandBuffer::State state = command_buffer_->GetState(); |
| 283 return static_cast<error::Error>(state.error); | 283 return static_cast<error::Error>(state.error); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace gpu | 286 } // namespace gpu |
| OLD | NEW |