Commit ca207e09 authored by Sahel Sharify's avatar Sahel Sharify Committed by Commit Bot

Additional tracing in cc smooth scrolling path.

This cl adds tracing to answer the following questions to be able to
further narrow down the root cause of crbug.com/797708

-When did the last call to SetCurrentlyScrollingNode happen? (other than
on PushPropertyTrees after each commit)
-Is animation tick needed? (due to an ongoing animation)
-Whether the animation_host notifies the compositor about animation end
or not?
-When does the CurrentlyScrollingNode get cleared?

Bug: 797708
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I70f2295905798e430ce080c26f6924617504491b
Reviewed-on: https://chromium-review.googlesource.com/1060302
Commit-Queue: Sahel Sharifymoghaddam <sahel@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559211}
parent a4d6263c
...@@ -317,6 +317,7 @@ bool AnimationHost::TickAnimations(base::TimeTicks monotonic_time, ...@@ -317,6 +317,7 @@ bool AnimationHost::TickAnimations(base::TimeTicks monotonic_time,
bool did_animate = false; bool did_animate = false;
if (NeedsTickAnimations()) { if (NeedsTickAnimations()) {
TRACE_EVENT_INSTANT0("cc", "NeedsTickAnimations", TRACE_EVENT_SCOPE_THREAD);
AnimationsList ticking_animations_copy = ticking_animations_; AnimationsList ticking_animations_copy = ticking_animations_;
for (auto& it : ticking_animations_copy) for (auto& it : ticking_animations_copy)
it->Tick(monotonic_time); it->Tick(monotonic_time);
......
...@@ -3238,6 +3238,9 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl( ...@@ -3238,6 +3238,9 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl(
browser_controls_offset_manager_->ScrollBegin(); browser_controls_offset_manager_->ScrollBegin();
TRACE_EVENT_INSTANT1("cc", "SetCurrentlyScrollingNode ScrollBeginImpl",
TRACE_EVENT_SCOPE_THREAD, "isNull",
scrolling_node ? false : true);
active_tree_->SetCurrentlyScrollingNode(scrolling_node); active_tree_->SetCurrentlyScrollingNode(scrolling_node);
// TODO(majidvp): get rid of wheel_scrolling_ and set is_direct_manipulation // TODO(majidvp): get rid of wheel_scrolling_ and set is_direct_manipulation
// in input_handler_proxy instead. // in input_handler_proxy instead.
...@@ -3856,8 +3859,13 @@ void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { ...@@ -3856,8 +3859,13 @@ void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) {
} }
} }
} }
active_tree_->SetCurrentlyScrollingNode(
current_scroll_chain.empty() ? nullptr : current_scroll_chain.back()); scroll_node =
current_scroll_chain.empty() ? nullptr : current_scroll_chain.back();
TRACE_EVENT_INSTANT1("cc", "SetCurrentlyScrollingNode DistributeScrollDelta",
TRACE_EVENT_SCOPE_THREAD, "isNull",
scroll_node ? false : true);
active_tree_->SetCurrentlyScrollingNode(scroll_node);
scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain,
active_tree()); active_tree());
scroll_state->DistributeToScrollChainDescendant(); scroll_state->DistributeToScrollChainDescendant();
...@@ -3928,6 +3936,9 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( ...@@ -3928,6 +3936,9 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
// |scroll_node|. // |scroll_node|.
DCHECK(!provided_scroll_node || scroll_node == provided_scroll_node); DCHECK(!provided_scroll_node || scroll_node == provided_scroll_node);
} else { } else {
TRACE_EVENT_INSTANT1("cc", "SetCurrentlyScrollingNode ScrollBy",
TRACE_EVENT_SCOPE_THREAD, "isNull",
provided_scroll_node ? false : true);
active_tree_->SetCurrentlyScrollingNode(provided_scroll_node); active_tree_->SetCurrentlyScrollingNode(provided_scroll_node);
scroll_node = scroll_tree.CurrentlyScrollingNode(); scroll_node = scroll_tree.CurrentlyScrollingNode();
} }
...@@ -3957,6 +3968,9 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( ...@@ -3957,6 +3968,9 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
ScrollNode* current_scrolling_node = ScrollNode* current_scrolling_node =
scroll_state->current_native_scrolling_node(); scroll_state->current_native_scrolling_node();
TRACE_EVENT_INSTANT1("cc", "SetCurrentlyScrollingNode ApplyDelta",
TRACE_EVENT_SCOPE_THREAD, "isNull",
current_scrolling_node ? false : true);
active_tree_->SetCurrentlyScrollingNode(current_scrolling_node); active_tree_->SetCurrentlyScrollingNode(current_scrolling_node);
did_lock_scrolling_layer_ = did_lock_scrolling_layer_ =
scroll_state->delta_consumed_for_scroll_sequence(); scroll_state->delta_consumed_for_scroll_sequence();
...@@ -4117,6 +4131,7 @@ bool LayerTreeHostImpl::GetSnapFlingInfo( ...@@ -4117,6 +4131,7 @@ bool LayerTreeHostImpl::GetSnapFlingInfo(
} }
void LayerTreeHostImpl::ClearCurrentlyScrollingNode() { void LayerTreeHostImpl::ClearCurrentlyScrollingNode() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::ClearCurrentlyScrollingNode");
active_tree_->ClearCurrentlyScrollingNode(); active_tree_->ClearCurrentlyScrollingNode();
did_lock_scrolling_layer_ = false; did_lock_scrolling_layer_ = false;
scroll_affects_scroll_handler_ = false; scroll_affects_scroll_handler_ = false;
...@@ -4246,6 +4261,9 @@ void LayerTreeHostImpl::PinchGestureBegin() { ...@@ -4246,6 +4261,9 @@ void LayerTreeHostImpl::PinchGestureBegin() {
client_->RenewTreePriority(); client_->RenewTreePriority();
pinch_gesture_end_should_clear_scrolling_node_ = !CurrentlyScrollingNode(); pinch_gesture_end_should_clear_scrolling_node_ = !CurrentlyScrollingNode();
TRACE_EVENT_INSTANT1("cc", "SetCurrentlyScrollingNode PinchGestureBegin",
TRACE_EVENT_SCOPE_THREAD, "isNull",
OuterViewportScrollNode() ? false : true);
active_tree_->SetCurrentlyScrollingNode(OuterViewportScrollNode()); active_tree_->SetCurrentlyScrollingNode(OuterViewportScrollNode());
browser_controls_offset_manager_->PinchBegin(); browser_controls_offset_manager_->PinchBegin();
} }
...@@ -5111,6 +5129,7 @@ void LayerTreeHostImpl::ElementIsAnimatingChanged( ...@@ -5111,6 +5129,7 @@ void LayerTreeHostImpl::ElementIsAnimatingChanged(
} }
void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { void LayerTreeHostImpl::ScrollOffsetAnimationFinished() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollOffsetAnimationFinished");
// TODO(majidvp): We should pass in the original starting scroll position here // TODO(majidvp): We should pass in the original starting scroll position here
ScrollStateData scroll_state_data; ScrollStateData scroll_state_data;
ScrollState scroll_state(scroll_state_data); ScrollState scroll_state(scroll_state_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment