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

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

Issue 2243973002: Fix scroll chaining in CC for non-default RootScroller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Tim's comments Created 4 years, 4 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 | cc/trees/layer_tree_host_impl_unittest.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 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 3085 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 // TODO(majidvp): in Blink we compute scroll chain only at scroll begin which 3096 // TODO(majidvp): in Blink we compute scroll chain only at scroll begin which
3097 // is not the case here. We eventually want to have the same behaviour on both 3097 // is not the case here. We eventually want to have the same behaviour on both
3098 // sides but it may become a non issue if we get rid of scroll chaining (see 3098 // sides but it may become a non issue if we get rid of scroll chaining (see
3099 // crbug.com/526462) 3099 // crbug.com/526462)
3100 std::list<const ScrollNode*> current_scroll_chain; 3100 std::list<const ScrollNode*> current_scroll_chain;
3101 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; 3101 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
3102 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode(); 3102 ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode();
3103 if (scroll_node) { 3103 if (scroll_node) {
3104 for (; scroll_tree.parent(scroll_node); 3104 for (; scroll_tree.parent(scroll_node);
3105 scroll_node = scroll_tree.parent(scroll_node)) { 3105 scroll_node = scroll_tree.parent(scroll_node)) {
3106 // Skip the outer viewport scroll layer so that we try to scroll the 3106 if (scroll_node->is_outer_viewport_scroll_layer) {
3107 // viewport only once. i.e. The inner viewport layer represents the 3107 // Don't chain scrolls past the outer viewport scroll layer. Once we
3108 // viewport. 3108 // reach that, we should scroll the viewport, which is represented by
3109 if (!scroll_node->scrollable || 3109 // the inner viewport scroll layer.
3110 scroll_node->is_outer_viewport_scroll_layer) 3110 ScrollNode* inner_viewport_scroll_node =
3111 scroll_tree.Node(InnerViewportScrollLayer()->scroll_tree_index());
3112 current_scroll_chain.push_front(inner_viewport_scroll_node);
3113 break;
3114 }
3115
3116 if (!scroll_node->scrollable)
3111 continue; 3117 continue;
3118
3112 current_scroll_chain.push_front(scroll_node); 3119 current_scroll_chain.push_front(scroll_node);
3113 } 3120 }
3114 } 3121 }
3115 scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, 3122 scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain,
3116 active_tree()); 3123 active_tree());
3117 scroll_state->DistributeToScrollChainDescendant(); 3124 scroll_state->DistributeToScrollChainDescendant();
3118 } 3125 }
3119 3126
3120 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( 3127 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
3121 ScrollState* scroll_state) { 3128 ScrollState* scroll_state) {
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
4101 return task_runner_provider_->HasImplThread(); 4108 return task_runner_provider_->HasImplThread();
4102 } 4109 }
4103 4110
4104 bool LayerTreeHostImpl::CommitToActiveTree() const { 4111 bool LayerTreeHostImpl::CommitToActiveTree() const {
4105 // In single threaded mode we skip the pending tree and commit directly to the 4112 // In single threaded mode we skip the pending tree and commit directly to the
4106 // active tree. 4113 // active tree.
4107 return !task_runner_provider_->HasImplThread(); 4114 return !task_runner_provider_->HasImplThread();
4108 } 4115 }
4109 4116
4110 } // namespace cc 4117 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698