Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper.cc

Issue 6316002: Make CommandBuffer::Flush asynchronous, and add CommandBuffer::FlushSync with former semantics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
}

Powered by Google App Engine
This is Rietveld 408576698