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

Unified Diff: services/ui/surfaces/display_output_surface.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 | « services/ui/surfaces/display_output_surface.h ('k') | ui/latency/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/display_output_surface.cc
diff --git a/services/ui/surfaces/display_output_surface.cc b/services/ui/surfaces/display_output_surface.cc
index 85ece68dd7dfaa9e5d9c8c295e188d26eab6ab94..44ba93cf1b8405eedb605cefeeee1bf246d5cd74 100644
--- a/services/ui/surfaces/display_output_surface.cc
+++ b/services/ui/surfaces/display_output_surface.cc
@@ -15,6 +15,7 @@
#include "cc/scheduler/begin_frame_source.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "ui/latency/latency_tracker.h"
namespace ui {
@@ -23,6 +24,7 @@ DisplayOutputSurface::DisplayOutputSurface(
cc::SyntheticBeginFrameSource* synthetic_begin_frame_source)
: cc::OutputSurface(context_provider),
synthetic_begin_frame_source_(synthetic_begin_frame_source),
+ latency_tracker_(new LatencyTracker),
weak_ptr_factory_(this) {
capabilities_.flipped_output_surface =
context_provider->ContextCapabilities().flips_vertically;
@@ -79,12 +81,16 @@ void DisplayOutputSurface::Reshape(const gfx::Size& size,
void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) {
DCHECK(context_provider_);
+
+ if (frame.latency_info.size() > 0)
+ context_provider_->ContextSupport()->AddLatencyInfo(frame.latency_info);
+
set_draw_rectangle_for_frame_ = false;
if (frame.sub_buffer_rect) {
context_provider_->ContextSupport()->PartialSwapBuffers(
*frame.sub_buffer_rect);
} else {
- context_provider_->ContextSupport()->Swap();
+ context_provider_->ContextSupport()->Swap(/*frame.latency_info*/);
}
}
@@ -123,9 +129,13 @@ void DisplayOutputSurface::DidReceiveSwapBuffersAck(gfx::SwapResult result) {
}
void DisplayOutputSurface::OnGpuSwapBuffersCompleted(
- const std::vector<ui::LatencyInfo>& latency_info,
+ const std::vector<LatencyInfo>& latency_info,
gfx::SwapResult result,
const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) {
+ for (const auto& latency : latency_info) {
+ if (latency.latency_components().size() > 0)
+ latency_tracker_->OnGpuSwapBuffersCompleted(latency);
+ }
DidReceiveSwapBuffersAck(result);
}
« no previous file with comments | « services/ui/surfaces/display_output_surface.h ('k') | ui/latency/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698