OLD | NEW |
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 result->Scale3d(BlendSkMScalars(from_x, to_x, progress), | 150 result->Scale3d(BlendSkMScalars(from_x, to_x, progress), |
151 BlendSkMScalars(from_y, to_y, progress), | 151 BlendSkMScalars(from_y, to_y, progress), |
152 BlendSkMScalars(from_z, to_z, progress)); | 152 BlendSkMScalars(from_z, to_z, progress)); |
153 break; | 153 break; |
154 } | 154 } |
155 case TransformOperation::TRANSFORM_OPERATION_SKEW: { | 155 case TransformOperation::TRANSFORM_OPERATION_SKEW: { |
156 SkMScalar from_x = IsOperationIdentity(from) ? 0 : from->skew.x; | 156 SkMScalar from_x = IsOperationIdentity(from) ? 0 : from->skew.x; |
157 SkMScalar from_y = IsOperationIdentity(from) ? 0 : from->skew.y; | 157 SkMScalar from_y = IsOperationIdentity(from) ? 0 : from->skew.y; |
158 SkMScalar to_x = IsOperationIdentity(to) ? 0 : to->skew.x; | 158 SkMScalar to_x = IsOperationIdentity(to) ? 0 : to->skew.x; |
159 SkMScalar to_y = IsOperationIdentity(to) ? 0 : to->skew.y; | 159 SkMScalar to_y = IsOperationIdentity(to) ? 0 : to->skew.y; |
160 result->SkewX(BlendSkMScalars(from_x, to_x, progress)); | 160 result->Skew(BlendSkMScalars(from_x, to_x, progress), |
161 result->SkewY(BlendSkMScalars(from_y, to_y, progress)); | 161 BlendSkMScalars(from_y, to_y, progress)); |
162 break; | 162 break; |
163 } | 163 } |
164 case TransformOperation::TRANSFORM_OPERATION_PERSPECTIVE: { | 164 case TransformOperation::TRANSFORM_OPERATION_PERSPECTIVE: { |
165 SkMScalar from_perspective_depth = | 165 SkMScalar from_perspective_depth = |
166 IsOperationIdentity(from) ? std::numeric_limits<SkMScalar>::max() | 166 IsOperationIdentity(from) ? std::numeric_limits<SkMScalar>::max() |
167 : from->perspective_depth; | 167 : from->perspective_depth; |
168 SkMScalar to_perspective_depth = | 168 SkMScalar to_perspective_depth = |
169 IsOperationIdentity(to) ? std::numeric_limits<SkMScalar>::max() | 169 IsOperationIdentity(to) ? std::numeric_limits<SkMScalar>::max() |
170 : to->perspective_depth; | 170 : to->perspective_depth; |
171 if (from_perspective_depth == 0.f || to_perspective_depth == 0.f) | 171 if (from_perspective_depth == 0.f || to_perspective_depth == 0.f) |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |