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

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

Issue 1610783002: mustash: gpu: implement SignalQuery in CommandBufferLocal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run SignalQuery's callback on the client thread. Created 4 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
« no previous file with comments | « components/mus/gles2/command_buffer_local.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gles2/command_buffer_local.cc
diff --git a/components/mus/gles2/command_buffer_local.cc b/components/mus/gles2/command_buffer_local.cc
index 0615e7643bc5c67deafa62cb3cc5a28eee178840..9d2deab8c8e17c06e1a514e7ce39236e420cfa3d 100644
--- a/components/mus/gles2/command_buffer_local.cc
+++ b/components/mus/gles2/command_buffer_local.cc
@@ -62,6 +62,10 @@ bool CreateMapAndDupSharedBuffer(size_t size,
return true;
}
+void PostTask(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+ const base::Closure& callback) {
+ task_runner->PostTask(FROM_HERE, callback);
+}
}
const unsigned int GL_READ_WRITE_CHROMIUM = 0x78F2;
@@ -308,11 +312,13 @@ void CommandBufferLocal::SignalSyncPoint(uint32_t sync_point,
NOTREACHED();
}
-void CommandBufferLocal::SignalQuery(uint32_t query,
+void CommandBufferLocal::SignalQuery(uint32_t query_id,
const base::Closure& callback) {
DCHECK(CalledOnValidThread());
- // TODO(piman)
- NOTIMPLEMENTED();
+
+ gpu_state_->command_buffer_task_runner()->PostTask(
+ driver_.get(), base::Bind(&CommandBufferLocal::SignalQueryOnGpuThread,
+ base::Unretained(this), query_id, callback));
}
void CommandBufferLocal::SetLock(base::Lock* lock) {
@@ -524,6 +530,14 @@ bool CommandBufferLocal::DeleteOnGpuThread() {
return true;
}
+bool CommandBufferLocal::SignalQueryOnGpuThread(uint32_t query_id,
+ const base::Closure& callback) {
+ // |callback| should run on the client thread.
+ driver_->SignalQuery(
+ query_id, base::Bind(&PostTask, client_thread_task_runner_, callback));
+ return true;
+}
+
void CommandBufferLocal::DidLoseContextOnClientThread(uint32_t reason) {
if (client_)
client_->DidLoseContext();
« no previous file with comments | « components/mus/gles2/command_buffer_local.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698