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

Unified Diff: gpu/ipc/in_process_command_buffer.cc

Issue 2771053003: WIP: Plumbing input event latency reporting through Mus GPU.
Patch Set: Updating dependencies. Created 3 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: 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 1934450bc4db1a16399aed3432636b3c2c0b475b..028833c5e2252cb6a202c96618b595703f4db6af 100644
--- a/gpu/ipc/in_process_command_buffer.cc
+++ b/gpu/ipc/in_process_command_buffer.cc
@@ -284,6 +284,10 @@ bool InProcessCommandBuffer::Initialize(
return result;
}
+void InProcessCommandBuffer::SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info) {
+ latency_info_.insert(latency_info_.end(), latency_info.begin(), latency_info.end());
+}
+
bool InProcessCommandBuffer::InitializeOnGpuThread(
const InitializeOnGpuThreadParams& params) {
CheckSequencedThread();
@@ -555,6 +559,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();
@@ -1014,7 +1025,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,

Powered by Google App Engine
This is Rietveld 408576698