OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 void LayerImpl::SetDebugInfo( | 118 void LayerImpl::SetDebugInfo( |
119 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info) { | 119 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info) { |
120 owned_debug_info_ = std::move(debug_info); | 120 owned_debug_info_ = std::move(debug_info); |
121 debug_info_ = owned_debug_info_.get(); | 121 debug_info_ = owned_debug_info_.get(); |
122 SetNeedsPushProperties(); | 122 SetNeedsPushProperties(); |
123 } | 123 } |
124 | 124 |
125 void LayerImpl::DistributeScroll(ScrollState* scroll_state) { | 125 void LayerImpl::DistributeScroll(ScrollState* scroll_state) { |
126 ScrollTree& scroll_tree = layer_tree_impl()->property_trees()->scroll_tree; | 126 ScrollTree& scroll_tree = layer_tree_impl()->property_trees()->scroll_tree; |
127 ScrollNode* scroll_node = scroll_tree.Node(scroll_tree_index()); | 127 ScrollNode* scroll_node = scroll_tree.Node(scroll_tree_index()); |
128 scroll_tree.DistributeScroll(scroll_node, scroll_state); | 128 return scroll_tree.DistributeScroll(scroll_node, scroll_state); |
| 129 } |
| 130 |
| 131 void LayerImpl::ApplyScroll(ScrollState* scroll_state) { |
| 132 DCHECK(scroll_state); |
| 133 ScrollNode* node = layer_tree_impl()->property_trees()->scroll_tree.Node( |
| 134 scroll_tree_index()); |
| 135 layer_tree_impl()->ApplyScroll(node, scroll_state); |
129 } | 136 } |
130 | 137 |
131 void LayerImpl::SetTransformTreeIndex(int index) { | 138 void LayerImpl::SetTransformTreeIndex(int index) { |
132 transform_tree_index_ = index; | 139 transform_tree_index_ = index; |
133 } | 140 } |
134 | 141 |
135 void LayerImpl::SetClipTreeIndex(int index) { | 142 void LayerImpl::SetClipTreeIndex(int index) { |
136 clip_tree_index_ = index; | 143 clip_tree_index_ = index; |
137 } | 144 } |
138 | 145 |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 .layer_transforms_should_scale_layer_contents) { | 1107 .layer_transforms_should_scale_layer_contents) { |
1101 return default_scale; | 1108 return default_scale; |
1102 } | 1109 } |
1103 | 1110 |
1104 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1111 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1105 ScreenSpaceTransform(), default_scale); | 1112 ScreenSpaceTransform(), default_scale); |
1106 return std::max(transform_scales.x(), transform_scales.y()); | 1113 return std::max(transform_scales.x(), transform_scales.y()); |
1107 } | 1114 } |
1108 | 1115 |
1109 } // namespace cc | 1116 } // namespace cc |
OLD | NEW |