Chromium Code Reviews| Index: gpu/command_buffer/client/ring_buffer.cc |
| diff --git a/gpu/command_buffer/client/ring_buffer.cc b/gpu/command_buffer/client/ring_buffer.cc |
| index ebbb1182aed5f175f8391de22e79118cdf6f4b71..118dc57276e5d79d4810c8bcdb34561da70bb2fd 100644 |
| --- a/gpu/command_buffer/client/ring_buffer.cc |
| +++ b/gpu/command_buffer/client/ring_buffer.cc |
| @@ -146,10 +146,9 @@ void RingBuffer::DiscardBlock(void* pointer) { |
| } |
| unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() { |
| - unsigned int last_token_read = helper_->last_token_read(); |
| while (!blocks_.empty()) { |
| Block& block = blocks_.front(); |
| - if (block.token > last_token_read || block.state == IN_USE) break; |
| + if (!helper_->HasTokenPassed(block.token) || block.state == IN_USE) break; |
|
piman
2016/12/07 20:30:12
So, this would call GetLastState(), take the lock
sunnyps
2016/12/08 01:14:16
I made HasTokenPassed faster by using the cached t
|
| FreeOldestBlock(); |
| } |
| if (free_offset_ == in_use_offset_) { |