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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 property_trees->changed = true; | 580 property_trees->changed = true; |
581 property_trees->effect_tree.set_needs_update(true); | 581 property_trees->effect_tree.set_needs_update(true); |
582 } | 582 } |
583 } | 583 } |
584 | 584 |
585 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() { | 585 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() { |
586 if (scrollable()) | 586 if (scrollable()) |
587 UpdatePropertyTreeScrollOffset(); | 587 UpdatePropertyTreeScrollOffset(); |
588 | 588 |
589 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { | 589 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { |
| 590 #if DCHECK_IS_ON() |
| 591 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); |
| 592 if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, |
| 593 id())) { |
| 594 TransformNode* node = property_trees->transform_tree.Node( |
| 595 property_trees->transform_id_to_index_map[id()]); |
| 596 DCHECK(transform_.ApproximatelyEqual(node->data.local)); |
| 597 } |
| 598 #endif |
590 UpdatePropertyTreeTransformIsAnimated( | 599 UpdatePropertyTreeTransformIsAnimated( |
591 HasPotentiallyRunningTransformAnimation()); | 600 HasPotentiallyRunningTransformAnimation()); |
592 } | 601 } |
593 } | 602 } |
594 | 603 |
595 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { | 604 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { |
596 return CurrentScrollOffset(); | 605 return CurrentScrollOffset(); |
597 } | 606 } |
598 | 607 |
599 void LayerImpl::OnFilterAnimated(const FilterOperations& filters) { | 608 void LayerImpl::OnFilterAnimated(const FilterOperations& filters) { |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 .layer_transforms_should_scale_layer_contents) { | 1216 .layer_transforms_should_scale_layer_contents) { |
1208 return default_scale; | 1217 return default_scale; |
1209 } | 1218 } |
1210 | 1219 |
1211 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1220 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1212 ScreenSpaceTransform(), default_scale); | 1221 ScreenSpaceTransform(), default_scale); |
1213 return std::max(transform_scales.x(), transform_scales.y()); | 1222 return std::max(transform_scales.x(), transform_scales.y()); |
1214 } | 1223 } |
1215 | 1224 |
1216 } // namespace cc | 1225 } // namespace cc |
OLD | NEW |