| 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) {} |
| 27 | 28 |
| 28 ScrollStateData::ScrollStateData(const ScrollStateData& other) = default; | 29 ScrollStateData::ScrollStateData(const ScrollStateData& other) = default; |
| 29 | 30 |
| 30 ScrollNode* ScrollStateData::current_native_scrolling_node() const { | 31 ScrollNode* ScrollStateData::current_native_scrolling_node() const { |
| 31 return current_native_scrolling_node_; | 32 return current_native_scrolling_node_; |
| 32 } | 33 } |
| 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_ = ElementId(); | 37 current_native_scrolling_element_ = 0; |
| 38 } | 38 } |
| 39 | 39 uint64_t ScrollStateData::current_native_scrolling_element() const { |
| 40 ElementId ScrollStateData::current_native_scrolling_element() const { | |
| 41 if (current_native_scrolling_node_) | 40 if (current_native_scrolling_node_) |
| 42 return current_native_scrolling_node_->data.element_id; | 41 return current_native_scrolling_node_->data.element_id; |
| 43 return current_native_scrolling_element_; | 42 return current_native_scrolling_element_; |
| 44 } | 43 } |
| 45 | |
| 46 void ScrollStateData::set_current_native_scrolling_element( | 44 void ScrollStateData::set_current_native_scrolling_element( |
| 47 ElementId element_id) { | 45 uint64_t element_id) { |
| 48 current_native_scrolling_element_ = element_id; | 46 current_native_scrolling_element_ = element_id; |
| 49 current_native_scrolling_node_ = nullptr; | 47 current_native_scrolling_node_ = nullptr; |
| 50 } | 48 } |
| 51 | 49 |
| 52 } // namespace cc | 50 } // namespace cc |
| OLD | NEW |