| Index: gpu/command_buffer/client/cmd_buffer_helper.cc
|
| diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
|
| index b666e83dc5dc18134cbe8acfdd677ae5fdde7df6..b714622313e50bc0b3138b95e9153c8ea84d7c0b 100644
|
| --- a/gpu/command_buffer/client/cmd_buffer_helper.cc
|
| +++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
|
| @@ -45,19 +45,23 @@ bool CommandBufferHelper::Initialize(int32 ring_buffer_size) {
|
| CommandBufferHelper::~CommandBufferHelper() {
|
| }
|
|
|
| -bool CommandBufferHelper::Flush() {
|
| - CommandBuffer::State state = command_buffer_->Flush(put_);
|
| +bool CommandBufferHelper::FlushSync() {
|
| + CommandBuffer::State state = command_buffer_->FlushSync(put_);
|
| SynchronizeState(state);
|
| return state.error == error::kNoError;
|
| }
|
|
|
| +void CommandBufferHelper::Flush() {
|
| + command_buffer_->Flush(put_);
|
| +}
|
| +
|
| // Calls Flush() and then waits until the buffer is empty. Break early if the
|
| // error is set.
|
| bool CommandBufferHelper::Finish() {
|
| do {
|
| // Do not loop forever if the flush fails, meaning the command buffer reader
|
| // has shutdown.
|
| - if (!Flush())
|
| + if (!FlushSync())
|
| return false;
|
| } while (put_ != get_);
|
|
|
| @@ -98,7 +102,7 @@ void CommandBufferHelper::WaitForToken(int32 token) {
|
| }
|
| // Do not loop forever if the flush fails, meaning the command buffer reader
|
| // has shutdown.
|
| - if (!Flush())
|
| + if (!FlushSync())
|
| return;
|
| }
|
| }
|
| @@ -120,7 +124,7 @@ void CommandBufferHelper::WaitForAvailableEntries(int32 count) {
|
| while (get_ > put_ || get_ == 0) {
|
| // Do not loop forever if the flush fails, meaning the command buffer
|
| // reader has shutdown.
|
| - if (!Flush())
|
| + if (!FlushSync())
|
| return;
|
| }
|
| // Insert a jump back to the beginning.
|
| @@ -134,7 +138,7 @@ void CommandBufferHelper::WaitForAvailableEntries(int32 count) {
|
| while (AvailableEntries() < count) {
|
| // Do not loop forever if the flush fails, meaning the command buffer reader
|
| // has shutdown.
|
| - if (!Flush())
|
| + if (!FlushSync())
|
| return;
|
| }
|
| }
|
|
|