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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1878323004: Add an uma stat to time Pending Tree activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « cc/trees/layer_tree_host_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 UMA_HISTOGRAM_BOOLEAN("Renderer4.CompositorWheelScrollUpdateThread", 157 UMA_HISTOGRAM_BOOLEAN("Renderer4.CompositorWheelScrollUpdateThread",
158 scroll_on_main_thread); 158 scroll_on_main_thread);
159 } else { 159 } else {
160 UMA_HISTOGRAM_BOOLEAN("Renderer4.CompositorTouchScrollUpdateThread", 160 UMA_HISTOGRAM_BOOLEAN("Renderer4.CompositorTouchScrollUpdateThread",
161 scroll_on_main_thread); 161 scroll_on_main_thread);
162 } 162 }
163 } 163 }
164 164
165 } // namespace 165 } // namespace
166 166
167 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer,
168 "Scheduling.%s.PendingTreeDuration");
169
167 LayerTreeHostImpl::FrameData::FrameData() 170 LayerTreeHostImpl::FrameData::FrameData()
168 : render_surface_layer_list(nullptr), has_no_damage(false) {} 171 : render_surface_layer_list(nullptr), has_no_damage(false) {}
169 172
170 LayerTreeHostImpl::FrameData::~FrameData() {} 173 LayerTreeHostImpl::FrameData::~FrameData() {}
171 174
172 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( 175 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create(
173 const LayerTreeSettings& settings, 176 const LayerTreeSettings& settings,
174 LayerTreeHostImplClient* client, 177 LayerTreeHostImplClient* client,
175 TaskRunnerProvider* task_runner_provider, 178 TaskRunnerProvider* task_runner_provider,
176 RenderingStatsInstrumentation* rendering_stats_instrumentation, 179 RenderingStatsInstrumentation* rendering_stats_instrumentation,
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 if (recycle_tree_) 1956 if (recycle_tree_)
1954 recycle_tree_.swap(pending_tree_); 1957 recycle_tree_.swap(pending_tree_);
1955 else 1958 else
1956 pending_tree_ = 1959 pending_tree_ =
1957 LayerTreeImpl::create(this, active_tree()->page_scale_factor(), 1960 LayerTreeImpl::create(this, active_tree()->page_scale_factor(),
1958 active_tree()->top_controls_shown_ratio(), 1961 active_tree()->top_controls_shown_ratio(),
1959 active_tree()->elastic_overscroll()); 1962 active_tree()->elastic_overscroll());
1960 1963
1961 client_->OnCanDrawStateChanged(CanDraw()); 1964 client_->OnCanDrawStateChanged(CanDraw());
1962 TRACE_EVENT_ASYNC_BEGIN0("cc", "PendingTree:waiting", pending_tree_.get()); 1965 TRACE_EVENT_ASYNC_BEGIN0("cc", "PendingTree:waiting", pending_tree_.get());
1966
1967 DCHECK(!pending_tree_duration_timer_);
1968 pending_tree_duration_timer_.reset(new PendingTreeDurationHistogramTimer());
1963 } 1969 }
1964 1970
1965 void LayerTreeHostImpl::ActivateSyncTree() { 1971 void LayerTreeHostImpl::ActivateSyncTree() {
1966 if (pending_tree_) { 1972 if (pending_tree_) {
1967 TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get()); 1973 TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get());
1968 1974
1975 DCHECK(pending_tree_duration_timer_);
1976 // Reset will call the destructor and log the timer histogram.
1977 pending_tree_duration_timer_.reset();
1978
1969 // Process any requests in the UI resource queue. The request queue is 1979 // Process any requests in the UI resource queue. The request queue is
1970 // given in LayerTreeHost::FinishCommitOnImplThread. This must take place 1980 // given in LayerTreeHost::FinishCommitOnImplThread. This must take place
1971 // before the swap. 1981 // before the swap.
1972 pending_tree_->ProcessUIResourceRequestQueue(); 1982 pending_tree_->ProcessUIResourceRequestQueue();
1973 1983
1974 if (pending_tree_->needs_full_tree_sync()) { 1984 if (pending_tree_->needs_full_tree_sync()) {
1975 TreeSynchronizer::SynchronizeTrees(pending_tree_->root_layer(), 1985 TreeSynchronizer::SynchronizeTrees(pending_tree_->root_layer(),
1976 active_tree_.get()); 1986 active_tree_.get());
1977 } 1987 }
1978 1988
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
4003 const { 4013 const {
4004 return fixed_raster_scale_attempted_scale_change_history_.count() >= 4014 return fixed_raster_scale_attempted_scale_change_history_.count() >=
4005 kFixedRasterScaleAttemptedScaleChangeThreshold; 4015 kFixedRasterScaleAttemptedScaleChangeThreshold;
4006 } 4016 }
4007 4017
4008 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() { 4018 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() {
4009 fixed_raster_scale_attempted_scale_change_history_.set(0); 4019 fixed_raster_scale_attempted_scale_change_history_.set(0);
4010 } 4020 }
4011 4021
4012 } // namespace cc 4022 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698