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/box_f.h" | 10 #include "ui/gfx/box_f.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 size_t num_operations = | 61 size_t num_operations = |
62 std::max(from_identity ? 0 : from.operations_.size(), | 62 std::max(from_identity ? 0 : from.operations_.size(), |
63 to_identity ? 0 : operations_.size()); | 63 to_identity ? 0 : operations_.size()); |
64 | 64 |
65 // Because we are squashing all of the matrices together when applying | 65 // Because we are squashing all of the matrices together when applying |
66 // them to the animation, we must apply them in reverse order when | 66 // them to the animation, we must apply them in reverse order when |
67 // not squashing them. | 67 // not squashing them. |
68 for (int i = num_operations - 1; i >= 0; --i) { | 68 for (int i = num_operations - 1; i >= 0; --i) { |
69 gfx::BoxF bounds_for_operation; | 69 gfx::BoxF bounds_for_operation; |
70 const TransformOperation* from_op = | 70 const TransformOperation* from_op = |
71 from_identity ? NULL : &from.operations_[i]; | 71 from_identity ? nullptr : &from.operations_[i]; |
72 const TransformOperation* to_op = to_identity ? NULL : &operations_[i]; | 72 const TransformOperation* to_op = to_identity ? nullptr : &operations_[i]; |
73 if (!TransformOperation::BlendedBoundsForBox(*bounds, | 73 if (!TransformOperation::BlendedBoundsForBox(*bounds, |
74 from_op, | 74 from_op, |
75 to_op, | 75 to_op, |
76 min_progress, | 76 min_progress, |
77 max_progress, | 77 max_progress, |
78 &bounds_for_operation)) | 78 &bounds_for_operation)) |
79 return false; | 79 return false; |
80 *bounds = bounds_for_operation; | 80 *bounds = bounds_for_operation; |
81 } | 81 } |
82 | 82 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 decomposed_transform_.reset(new gfx::DecomposedTransform()); | 324 decomposed_transform_.reset(new gfx::DecomposedTransform()); |
325 gfx::Transform transform = Apply(); | 325 gfx::Transform transform = Apply(); |
326 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform)) | 326 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform)) |
327 return false; | 327 return false; |
328 decomposed_transform_dirty_ = false; | 328 decomposed_transform_dirty_ = false; |
329 } | 329 } |
330 return true; | 330 return true; |
331 } | 331 } |
332 | 332 |
333 } // namespace cc | 333 } // namespace cc |
OLD | NEW |