| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 } | 1202 } |
| 1203 DCHECK(tree == *this); | 1203 DCHECK(tree == *this); |
| 1204 #endif | 1204 #endif |
| 1205 } | 1205 } |
| 1206 | 1206 |
| 1207 gfx::ScrollOffset ScrollTree::MaxScrollOffset(int scroll_node_id) const { | 1207 gfx::ScrollOffset ScrollTree::MaxScrollOffset(int scroll_node_id) const { |
| 1208 const ScrollNode* scroll_node = Node(scroll_node_id); | 1208 const ScrollNode* scroll_node = Node(scroll_node_id); |
| 1209 gfx::SizeF scroll_bounds = | 1209 gfx::SizeF scroll_bounds = |
| 1210 gfx::SizeF(scroll_node->bounds.width(), scroll_node->bounds.height()); | 1210 gfx::SizeF(scroll_node->bounds.width(), scroll_node->bounds.height()); |
| 1211 | 1211 |
| 1212 if (scroll_node->is_inner_viewport_scroll_layer) { | 1212 if (scroll_node->scrolls_inner_viewport) { |
| 1213 scroll_bounds.Enlarge( | 1213 scroll_bounds.Enlarge( |
| 1214 property_trees()->inner_viewport_scroll_bounds_delta().x(), | 1214 property_trees()->inner_viewport_scroll_bounds_delta().x(), |
| 1215 property_trees()->inner_viewport_scroll_bounds_delta().y()); | 1215 property_trees()->inner_viewport_scroll_bounds_delta().y()); |
| 1216 } | 1216 } |
| 1217 | 1217 |
| 1218 if (!scroll_node->scrollable || scroll_bounds.IsEmpty()) | 1218 if (!scroll_node->scrollable || scroll_bounds.IsEmpty()) |
| 1219 return gfx::ScrollOffset(); | 1219 return gfx::ScrollOffset(); |
| 1220 | 1220 |
| 1221 TransformTree& transform_tree = property_trees()->transform_tree; | 1221 TransformTree& transform_tree = property_trees()->transform_tree; |
| 1222 float scale_factor = 1.f; | 1222 float scale_factor = 1.f; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1252 ClampScrollOffsetToLimits(scroll_offset, scroll_node))) | 1252 ClampScrollOffsetToLimits(scroll_offset, scroll_node))) |
| 1253 layer_tree_impl->DidUpdateScrollOffset(layer_id); | 1253 layer_tree_impl->DidUpdateScrollOffset(layer_id); |
| 1254 layer_tree_impl->DidAnimateScrollOffset(); | 1254 layer_tree_impl->DidAnimateScrollOffset(); |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const { | 1257 gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const { |
| 1258 const ScrollNode* scroll_node = Node(scroll_node_id); | 1258 const ScrollNode* scroll_node = Node(scroll_node_id); |
| 1259 gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds; | 1259 gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds; |
| 1260 | 1260 |
| 1261 gfx::Vector2dF scroll_clip_layer_bounds_delta; | 1261 gfx::Vector2dF scroll_clip_layer_bounds_delta; |
| 1262 if (scroll_node->is_inner_viewport_scroll_layer) { | 1262 if (scroll_node->scrolls_inner_viewport) { |
| 1263 scroll_clip_layer_bounds_delta.Add( | 1263 scroll_clip_layer_bounds_delta.Add( |
| 1264 property_trees()->inner_viewport_container_bounds_delta()); | 1264 property_trees()->inner_viewport_container_bounds_delta()); |
| 1265 } else if (scroll_node->is_outer_viewport_scroll_layer) { | 1265 } else if (scroll_node->scrolls_outer_viewport) { |
| 1266 scroll_clip_layer_bounds_delta.Add( | 1266 scroll_clip_layer_bounds_delta.Add( |
| 1267 property_trees()->outer_viewport_container_bounds_delta()); | 1267 property_trees()->outer_viewport_container_bounds_delta()); |
| 1268 } | 1268 } |
| 1269 | 1269 |
| 1270 gfx::Vector2d delta = gfx::ToCeiledVector2d(scroll_clip_layer_bounds_delta); | 1270 gfx::Vector2d delta = gfx::ToCeiledVector2d(scroll_clip_layer_bounds_delta); |
| 1271 scroll_clip_layer_bounds.SetSize( | 1271 scroll_clip_layer_bounds.SetSize( |
| 1272 scroll_clip_layer_bounds.width() + delta.x(), | 1272 scroll_clip_layer_bounds.width() + delta.x(), |
| 1273 scroll_clip_layer_bounds.height() + delta.y()); | 1273 scroll_clip_layer_bounds.height() + delta.y()); |
| 1274 | 1274 |
| 1275 return scroll_clip_layer_bounds; | 1275 return scroll_clip_layer_bounds; |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2130 | 2130 |
| 2131 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2131 const EffectNode* effect_node = effect_tree.Node(effect_id); |
| 2132 | 2132 |
| 2133 bool success = GetFromTarget(transform_id, effect_id, transform); | 2133 bool success = GetFromTarget(transform_id, effect_id, transform); |
| 2134 transform->Scale(effect_node->surface_contents_scale.x(), | 2134 transform->Scale(effect_node->surface_contents_scale.x(), |
| 2135 effect_node->surface_contents_scale.y()); | 2135 effect_node->surface_contents_scale.y()); |
| 2136 return success; | 2136 return success; |
| 2137 } | 2137 } |
| 2138 | 2138 |
| 2139 } // namespace cc | 2139 } // namespace cc |
| OLD | NEW |