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

Unified Diff: gpu/ipc/in_process_command_buffer.cc

Issue 2771053003: WIP: Plumbing input event latency reporting through Mus GPU.
Patch Set: NON_EXPORTED_BASE Created 3 years, 8 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 | « gpu/ipc/in_process_command_buffer.h ('k') | gpu/ipc/service/pass_through_image_transport_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « gpu/ipc/in_process_command_buffer.h ('k') | gpu/ipc/service/pass_through_image_transport_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698