Index: cc/animation/layer_animation_controller.cc |
diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc |
index c9d81cf0e9d29249993b44f26846aaec709b5f3e..97a53b7b1ba1a3d6cdb90d55b2fbcef4d44780d3 100644 |
--- a/cc/animation/layer_animation_controller.cc |
+++ b/cc/animation/layer_animation_controller.cc |
@@ -501,6 +501,20 @@ bool LayerAnimationController::HasOnlyTranslationTransforms() const { |
return true; |
} |
+bool LayerAnimationController::AnimationsPreserveAxisAlignment() const { |
+ for (size_t i = 0; i < animations_.size(); ++i) { |
+ if (animations_[i]->is_finished() || |
+ animations_[i]->target_property() != Animation::Transform) |
+ continue; |
+ |
+ const TransformAnimationCurve* transform_animation_curve = |
+ animations_[i]->curve()->ToTransformAnimationCurve(); |
+ if (!transform_animation_curve->PreservesAxisAlignment()) return false; |
+ } |
+ |
+ return true; |
+} |
+ |
bool LayerAnimationController::MaximumTargetScale(float* max_scale) const { |
*max_scale = 0.f; |
for (size_t i = 0; i < animations_.size(); ++i) { |