| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/trace_event/trace_event_argument.h" | 5 #include "base/trace_event/trace_event_argument.h" |
| 6 #include "cc/base/math_util.h" | 6 #include "cc/base/math_util.h" |
| 7 #include "cc/input/main_thread_scrolling_reason.h" | 7 #include "cc/input/main_thread_scrolling_reason.h" |
| 8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "cc/trees/element_id.h" | 9 #include "cc/trees/element_id.h" |
| 10 #include "cc/trees/property_tree.h" | 10 #include "cc/trees/property_tree.h" |
| 11 #include "cc/trees/scroll_node.h" | 11 #include "cc/trees/scroll_node.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 ScrollNode::ScrollNode() | 15 ScrollNode::ScrollNode() |
| 16 : id(ScrollTree::kInvalidNodeId), | 16 : id(ScrollTree::kInvalidNodeId), |
| 17 parent_id(ScrollTree::kInvalidNodeId), | 17 parent_id(ScrollTree::kInvalidNodeId), |
| 18 owning_layer_id(Layer::INVALID_ID), | 18 owning_layer_id(Layer::INVALID_ID), |
| 19 scrollable(false), | 19 scrollable(false), |
| 20 main_thread_scrolling_reasons( | 20 main_thread_scrolling_reasons( |
| 21 MainThreadScrollingReason::kNotScrollingOnMain), | 21 MainThreadScrollingReason::kNotScrollingOnMain), |
| 22 contains_non_fast_scrollable_region(false), | |
| 23 max_scroll_offset_affected_by_page_scale(false), | 22 max_scroll_offset_affected_by_page_scale(false), |
| 24 scrolls_inner_viewport(false), | 23 scrolls_inner_viewport(false), |
| 25 scrolls_outer_viewport(false), | 24 scrolls_outer_viewport(false), |
| 26 should_flatten(false), | 25 should_flatten(false), |
| 27 user_scrollable_horizontal(false), | 26 user_scrollable_horizontal(false), |
| 28 user_scrollable_vertical(false), | 27 user_scrollable_vertical(false), |
| 29 transform_id(0) {} | 28 transform_id(0) {} |
| 30 | 29 |
| 31 ScrollNode::ScrollNode(const ScrollNode& other) = default; | 30 ScrollNode::ScrollNode(const ScrollNode& other) = default; |
| 32 | 31 |
| 33 bool ScrollNode::operator==(const ScrollNode& other) const { | 32 bool ScrollNode::operator==(const ScrollNode& other) const { |
| 34 return id == other.id && parent_id == other.parent_id && | 33 return id == other.id && parent_id == other.parent_id && |
| 35 owning_layer_id == other.owning_layer_id && | 34 owning_layer_id == other.owning_layer_id && |
| 36 scrollable == other.scrollable && | 35 scrollable == other.scrollable && |
| 37 main_thread_scrolling_reasons == other.main_thread_scrolling_reasons && | 36 main_thread_scrolling_reasons == other.main_thread_scrolling_reasons && |
| 38 contains_non_fast_scrollable_region == | 37 non_fast_scrollable_region == other.non_fast_scrollable_region && |
| 39 other.contains_non_fast_scrollable_region && | |
| 40 scroll_clip_layer_bounds == other.scroll_clip_layer_bounds && | 38 scroll_clip_layer_bounds == other.scroll_clip_layer_bounds && |
| 41 bounds == other.bounds && | 39 bounds == other.bounds && |
| 42 max_scroll_offset_affected_by_page_scale == | 40 max_scroll_offset_affected_by_page_scale == |
| 43 other.max_scroll_offset_affected_by_page_scale && | 41 other.max_scroll_offset_affected_by_page_scale && |
| 44 scrolls_inner_viewport == other.scrolls_inner_viewport && | 42 scrolls_inner_viewport == other.scrolls_inner_viewport && |
| 45 scrolls_outer_viewport == other.scrolls_outer_viewport && | 43 scrolls_outer_viewport == other.scrolls_outer_viewport && |
| 46 offset_to_transform_parent == other.offset_to_transform_parent && | 44 offset_to_transform_parent == other.offset_to_transform_parent && |
| 47 should_flatten == other.should_flatten && | 45 should_flatten == other.should_flatten && |
| 48 user_scrollable_horizontal == other.user_scrollable_horizontal && | 46 user_scrollable_horizontal == other.user_scrollable_horizontal && |
| 49 user_scrollable_vertical == other.user_scrollable_vertical && | 47 user_scrollable_vertical == other.user_scrollable_vertical && |
| (...skipping 12 matching lines...) Expand all Loading... |
| 62 offset_to_transform_parent, value); | 60 offset_to_transform_parent, value); |
| 63 value->SetBoolean("should_flatten", should_flatten); | 61 value->SetBoolean("should_flatten", should_flatten); |
| 64 value->SetBoolean("user_scrollable_horizontal", user_scrollable_horizontal); | 62 value->SetBoolean("user_scrollable_horizontal", user_scrollable_horizontal); |
| 65 value->SetBoolean("user_scrollable_vertical", user_scrollable_vertical); | 63 value->SetBoolean("user_scrollable_vertical", user_scrollable_vertical); |
| 66 | 64 |
| 67 element_id.AddToTracedValue(value); | 65 element_id.AddToTracedValue(value); |
| 68 value->SetInteger("transform_id", transform_id); | 66 value->SetInteger("transform_id", transform_id); |
| 69 } | 67 } |
| 70 | 68 |
| 71 } // namespace cc | 69 } // namespace cc |
| OLD | NEW |