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

Side by Side 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: Corrected checks in ShareSameAxis 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Needed on Windows to get |M_PI| from <cmath> 5 // Needed on Windows to get |M_PI| from <cmath>
6 #ifdef _WIN32 6 #ifdef _WIN32
7 #define _USE_MATH_DEFINES 7 #define _USE_MATH_DEFINES
8 #endif 8 #endif
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 23 matching lines...) Expand all
34 34
35 static bool ShareSameAxis(const TransformOperation* from, 35 static bool ShareSameAxis(const TransformOperation* from,
36 const TransformOperation* to, 36 const TransformOperation* to,
37 SkMScalar* axis_x, 37 SkMScalar* axis_x,
38 SkMScalar* axis_y, 38 SkMScalar* axis_y,
39 SkMScalar* axis_z, 39 SkMScalar* axis_z,
40 SkMScalar* angle_from) { 40 SkMScalar* angle_from) {
41 if (IsOperationIdentity(from) && IsOperationIdentity(to)) 41 if (IsOperationIdentity(from) && IsOperationIdentity(to))
42 return false; 42 return false;
43 43
44 if (IsOperationIdentity(from) && !IsOperationIdentity(to)) { 44 if (!from && !IsOperationIdentity(to)) {
45 *axis_x = to->rotate.axis.x; 45 *axis_x = to->rotate.axis.x;
46 *axis_y = to->rotate.axis.y; 46 *axis_y = to->rotate.axis.y;
47 *axis_z = to->rotate.axis.z; 47 *axis_z = to->rotate.axis.z;
48 *angle_from = 0; 48 *angle_from = 0;
49 return true; 49 return true;
50 } 50 }
51 51
52 if (!IsOperationIdentity(from) && IsOperationIdentity(to)) { 52 if (!IsOperationIdentity(from) && !to) {
53 *axis_x = from->rotate.axis.x; 53 *axis_x = from->rotate.axis.x;
54 *axis_y = from->rotate.axis.y; 54 *axis_y = from->rotate.axis.y;
55 *axis_z = from->rotate.axis.z; 55 *axis_z = from->rotate.axis.z;
56 *angle_from = from->rotate.angle; 56 *angle_from = from->rotate.angle;
57 return true; 57 return true;
58 } 58 }
59 59
60 SkMScalar length_2 = from->rotate.axis.x * from->rotate.axis.x + 60 SkMScalar length_2 = from->rotate.axis.x * from->rotate.axis.x +
61 from->rotate.axis.y * from->rotate.axis.y + 61 from->rotate.axis.y * from->rotate.axis.y +
62 from->rotate.axis.z * from->rotate.axis.z; 62 from->rotate.axis.z * from->rotate.axis.z;
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 return true; 430 return true;
431 } 431 }
432 case TransformOperation::TRANSFORM_OPERATION_MATRIX: 432 case TransformOperation::TRANSFORM_OPERATION_MATRIX:
433 return false; 433 return false;
434 } 434 }
435 NOTREACHED(); 435 NOTREACHED();
436 return false; 436 return false;
437 } 437 }
438 438
439 } // namespace cc 439 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/animation/transform_operations.cc » ('j') | cc/animation/transform_operations.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698