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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 20994007: Add impl/comp scrolling instrumentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 629877fa168222fa38e37d9454f0714f467122b5..a8b3fcc109d927462a1a2a120a16c6eba32e1200 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1759,11 +1759,21 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
// Walk up the hierarchy and look for a scrollable layer.
LayerImpl* potentially_scrolling_layer_impl = 0;
for (; layer_impl; layer_impl = layer_impl->parent()) {
+ TRACE_EVENT_INSTANT1(
+ "impl-scroll", "LayerTreeHostImpl::ScrollBegin considering layer",
+ TRACE_EVENT_SCOPE_THREAD,
+ "layerId", layer_impl->id());
danakj 2013/07/29 17:16:08 layer_id ?
+
// The content layer can also block attempts to scroll outside the main
// thread.
ScrollStatus status = layer_impl->TryScroll(device_viewport_point, type);
if (status == ScrollOnMainThread) {
rendering_stats_instrumentation_->IncrementMainThreadScrolls();
+ TRACE_EVENT_INSTANT0(
+ "impl-scroll",
+ "LayerTreeHostImpl::ScrollBegin return ScrollOnMainThread",
+ TRACE_EVENT_SCOPE_THREAD);
+
UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true);
return ScrollOnMainThread;
}
@@ -1772,17 +1782,35 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
if (!scroll_layer_impl)
continue;
+ TRACE_EVENT_INSTANT1(
+ "impl-scroll",
+ "LayerTreeHostImpl::ScrollBegin considering scroll layer",
+ TRACE_EVENT_SCOPE_THREAD,
+ "layerId", scroll_layer_impl->id());
danakj 2013/07/29 17:16:08 layer_id?
+
status = scroll_layer_impl->TryScroll(device_viewport_point, type);
// If any layer wants to divert the scroll event to the main thread, abort.
if (status == ScrollOnMainThread) {
rendering_stats_instrumentation_->IncrementMainThreadScrolls();
+ TRACE_EVENT_INSTANT0(
+ "impl-scroll",
+ "LayerTreeHostImpl::ScrollBegin return ScrollOnMainThread",
+ TRACE_EVENT_SCOPE_THREAD);
+
UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true);
return ScrollOnMainThread;
}
- if (status == ScrollStarted && !potentially_scrolling_layer_impl)
+ if (status == ScrollStarted && !potentially_scrolling_layer_impl) {
potentially_scrolling_layer_impl = scroll_layer_impl;
+ TRACE_EVENT_INSTANT1(
+ "impl-scroll",
+ "LayerTreeHostImpl::ScrollBegin scroll layer is the potentially "
+ "scrolling layer",
+ TRACE_EVENT_SCOPE_THREAD,
+ "layerId", scroll_layer_impl->id());
danakj 2013/07/29 17:16:08 layer_id?
+ }
}
// When hiding top controls is enabled and the controls are hidden or
@@ -1801,6 +1829,9 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
wheel_scrolling_ = (type == Wheel);
rendering_stats_instrumentation_->IncrementImplThreadScrolls();
client_->RenewTreePriority();
+ TRACE_EVENT_INSTANT0(
+ "impl-scroll", "LayerTreeHostImpl::ScrollBegin: start impl-scroll.",
enne (OOO) 2013/07/29 17:46:31 Would it make sense to do something with trace eve
+ TRACE_EVENT_SCOPE_THREAD);
UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false);
return ScrollStarted;
}
@@ -2143,6 +2174,14 @@ scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer());
+
+ if (!scroll_info->scrolls.empty()) {
+ TRACE_EVENT_INSTANT0(
+ "impl-scroll",
+ "LayerTreeHostImpl::ProcessScrollDeltas found and set scroll deltas",
+ TRACE_EVENT_SCOPE_THREAD);
+ }
+
scroll_info->page_scale_delta = active_tree_->page_scale_delta();
active_tree_->set_sent_page_scale_delta(scroll_info->page_scale_delta);

Powered by Google App Engine
This is Rietveld 408576698