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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const { | 315 bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const { |
316 return (orientation == HORIZONTAL) ? user_scrollable_horizontal_ | 316 return (orientation == HORIZONTAL) ? user_scrollable_horizontal_ |
317 : user_scrollable_vertical_; | 317 : user_scrollable_vertical_; |
318 } | 318 } |
319 | 319 |
320 std::unique_ptr<LayerImpl> LayerImpl::CreateLayerImpl( | 320 std::unique_ptr<LayerImpl> LayerImpl::CreateLayerImpl( |
321 LayerTreeImpl* tree_impl) { | 321 LayerTreeImpl* tree_impl) { |
322 return LayerImpl::Create(tree_impl, layer_id_); | 322 return LayerImpl::Create(tree_impl, layer_id_); |
323 } | 323 } |
324 | 324 |
| 325 bool LayerImpl::IsSnapped() { |
| 326 return scrollable(); |
| 327 } |
| 328 |
325 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { | 329 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { |
326 DCHECK(layer->IsActive()); | 330 DCHECK(layer->IsActive()); |
327 | 331 |
328 layer->offset_to_transform_parent_ = offset_to_transform_parent_; | 332 layer->offset_to_transform_parent_ = offset_to_transform_parent_; |
329 layer->main_thread_scrolling_reasons_ = main_thread_scrolling_reasons_; | 333 layer->main_thread_scrolling_reasons_ = main_thread_scrolling_reasons_; |
330 layer->user_scrollable_horizontal_ = user_scrollable_horizontal_; | 334 layer->user_scrollable_horizontal_ = user_scrollable_horizontal_; |
331 layer->user_scrollable_vertical_ = user_scrollable_vertical_; | 335 layer->user_scrollable_vertical_ = user_scrollable_vertical_; |
332 layer->should_flatten_transform_from_property_tree_ = | 336 layer->should_flatten_transform_from_property_tree_ = |
333 should_flatten_transform_from_property_tree_; | 337 should_flatten_transform_from_property_tree_; |
334 layer->masks_to_bounds_ = masks_to_bounds_; | 338 layer->masks_to_bounds_ = masks_to_bounds_; |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 .layer_transforms_should_scale_layer_contents) { | 1097 .layer_transforms_should_scale_layer_contents) { |
1094 return default_scale; | 1098 return default_scale; |
1095 } | 1099 } |
1096 | 1100 |
1097 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1101 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1098 ScreenSpaceTransform(), default_scale); | 1102 ScreenSpaceTransform(), default_scale); |
1099 return std::max(transform_scales.x(), transform_scales.y()); | 1103 return std::max(transform_scales.x(), transform_scales.y()); |
1100 } | 1104 } |
1101 | 1105 |
1102 } // namespace cc | 1106 } // namespace cc |
OLD | NEW |