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..1f9e11294f94b84848ead16391e6c57b692c9b6d 100644 |
--- a/cc/animation/layer_animation_controller.cc |
+++ b/cc/animation/layer_animation_controller.cc |
@@ -501,6 +501,21 @@ 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) { |