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

Side by Side Diff: cc/input/scroll_state.cc

Issue 2708493002: Refactor scroll chaining to use ScrollNodes without going through LayerImpl (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/input/scroll_state.h" 5 #include "cc/input/scroll_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 #include "cc/trees/scroll_node.h" 10 #include "cc/trees/scroll_node.h"
(...skipping 10 matching lines...) Expand all
21 void ScrollState::ConsumeDelta(double x, double y) { 21 void ScrollState::ConsumeDelta(double x, double y) {
22 data_.delta_x -= x; 22 data_.delta_x -= x;
23 data_.delta_y -= y; 23 data_.delta_y -= y;
24 24
25 if (x || y) 25 if (x || y)
26 data_.delta_consumed_for_scroll_sequence = true; 26 data_.delta_consumed_for_scroll_sequence = true;
27 } 27 }
28 28
29 void ScrollState::DistributeToScrollChainDescendant() { 29 void ScrollState::DistributeToScrollChainDescendant() {
30 if (!scroll_chain_.empty()) { 30 if (!scroll_chain_.empty()) {
31 const ScrollNode* next = scroll_chain_.front(); 31 ScrollNode* next = scroll_chain_.front();
32 scroll_chain_.pop_front(); 32 scroll_chain_.pop_front();
33 layer_tree_impl_->LayerById(next->owning_layer_id)->DistributeScroll(this); 33
34 ScrollTree& scroll_tree = layer_tree_impl_->property_trees()->scroll_tree;
35 scroll_tree.DistributeScroll(next, this);
34 } 36 }
35 } 37 }
36 38
37 } // namespace cc 39 } // namespace cc
OLDNEW
« cc/input/scroll_state.h ('K') | « cc/input/scroll_state.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698