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

Unified Diff: components/mus/gles2/command_buffer_impl.cc

Issue 1460833002: gpu: Implement the new fence syncs in mojo command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 years, 1 month 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
« no previous file with comments | « components/mus/gles2/command_buffer_impl.h ('k') | components/mus/gles2/command_buffer_local.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gles2/command_buffer_impl.cc
diff --git a/components/mus/gles2/command_buffer_impl.cc b/components/mus/gles2/command_buffer_impl.cc
index 94189431891df9d0e92cde100e8f7dd74ab2b9ff..fb642444997d75886f9e50f34b947433f7328ede 100644
--- a/components/mus/gles2/command_buffer_impl.cc
+++ b/components/mus/gles2/command_buffer_impl.cc
@@ -84,10 +84,13 @@ void CommandBufferImpl::SetGetBuffer(int32_t buffer) {
}
void CommandBufferImpl::Flush(int32_t put_offset) {
+ gpu::SyncPointManager* sync_point_manager = gpu_state_->sync_point_manager();
+ const uint32_t order_num = driver_->sync_point_order_data()
+ ->GenerateUnprocessedOrderNumber(sync_point_manager);
gpu_state_->command_buffer_task_runner()->PostTask(
driver_.get(),
base::Bind(&CommandBufferImpl::FlushHelper,
- base::Unretained(this), put_offset));
+ base::Unretained(this), put_offset, order_num));
}
void CommandBufferImpl::MakeProgress(int32_t last_get_offset) {
@@ -191,13 +194,18 @@ bool CommandBufferImpl::SetGetBufferHelper(int32_t buffer) {
return true;
}
-bool CommandBufferImpl::FlushHelper(int32_t put_offset) {
+bool CommandBufferImpl::FlushHelper(int32_t put_offset,
+ uint32_t order_num) {
DCHECK(driver_->IsScheduled());
+ driver_->sync_point_order_data()->BeginProcessingOrderNumber(order_num);
driver_->Flush(put_offset);
// Return false if the Flush is not finished, so the CommandBufferTaskRunner
// will not remove this task from the task queue.
- return !driver_->HasUnprocessedCommands();
+ const bool complete = !driver_->HasUnprocessedCommands();
+ if (complete)
+ driver_->sync_point_order_data()->FinishProcessingOrderNumber(order_num);
+ return complete;
}
bool CommandBufferImpl::MakeProgressHelper(int32_t last_get_offset) {
« no previous file with comments | « components/mus/gles2/command_buffer_impl.h ('k') | components/mus/gles2/command_buffer_local.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698