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/transform_util.h" | 9 #include "ui/gfx/transform_util.h" |
10 #include "ui/gfx/vector3d_f.h" | 10 #include "ui/gfx/vector3d_f.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 if (MatchesTypes(from)) { | 150 if (MatchesTypes(from)) { |
151 size_t num_operations = | 151 size_t num_operations = |
152 std::max(from_identity ? 0 : from.operations_.size(), | 152 std::max(from_identity ? 0 : from.operations_.size(), |
153 to_identity ? 0 : operations_.size()); | 153 to_identity ? 0 : operations_.size()); |
154 for (size_t i = 0; i < num_operations; ++i) { | 154 for (size_t i = 0; i < num_operations; ++i) { |
155 gfx::Transform blended; | 155 gfx::Transform blended; |
156 if (!TransformOperation::BlendTransformOperations( | 156 if (!TransformOperation::BlendTransformOperations( |
157 from_identity ? 0 : &from.operations_[i], | 157 from_identity ? 0 : &from.operations_[i], |
158 to_identity ? 0 : &operations_[i], | 158 to_identity ? 0 : &operations_[i], |
159 progress, | 159 progress, |
160 blended)) | 160 &blended)) |
161 return false; | 161 return false; |
162 result->PreconcatTransform(blended); | 162 result->PreconcatTransform(blended); |
163 } | 163 } |
164 return true; | 164 return true; |
165 } | 165 } |
166 | 166 |
167 if (progress <= 0.0) { | 167 if (progress <= 0.0) { |
168 *result = from.Apply(); | 168 *result = from.Apply(); |
169 return true; | 169 return true; |
170 } | 170 } |
(...skipping 23 matching lines...) Expand all Loading... |
194 decomposed_transform_.reset(new gfx::DecomposedTransform()); | 194 decomposed_transform_.reset(new gfx::DecomposedTransform()); |
195 gfx::Transform transform = Apply(); | 195 gfx::Transform transform = Apply(); |
196 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform)) | 196 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform)) |
197 return false; | 197 return false; |
198 decomposed_transform_dirty_ = false; | 198 decomposed_transform_dirty_ = false; |
199 } | 199 } |
200 return true; | 200 return true; |
201 } | 201 } |
202 | 202 |
203 } // namespace cc | 203 } // namespace cc |
OLD | NEW |