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

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

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
« no previous file with comments | « no previous file | cc/input/scroll_state.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 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 #ifndef CC_INPUT_SCROLL_STATE_H_ 5 #ifndef CC_INPUT_SCROLL_STATE_H_
6 #define CC_INPUT_SCROLL_STATE_H_ 6 #define CC_INPUT_SCROLL_STATE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void set_is_ending(bool is_ending) { data_.is_ending = is_ending; } 54 void set_is_ending(bool is_ending) { data_.is_ending = is_ending; }
55 55
56 // True if this scroll is allowed to bubble upwards. 56 // True if this scroll is allowed to bubble upwards.
57 bool should_propagate() const { return data_.should_propagate; } 57 bool should_propagate() const { return data_.should_propagate; }
58 // True if the user interacts directly with the screen, e.g., via touch. 58 // True if the user interacts directly with the screen, e.g., via touch.
59 bool is_direct_manipulation() const { return data_.is_direct_manipulation; } 59 bool is_direct_manipulation() const { return data_.is_direct_manipulation; }
60 void set_is_direct_manipulation(bool is_direct_manipulation) { 60 void set_is_direct_manipulation(bool is_direct_manipulation) {
61 data_.is_direct_manipulation = is_direct_manipulation; 61 data_.is_direct_manipulation = is_direct_manipulation;
62 } 62 }
63 63
64 void set_scroll_chain_and_layer_tree( 64 void set_scroll_chain_and_layer_tree(std::list<ScrollNode*>* scroll_chain,
bokan 2017/02/21 19:33:39 Nit, why pass by pointer rather than const-ref?
pdr. 2017/02/22 21:35:59 Good catch, this was just a mistake. I started rem
65 const std::list<const ScrollNode*>& scroll_chain, 65 LayerTreeImpl* layer_tree_impl) {
66 LayerTreeImpl* layer_tree_impl) {
67 layer_tree_impl_ = layer_tree_impl; 66 layer_tree_impl_ = layer_tree_impl;
68 scroll_chain_ = scroll_chain; 67 scroll_chain_ = *scroll_chain;
69 } 68 }
70 69
71 void set_current_native_scrolling_node(ScrollNode* scroll_node) { 70 void set_current_native_scrolling_node(ScrollNode* scroll_node) {
72 data_.set_current_native_scrolling_node(scroll_node); 71 data_.set_current_native_scrolling_node(scroll_node);
73 } 72 }
74 73
75 ScrollNode* current_native_scrolling_node() const { 74 ScrollNode* current_native_scrolling_node() const {
76 return data_.current_native_scrolling_node(); 75 return data_.current_native_scrolling_node();
77 } 76 }
78 77
(...skipping 13 matching lines...) Expand all
92 91
93 bool caused_scroll_x() const { return data_.caused_scroll_x; } 92 bool caused_scroll_x() const { return data_.caused_scroll_x; }
94 bool caused_scroll_y() const { return data_.caused_scroll_y; } 93 bool caused_scroll_y() const { return data_.caused_scroll_y; }
95 94
96 LayerTreeImpl* layer_tree_impl() { return layer_tree_impl_; } 95 LayerTreeImpl* layer_tree_impl() { return layer_tree_impl_; }
97 ScrollStateData* data() { return &data_; } 96 ScrollStateData* data() { return &data_; }
98 97
99 private: 98 private:
100 ScrollStateData data_; 99 ScrollStateData data_;
101 LayerTreeImpl* layer_tree_impl_; 100 LayerTreeImpl* layer_tree_impl_;
102 std::list<const ScrollNode*> scroll_chain_; 101 std::list<ScrollNode*> scroll_chain_;
103 }; 102 };
104 103
105 } // namespace cc 104 } // namespace cc
106 105
107 #endif // CC_INPUT_SCROLL_STATE_H_ 106 #endif // CC_INPUT_SCROLL_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/input/scroll_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698