Index: gpu/ipc/in_process_command_buffer.cc |
diff --git a/gpu/ipc/in_process_command_buffer.cc b/gpu/ipc/in_process_command_buffer.cc |
index fe7d2fa998ce6b274f30795f76109fc6bf514f92..3e4673bb6dfd646794e352e0e0f52a382de82198 100644 |
--- a/gpu/ipc/in_process_command_buffer.cc |
+++ b/gpu/ipc/in_process_command_buffer.cc |
@@ -558,6 +558,13 @@ void InProcessCommandBuffer::FlushOnGpuThread(int32_t put_offset) { |
ScopedEvent handle_flush(&flush_event_); |
base::AutoLock lock(command_buffer_lock_); |
+ if (ui::LatencyInfo::Verify(latency_info_, |
+ "InProcessCommandBuffer::FlushOnGpuThread") && |
+ !latency_info_callback_.is_null()) { |
+ latency_info_callback_.Run(latency_info_); |
+ } |
+ latency_info_.clear(); |
+ |
command_buffer_->Flush(put_offset); |
// Update state before signaling the flush event. |
UpdateLastStateOnGpuThread(); |
@@ -991,6 +998,12 @@ bool InProcessCommandBuffer::CanWaitUnverifiedSyncToken( |
return sync_token.namespace_id() == GetNamespaceID(); |
} |
+void InProcessCommandBuffer::AddLatencyInfo( |
+ const std::vector<ui::LatencyInfo>& latency_info) { |
+ latency_info_.insert(latency_info_.end(), latency_info.begin(), |
+ latency_info.end()); |
+} |
+ |
#if defined(OS_WIN) |
void InProcessCommandBuffer::DidCreateAcceleratedSurfaceChildWindow( |
SurfaceHandle parent_window, |
@@ -1017,7 +1030,7 @@ const gles2::FeatureInfo* InProcessCommandBuffer::GetFeatureInfo() const { |
void InProcessCommandBuffer::SetLatencyInfoCallback( |
const LatencyInfoCallback& callback) { |
- // TODO(fsamuel): Implement this. |
+ latency_info_callback_ = callback; |
} |
void InProcessCommandBuffer::UpdateVSyncParameters(base::TimeTicks timebase, |