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

Unified Diff: mojo/services/gles2/command_buffer_impl.cc

Issue 745043002: Implement future sync points in gpu service (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 | « mojo/services/gles2/command_buffer_impl.h ('k') | mojo/services/public/interfaces/gpu/command_buffer.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/gles2/command_buffer_impl.cc
diff --git a/mojo/services/gles2/command_buffer_impl.cc b/mojo/services/gles2/command_buffer_impl.cc
index 78d52dde352c77d1ff9602b4852af86bebd0b113..141d04bb4f72c14ee650145cd6ba9b0f3a0cc508 100644
--- a/mojo/services/gles2/command_buffer_impl.cc
+++ b/mojo/services/gles2/command_buffer_impl.cc
@@ -18,11 +18,6 @@ void DestroyDriver(scoped_ptr<CommandBufferDriver> driver) {
void RunCallback(const Callback<void()>& callback) {
callback.Run();
}
-
-void RetireSyncPoint(scoped_refptr<gpu::SyncPointManager> sync_point_manager,
- uint32_t sync_point) {
- sync_point_manager->RetireSyncPoint(sync_point);
-}
}
CommandBufferImpl::CommandBufferImpl(
@@ -96,11 +91,20 @@ void CommandBufferImpl::DestroyTransferBuffer(int32_t id) {
base::Unretained(driver_.get()), id));
}
-void CommandBufferImpl::InsertSyncPoint() {
+void CommandBufferImpl::InsertSyncPoint(bool retire) {
uint32_t sync_point = sync_point_manager_->GenerateSyncPoint();
sync_point_client_->DidInsertSyncPoint(sync_point);
+ if (retire) {
+ driver_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint,
+ sync_point_manager_, sync_point));
+ }
+}
+
+void CommandBufferImpl::RetireSyncPoint(uint32_t sync_point) {
driver_task_runner_->PostTask(
- FROM_HERE, base::Bind(&RetireSyncPoint, sync_point_manager_, sync_point));
+ FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint,
+ sync_point_manager_, sync_point));
}
void CommandBufferImpl::Echo(const Callback<void()>& callback) {
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.h ('k') | mojo/services/public/interfaces/gpu/command_buffer.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698