| 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 #include "cc/animation/transform_operations.h" | 5 #include "cc/animation/transform_operations.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/gfx/animation/tween.h" | 9 #include "ui/gfx/animation/tween.h" |
| 10 #include "ui/gfx/geometry/box_f.h" | 10 #include "ui/gfx/geometry/box_f.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 to_add.type = TransformOperation::TRANSFORM_OPERATION_SCALE; | 217 to_add.type = TransformOperation::TRANSFORM_OPERATION_SCALE; |
| 218 to_add.scale.x = x; | 218 to_add.scale.x = x; |
| 219 to_add.scale.y = y; | 219 to_add.scale.y = y; |
| 220 to_add.scale.z = z; | 220 to_add.scale.z = z; |
| 221 operations_.push_back(to_add); | 221 operations_.push_back(to_add); |
| 222 decomposed_transform_dirty_ = true; | 222 decomposed_transform_dirty_ = true; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void TransformOperations::AppendSkew(SkMScalar x, SkMScalar y) { | 225 void TransformOperations::AppendSkew(SkMScalar x, SkMScalar y) { |
| 226 TransformOperation to_add; | 226 TransformOperation to_add; |
| 227 to_add.matrix.SkewX(x); | 227 to_add.matrix.Skew(x, y); |
| 228 to_add.matrix.SkewY(y); | |
| 229 to_add.type = TransformOperation::TRANSFORM_OPERATION_SKEW; | 228 to_add.type = TransformOperation::TRANSFORM_OPERATION_SKEW; |
| 230 to_add.skew.x = x; | 229 to_add.skew.x = x; |
| 231 to_add.skew.y = y; | 230 to_add.skew.y = y; |
| 232 operations_.push_back(to_add); | 231 operations_.push_back(to_add); |
| 233 decomposed_transform_dirty_ = true; | 232 decomposed_transform_dirty_ = true; |
| 234 } | 233 } |
| 235 | 234 |
| 236 void TransformOperations::AppendPerspective(SkMScalar depth) { | 235 void TransformOperations::AppendPerspective(SkMScalar depth) { |
| 237 TransformOperation to_add; | 236 TransformOperation to_add; |
| 238 to_add.matrix.ApplyPerspectiveDepth(depth); | 237 to_add.matrix.ApplyPerspectiveDepth(depth); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 decomposed_transform_.reset(new gfx::DecomposedTransform()); | 306 decomposed_transform_.reset(new gfx::DecomposedTransform()); |
| 308 gfx::Transform transform = Apply(); | 307 gfx::Transform transform = Apply(); |
| 309 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform)) | 308 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform)) |
| 310 return false; | 309 return false; |
| 311 decomposed_transform_dirty_ = false; | 310 decomposed_transform_dirty_ = false; |
| 312 } | 311 } |
| 313 return true; | 312 return true; |
| 314 } | 313 } |
| 315 | 314 |
| 316 } // namespace cc | 315 } // namespace cc |
| OLD | NEW |