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

Side by Side Diff: cc/surfaces/surface_factory.cc

Issue 2863503002: Do not log Display Compositor latency component twice. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | content/browser/renderer_host/input/render_widget_host_latency_tracker.cc » ('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 "cc/surfaces/surface_factory.h" 5 #include "cc/surfaces/surface_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 void SurfaceFactory::SubmitCompositorFrame( 46 void SurfaceFactory::SubmitCompositorFrame(
47 const LocalSurfaceId& local_surface_id, 47 const LocalSurfaceId& local_surface_id,
48 CompositorFrame frame, 48 CompositorFrame frame,
49 const DrawCallback& callback, 49 const DrawCallback& callback,
50 const WillDrawCallback& will_draw_callback) { 50 const WillDrawCallback& will_draw_callback) {
51 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame"); 51 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame");
52 DCHECK(local_surface_id.is_valid()); 52 DCHECK(local_surface_id.is_valid());
53 53
54 if (!ui::LatencyInfo::Verify(frame.metadata.latency_info,
55 "RenderWidgetHostImpl::OnSwapCompositorFrame")) {
56 std::vector<ui::LatencyInfo>().swap(frame.metadata.latency_info);
57 }
58
54 for (ui::LatencyInfo& latency : frame.metadata.latency_info) { 59 for (ui::LatencyInfo& latency : frame.metadata.latency_info) {
55 if (latency.latency_components().size() > 0) { 60 if (latency.latency_components().size() > 0) {
56 latency.AddLatencyNumber(ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, 61 latency.AddLatencyNumber(ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT,
57 0, 0); 62 0, 0);
58 } 63 }
59 } 64 }
60 65
61 std::unique_ptr<Surface> surface; 66 std::unique_ptr<Surface> surface;
62 bool create_new_surface = 67 bool create_new_surface =
63 (!current_surface_ || 68 (!current_surface_ ||
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 surface->AddObserver(this); 146 surface->AddObserver(this);
142 return surface; 147 return surface;
143 } 148 }
144 149
145 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { 150 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) {
146 surface->RemoveObserver(this); 151 surface->RemoveObserver(this);
147 manager_->DestroySurface(std::move(surface)); 152 manager_->DestroySurface(std::move(surface));
148 } 153 }
149 154
150 } // namespace cc 155 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/input/render_widget_host_latency_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698