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 53020f0522d00a13ce9c9cc55e55929cfe1c0380..e4d77f5b15b9d5768389de7dfc37e6f3983a94b0 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -82,6 +82,7 @@ |
#include "cc/trees/layer_tree_host.h" |
#include "cc/trees/layer_tree_host_common.h" |
#include "cc/trees/layer_tree_impl.h" |
+#include "cc/trees/root_scroller_controller.h" |
#include "cc/trees/single_thread_proxy.h" |
#include "cc/trees/tree_synchronizer.h" |
#include "gpu/GLES2/gl2extchromium.h" |
@@ -266,6 +267,7 @@ LayerTreeHostImpl::LayerTreeHostImpl( |
TopControlsManager::Create(this, |
settings.top_controls_show_threshold, |
settings.top_controls_hide_threshold); |
+ root_scroller_controller_ = RootScrollerController::Create(); |
} |
LayerTreeHostImpl::~LayerTreeHostImpl() { |
@@ -2032,6 +2034,9 @@ void LayerTreeHostImpl::ActivateSyncTree() { |
active_tree_->UpdatePropertyTreesForBoundsDelta(); |
UpdateViewportContainerSizes(); |
+ root_scroller_controller_->SetRootScrollerLayer( |
+ active_tree_->RootScrollerLayer()); |
+ |
active_tree_->DidBecomeActive(); |
client_->RenewTreePriority(); |
// If we have any picture layers, then by activating we also modified tile |
@@ -3049,10 +3054,18 @@ void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) { |
// Skip the outer viewport scroll layer so that we try to scroll the |
// viewport only once. i.e. The inner viewport layer represents the |
// viewport. |
- if (!scroll_node->data.scrollable || |
- scroll_node->data.is_outer_viewport_scroll_layer) |
- continue; |
- current_scroll_chain.push_front(scroll_node); |
+ if (scroll_node->data.scrollable && |
+ !scroll_node->data.is_outer_viewport_scroll_layer) |
+ current_scroll_chain.push_front(scroll_node); |
+ |
+ // TODO(bokan): We should modify the scroll tree to be built to take |
+ // account of the root scroller. |
+ // If we're reached the root scroller, don't keep chaining. |
+ LayerImpl* root_scroller_layer = |
+ root_scroller_controller()->GetRootScrollerLayer(); |
+ if (root_scroller_layer && |
+ scroll_node->owner_id == root_scroller_layer->id()) |
+ break; |
} |
} |
scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain, |