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

Side by Side Diff: services/ui/surfaces/display_output_surface.cc

Issue 2806163004: Plumbing input event latency reporting through Mus GPU. (Closed)
Patch Set: Inline LatencyTracker in DIsplayOutputService. 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/surfaces/display_output_surface.h" 5 #include "services/ui/surfaces/display_output_surface.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 bool has_alpha, 72 bool has_alpha,
73 bool use_stencil) { 73 bool use_stencil) {
74 size_ = size; 74 size_ = size;
75 has_set_draw_rectangle_since_last_resize_ = false; 75 has_set_draw_rectangle_since_last_resize_ = false;
76 context_provider()->ContextGL()->ResizeCHROMIUM( 76 context_provider()->ContextGL()->ResizeCHROMIUM(
77 size.width(), size.height(), device_scale_factor, has_alpha); 77 size.width(), size.height(), device_scale_factor, has_alpha);
78 } 78 }
79 79
80 void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) { 80 void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) {
81 DCHECK(context_provider_); 81 DCHECK(context_provider_);
82
83 if (frame.latency_info.size() > 0)
84 context_provider_->ContextSupport()->AddLatencyInfo(frame.latency_info);
85
82 set_draw_rectangle_for_frame_ = false; 86 set_draw_rectangle_for_frame_ = false;
83 if (frame.sub_buffer_rect) { 87 if (frame.sub_buffer_rect) {
84 context_provider_->ContextSupport()->PartialSwapBuffers( 88 context_provider_->ContextSupport()->PartialSwapBuffers(
85 *frame.sub_buffer_rect); 89 *frame.sub_buffer_rect);
86 } else { 90 } else {
87 context_provider_->ContextSupport()->Swap(); 91 context_provider_->ContextSupport()->Swap();
88 } 92 }
89 } 93 }
90 94
91 uint32_t DisplayOutputSurface::GetFramebufferCopyTextureFormat() { 95 uint32_t DisplayOutputSurface::GetFramebufferCopyTextureFormat() {
(...skipping 24 matching lines...) Expand all
116 return false; 120 return false;
117 } 121 }
118 122
119 void DisplayOutputSurface::ApplyExternalStencil() {} 123 void DisplayOutputSurface::ApplyExternalStencil() {}
120 124
121 void DisplayOutputSurface::DidReceiveSwapBuffersAck(gfx::SwapResult result) { 125 void DisplayOutputSurface::DidReceiveSwapBuffersAck(gfx::SwapResult result) {
122 client_->DidReceiveSwapBuffersAck(); 126 client_->DidReceiveSwapBuffersAck();
123 } 127 }
124 128
125 void DisplayOutputSurface::OnGpuSwapBuffersCompleted( 129 void DisplayOutputSurface::OnGpuSwapBuffersCompleted(
126 const std::vector<ui::LatencyInfo>& latency_info, 130 const std::vector<LatencyInfo>& latency_info,
127 gfx::SwapResult result, 131 gfx::SwapResult result,
128 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { 132 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) {
133 for (const auto& latency : latency_info) {
134 if (latency.latency_components().size() > 0)
135 latency_tracker_.OnGpuSwapBuffersCompleted(latency);
136 }
129 DidReceiveSwapBuffersAck(result); 137 DidReceiveSwapBuffersAck(result);
130 } 138 }
131 139
132 void DisplayOutputSurface::OnVSyncParametersUpdated(base::TimeTicks timebase, 140 void DisplayOutputSurface::OnVSyncParametersUpdated(base::TimeTicks timebase,
133 base::TimeDelta interval) { 141 base::TimeDelta interval) {
134 // TODO(brianderson): We should not be receiving 0 intervals. 142 // TODO(brianderson): We should not be receiving 0 intervals.
135 synthetic_begin_frame_source_->OnUpdateVSyncParameters( 143 synthetic_begin_frame_source_->OnUpdateVSyncParameters(
136 timebase, 144 timebase,
137 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); 145 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval);
138 } 146 }
139 147
140 } // namespace ui 148 } // namespace ui
OLDNEW
« 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