OLD | NEW |
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_data.h" | 5 #include "cc/input/scroll_state_data.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 ScrollStateData::ScrollStateData() | 9 ScrollStateData::ScrollStateData() |
10 : delta_x(0), | 10 : delta_x(0), |
11 delta_y(0), | 11 delta_y(0), |
12 position_x(0), | 12 position_x(0), |
13 position_y(0), | 13 position_y(0), |
14 velocity_x(0), | 14 velocity_x(0), |
15 velocity_y(0), | 15 velocity_y(0), |
16 is_beginning(false), | 16 is_beginning(false), |
17 is_in_inertial_phase(false), | 17 is_in_inertial_phase(false), |
18 is_ending(false), | 18 is_ending(false), |
19 should_propagate(false), | 19 should_propagate(false), |
20 from_user_input(false), | 20 from_user_input(false), |
21 delta_consumed_for_scroll_sequence(false), | 21 delta_consumed_for_scroll_sequence(false), |
22 is_direct_manipulation(false), | 22 is_direct_manipulation(false), |
23 delta_granularity(0), | 23 delta_granularity(0), |
24 caused_scroll_x(false), | 24 caused_scroll_x(false), |
25 caused_scroll_y(false), | 25 caused_scroll_y(false), |
26 current_native_scrolling_node_(nullptr), | 26 current_native_scrolling_node_(nullptr) {} |
27 current_native_scrolling_element_(0) {} | |
28 | 27 |
29 ScrollStateData::ScrollStateData(const ScrollStateData& other) = default; | 28 ScrollStateData::ScrollStateData(const ScrollStateData& other) = default; |
30 | 29 |
31 ScrollNode* ScrollStateData::current_native_scrolling_node() const { | 30 ScrollNode* ScrollStateData::current_native_scrolling_node() const { |
32 return current_native_scrolling_node_; | 31 return current_native_scrolling_node_; |
33 } | 32 } |
| 33 |
34 void ScrollStateData::set_current_native_scrolling_node( | 34 void ScrollStateData::set_current_native_scrolling_node( |
35 ScrollNode* current_native_scrolling_node) { | 35 ScrollNode* current_native_scrolling_node) { |
36 current_native_scrolling_node_ = current_native_scrolling_node; | 36 current_native_scrolling_node_ = current_native_scrolling_node; |
37 current_native_scrolling_element_ = 0; | 37 current_native_scrolling_element_ = ElementId(); |
38 } | 38 } |
39 uint64_t ScrollStateData::current_native_scrolling_element() const { | 39 |
| 40 ElementId ScrollStateData::current_native_scrolling_element() const { |
40 if (current_native_scrolling_node_) | 41 if (current_native_scrolling_node_) |
41 return current_native_scrolling_node_->data.element_id; | 42 return current_native_scrolling_node_->data.element_id; |
42 return current_native_scrolling_element_; | 43 return current_native_scrolling_element_; |
43 } | 44 } |
| 45 |
44 void ScrollStateData::set_current_native_scrolling_element( | 46 void ScrollStateData::set_current_native_scrolling_element( |
45 uint64_t element_id) { | 47 ElementId element_id) { |
46 current_native_scrolling_element_ = element_id; | 48 current_native_scrolling_element_ = element_id; |
47 current_native_scrolling_node_ = nullptr; | 49 current_native_scrolling_node_ = nullptr; |
48 } | 50 } |
49 | 51 |
50 } // namespace cc | 52 } // namespace cc |
OLD | NEW |