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

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

Issue 1854953002: Plumb GpuSwapBuffers completion from Mus GPU thread to WS thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review nits Created 4 years, 9 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: 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 d4b2b03531ef010ca7658ec0a6d47da0d07b3ccb..719ffddf7a7fdd1e5f059eb93c536864b460066a 100644
--- a/components/mus/gles2/command_buffer_local.cc
+++ b/components/mus/gles2/command_buffer_local.cc
@@ -406,6 +406,15 @@ void CommandBufferLocal::UpdateVSyncParameters(int64_t timebase,
}
}
+void CommandBufferLocal::OnGpuCompletedSwapBuffers(gfx::SwapResult result) {
+ if (client_) {
+ client_thread_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&CommandBufferLocal::OnGpuCompletedSwapBuffersOnClientThread,
+ weak_ptr_, result));
+ }
+}
+
CommandBufferLocal::~CommandBufferLocal() {}
void CommandBufferLocal::TryUpdateState() {
@@ -433,6 +442,7 @@ void CommandBufferLocal::InitializeOnGpuThread(base::WaitableEvent* event,
gpu::CommandBufferNamespace::MOJO_LOCAL,
gpu::CommandBufferId::FromUnsafeValue(++g_next_command_buffer_id),
widget_, gpu_state_));
+ driver_->set_client(this);
const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState);
void* memory = nullptr;
mojo::ScopedSharedBufferHandle duped;
@@ -541,4 +551,10 @@ void CommandBufferLocal::UpdateVSyncParametersOnClientThread(int64_t timebase,
client_->UpdateVSyncParameters(timebase, interval);
}
+void CommandBufferLocal::OnGpuCompletedSwapBuffersOnClientThread(
+ gfx::SwapResult result) {
+ if (client_)
+ client_->GpuCompletedSwapBuffers(result);
+}
+
} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698