| 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 #include "cc/layers/layer_impl.h" |
| 8 |
| 7 namespace cc { | 9 namespace cc { |
| 8 | 10 |
| 9 ScrollStateData::ScrollStateData(double delta_x, | 11 ScrollStateData::ScrollStateData() |
| 10 double delta_y, | 12 : delta_x(0), |
| 11 int start_position_x, | 13 delta_y(0), |
| 12 int start_position_y, | 14 start_position_x(0), |
| 13 double velocity_x, | 15 start_position_y(0), |
| 14 double velocity_y, | 16 velocity_x(0), |
| 15 bool is_beginning, | 17 velocity_y(0), |
| 16 bool is_in_inertial_phase, | 18 is_beginning(false), |
| 17 bool is_ending, | 19 is_in_inertial_phase(false), |
| 18 bool should_propagate, | 20 is_ending(false), |
| 19 bool delta_consumed_for_scroll_sequence, | 21 should_propagate(false), |
| 20 bool is_direct_manipulation) | 22 from_user_input(false), |
| 21 : delta_x(delta_x), | 23 delta_consumed_for_scroll_sequence(false), |
| 22 delta_y(delta_y), | 24 is_direct_manipulation(false), |
| 23 start_position_x(start_position_x), | 25 delta_granularity(0), |
| 24 start_position_y(start_position_y), | |
| 25 velocity_x(velocity_x), | |
| 26 velocity_y(velocity_y), | |
| 27 is_beginning(is_beginning), | |
| 28 is_in_inertial_phase(is_in_inertial_phase), | |
| 29 is_ending(is_ending), | |
| 30 should_propagate(should_propagate), | |
| 31 current_native_scrolling_layer(nullptr), | |
| 32 delta_consumed_for_scroll_sequence(delta_consumed_for_scroll_sequence), | |
| 33 is_direct_manipulation(is_direct_manipulation), | |
| 34 caused_scroll_x(false), | 26 caused_scroll_x(false), |
| 35 caused_scroll_y(false) {} | 27 caused_scroll_y(false), |
| 28 current_native_scrolling_layer_(nullptr), |
| 29 current_native_scrolling_element_(0) {} |
| 36 | 30 |
| 37 ScrollStateData::ScrollStateData() | 31 LayerImpl* ScrollStateData::current_native_scrolling_layer() const { |
| 38 : ScrollStateData(0, | 32 return current_native_scrolling_layer_; |
| 39 0, | 33 } |
| 40 0, | 34 void ScrollStateData::set_current_native_scrolling_layer( |
| 41 0, | 35 LayerImpl* current_native_scrolling_layer) { |
| 42 0, | 36 current_native_scrolling_layer_ = current_native_scrolling_layer; |
| 43 0, | 37 current_native_scrolling_element_ = 0; |
| 44 false, | 38 } |
| 45 false, | 39 uint64_t ScrollStateData::current_native_scrolling_element() const { |
| 46 false, | 40 if (current_native_scrolling_layer_) |
| 47 true, | 41 return current_native_scrolling_layer_->element_id(); |
| 48 false, | 42 return current_native_scrolling_element_; |
| 49 false) {} | 43 } |
| 44 void ScrollStateData::set_current_native_scrolling_element( |
| 45 uint64_t element_id) { |
| 46 current_native_scrolling_element_ = element_id; |
| 47 current_native_scrolling_layer_ = nullptr; |
| 48 } |
| 50 | 49 |
| 51 } // namespace cc | 50 } // namespace cc |
| OLD | NEW |