Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1186)

Unified Diff: third_party/WebKit/Source/platform/transforms/RotateTransformOperation.cpp

Issue 1926063004: Don't decompose retargeted rotate() transform transitions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/transitions/retargeted-matching-rotation-transforms.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/transforms/RotateTransformOperation.cpp
diff --git a/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.cpp b/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.cpp
index 653f60a43f5fd52e64b0a0c601cd5faccd003594..9a611905af7f0f5fdb955226af222b0184bb6eae 100644
--- a/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.cpp
+++ b/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.cpp
@@ -21,6 +21,8 @@
#include "platform/transforms/RotateTransformOperation.h"
+#include "platform/animation/AnimationUtilities.h"
+
namespace blink {
bool RotateTransformOperation::operator==(const TransformOperation& other) const
@@ -48,8 +50,14 @@ PassRefPtr<TransformOperation> RotateTransformOperation::blend(const TransformOp
if (!from)
return RotateTransformOperation::create(Rotation(axis(), angle() * progress), m_type);
- return RotateTransformOperation::create(
- Rotation::slerp(toRotateTransformOperation(*from).m_rotation, m_rotation, progress), Rotate3D);
+ const RotateTransformOperation& fromRotate = toRotateTransformOperation(*from);
+ if (type() == Rotate3D) {
+ return RotateTransformOperation::create(
+ Rotation::slerp(fromRotate.m_rotation, m_rotation, progress), Rotate3D);
+ }
+
+ ASSERT(axis() == fromRotate.axis());
+ return RotateTransformOperation::create(Rotation(axis(), blink::blend(fromRotate.angle(), angle(), progress)), m_type);
}
bool RotateTransformOperation::canBlendWith(const TransformOperation& other) const
« no previous file with comments | « third_party/WebKit/LayoutTests/transitions/retargeted-matching-rotation-transforms.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698