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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 628703005: Remove GpuHostMsg_FrameDrawn and replace with client channel swap ack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, fix cros/threaded Created 6 years, 2 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 | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index a0f67b3dedb55955c6cbb71f0bea71a06cc660b0..f25120c80d99422bbeb01073ae72e21efa3f7e02 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -47,6 +47,8 @@ bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) {
OnSetMemoryAllocation);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncPointAck,
OnSignalSyncPointAck);
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SwapBuffersCompleted,
+ OnSwapBuffersCompleted);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -192,6 +194,11 @@ void CommandBufferProxyImpl::SetLatencyInfo(
latency_info_.push_back(latency_info[i]);
}
+void CommandBufferProxyImpl::SetSwapBuffersCompletionCallback(
+ const SwapBuffersCompletionCallback& callback) {
+ swap_buffers_completion_callback_ = callback;
+}
+
void CommandBufferProxyImpl::WaitForTokenInRange(int32 start, int32 end) {
TRACE_EVENT2("gpu",
"CommandBufferProxyImpl::WaitForToken",
@@ -504,4 +511,16 @@ gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const {
shared_state_shm_->memory());
}
+void CommandBufferProxyImpl::OnSwapBuffersCompleted(
+ const std::vector<ui::LatencyInfo>& latency_info) {
+ if (!swap_buffers_completion_callback_.is_null()) {
+ if (!ui::LatencyInfo::Verify(
+ latency_info, "CommandBufferProxyImpl::OnSwapBuffersCompleted")) {
+ swap_buffers_completion_callback_.Run(std::vector<ui::LatencyInfo>());
+ return;
+ }
+ swap_buffers_completion_callback_.Run(latency_info);
+ }
+}
+
} // namespace content
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698