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

Unified Diff: cc/animation/transform_operation.cc

Issue 1194073007: Fix for bug where composited rotate3d should SLERP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/transform_operation.cc
diff --git a/cc/animation/transform_operation.cc b/cc/animation/transform_operation.cc
index 7421924aedcea56ef9658d47bc2e4c77225404d2..e3b28d965a46733496e25d46bf1af5735d53b3f9 100644
--- a/cc/animation/transform_operation.cc
+++ b/cc/animation/transform_operation.cc
@@ -32,6 +32,12 @@ static bool IsOperationIdentity(const TransformOperation* operation) {
return !operation || operation->IsIdentity();
}
+static bool Is3DRotation(const TransformOperation* operation) {
+ if (IsOperationIdentity(operation))
+ return false;
+ return operation->rotate.axis.x != 0 || operation->rotate.axis.y != 0;
+}
+
static bool ShareSameAxis(const TransformOperation* from,
const TransformOperation* to,
SkMScalar* axis_x,
@@ -124,7 +130,8 @@ bool TransformOperation::BlendTransformOperations(
SkMScalar axis_z = 1;
SkMScalar from_angle = 0;
SkMScalar to_angle = IsOperationIdentity(to) ? 0 : to->rotate.angle;
- if (ShareSameAxis(from, to, &axis_x, &axis_y, &axis_z, &from_angle)) {
+ if (ShareSameAxis(from, to, &axis_x, &axis_y, &axis_z, &from_angle) &&
+ !Is3DRotation(from) && !Is3DRotation(to)) {
ajuma 2015/06/23 13:24:58 I'm not sure I follow how this corresponds to the
soonm 2015/06/23 23:43:42 Thanks ajuma, I think you're right. I misunderstoo
result->RotateAbout(gfx::Vector3dF(axis_x, axis_y, axis_z),
BlendSkMScalars(from_angle, to_angle, progress));
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698