summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/trees/layer_tree_host_impl.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index d1b1fed..dfa3c3f 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3245,21 +3245,20 @@ void LayerTreeHostImpl::PinchGestureEnd() {
}
static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
- LayerImpl* layer_impl) {
- if (!layer_impl)
+ LayerImpl* root_layer) {
+ if (!root_layer)
return;
- gfx::ScrollOffset scroll_delta = layer_impl->PullDeltaForMainThread();
+ for (auto* layer : *root_layer->layer_tree_impl()) {
+ gfx::ScrollOffset scroll_delta = layer->PullDeltaForMainThread();
- if (!scroll_delta.IsZero()) {
- LayerTreeHostCommon::ScrollUpdateInfo scroll;
- scroll.layer_id = layer_impl->id();
- scroll.scroll_delta = gfx::Vector2d(scroll_delta.x(), scroll_delta.y());
- scroll_info->scrolls.push_back(scroll);
+ if (!scroll_delta.IsZero()) {
+ LayerTreeHostCommon::ScrollUpdateInfo scroll;
+ scroll.layer_id = layer->id();
+ scroll.scroll_delta = gfx::Vector2d(scroll_delta.x(), scroll_delta.y());
+ scroll_info->scrolls.push_back(scroll);
+ }
}
-
- for (size_t i = 0; i < layer_impl->children().size(); ++i)
- CollectScrollDeltas(scroll_info, layer_impl->children()[i].get());
}
scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {