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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 if (from_identity && to_identity) | 270 if (from_identity && to_identity) |
271 return true; | 271 return true; |
272 | 272 |
273 if (MatchesTypes(from)) { | 273 if (MatchesTypes(from)) { |
274 size_t num_operations = | 274 size_t num_operations = |
275 std::max(from_identity ? 0 : from.operations_.size(), | 275 std::max(from_identity ? 0 : from.operations_.size(), |
276 to_identity ? 0 : operations_.size()); | 276 to_identity ? 0 : operations_.size()); |
277 for (size_t i = 0; i < num_operations; ++i) { | 277 for (size_t i = 0; i < num_operations; ++i) { |
278 gfx::Transform blended; | 278 gfx::Transform blended; |
279 if (!TransformOperation::BlendTransformOperations( | 279 if (!TransformOperation::BlendTransformOperations( |
280 from_identity ? 0 : &from.operations_[i], | 280 from.operations_.size() <= i ? 0 : &from.operations_[i], |
281 to_identity ? 0 : &operations_[i], | 281 operations_.size() <= i ? 0 : &operations_[i], progress, |
ajuma
2015/06/24 14:47:45
Please add a test for this change too.
soonm
2015/06/26 07:48:38
The new tests I've added for the corrected shareSa
ajuma
2015/06/26 13:13:31
Ah, of course, thanks for the explanation!
| |
282 progress, | 282 &blended)) |
283 &blended)) | |
284 return false; | 283 return false; |
285 result->PreconcatTransform(blended); | 284 result->PreconcatTransform(blended); |
286 } | 285 } |
287 return true; | 286 return true; |
288 } | 287 } |
289 | 288 |
290 if (!ComputeDecomposedTransform() || !from.ComputeDecomposedTransform()) | 289 if (!ComputeDecomposedTransform() || !from.ComputeDecomposedTransform()) |
291 return false; | 290 return false; |
292 | 291 |
293 gfx::DecomposedTransform to_return; | 292 gfx::DecomposedTransform to_return; |
(...skipping 13 matching lines...) Expand all 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 |