| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() { | 477 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() { |
| 478 if (scrollable()) | 478 if (scrollable()) |
| 479 UpdatePropertyTreeScrollOffset(); | 479 UpdatePropertyTreeScrollOffset(); |
| 480 | 480 |
| 481 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { | 481 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { |
| 482 if (TransformNode* node = | 482 if (TransformNode* node = |
| 483 GetTransformTree().FindNodeFromElementId(element_id())) { | 483 GetTransformTree().FindNodeFromElementId(element_id())) { |
| 484 bool has_potential_animation = HasPotentiallyRunningTransformAnimation(); | 484 bool has_potential_animation = HasPotentiallyRunningTransformAnimation(); |
| 485 if (node->has_potential_animation != has_potential_animation) { | 485 if (node->has_potential_animation != has_potential_animation) { |
| 486 node->has_potential_animation = has_potential_animation; | 486 node->has_potential_animation = has_potential_animation; |
| 487 node->has_only_translation_animations = HasOnlyTranslationTransforms(); | 487 node->has_only_translation_animations = |
| 488 GetMutatorHost()->HasOnlyTranslationTransforms( |
| 489 element_id(), GetElementTypeForAnimation()); |
| 488 GetTransformTree().set_needs_update(true); | 490 GetTransformTree().set_needs_update(true); |
| 489 layer_tree_impl()->set_needs_update_draw_properties(); | 491 layer_tree_impl()->set_needs_update_draw_properties(); |
| 490 } | 492 } |
| 491 } | 493 } |
| 492 } | 494 } |
| 493 } | 495 } |
| 494 | 496 |
| 495 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { | 497 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { |
| 496 return CurrentScrollOffset(); | 498 return CurrentScrollOffset(); |
| 497 } | 499 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 bool LayerImpl::TransformIsAnimating() const { | 675 bool LayerImpl::TransformIsAnimating() const { |
| 674 return GetMutatorHost()->IsAnimatingTransformProperty( | 676 return GetMutatorHost()->IsAnimatingTransformProperty( |
| 675 element_id(), GetElementTypeForAnimation()); | 677 element_id(), GetElementTypeForAnimation()); |
| 676 } | 678 } |
| 677 | 679 |
| 678 bool LayerImpl::HasPotentiallyRunningTransformAnimation() const { | 680 bool LayerImpl::HasPotentiallyRunningTransformAnimation() const { |
| 679 return GetMutatorHost()->HasPotentiallyRunningTransformAnimation( | 681 return GetMutatorHost()->HasPotentiallyRunningTransformAnimation( |
| 680 element_id(), GetElementTypeForAnimation()); | 682 element_id(), GetElementTypeForAnimation()); |
| 681 } | 683 } |
| 682 | 684 |
| 683 bool LayerImpl::HasOnlyTranslationTransforms() const { | |
| 684 return GetMutatorHost()->HasOnlyTranslationTransforms( | |
| 685 element_id(), GetElementTypeForAnimation()); | |
| 686 } | |
| 687 | |
| 688 bool LayerImpl::HasAnyAnimationTargetingProperty( | 685 bool LayerImpl::HasAnyAnimationTargetingProperty( |
| 689 TargetProperty::Type property) const { | 686 TargetProperty::Type property) const { |
| 690 return GetMutatorHost()->HasAnyAnimationTargetingProperty(element_id(), | 687 return GetMutatorHost()->HasAnyAnimationTargetingProperty(element_id(), |
| 691 property); | 688 property); |
| 692 } | 689 } |
| 693 | 690 |
| 694 bool LayerImpl::HasFilterAnimationThatInflatesBounds() const { | 691 bool LayerImpl::HasFilterAnimationThatInflatesBounds() const { |
| 695 return GetMutatorHost()->HasFilterAnimationThatInflatesBounds(element_id()); | 692 return GetMutatorHost()->HasFilterAnimationThatInflatesBounds(element_id()); |
| 696 } | 693 } |
| 697 | 694 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 | 983 |
| 987 ScrollTree& LayerImpl::GetScrollTree() const { | 984 ScrollTree& LayerImpl::GetScrollTree() const { |
| 988 return GetPropertyTrees()->scroll_tree; | 985 return GetPropertyTrees()->scroll_tree; |
| 989 } | 986 } |
| 990 | 987 |
| 991 TransformTree& LayerImpl::GetTransformTree() const { | 988 TransformTree& LayerImpl::GetTransformTree() const { |
| 992 return GetPropertyTrees()->transform_tree; | 989 return GetPropertyTrees()->transform_tree; |
| 993 } | 990 } |
| 994 | 991 |
| 995 } // namespace cc | 992 } // namespace cc |
| OLD | NEW |