Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: cc/animation/transform_operations.cc

Issue 1170953002: Matrix decomposition for mismatched functions in keyframes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing unit_tests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/animation/transform_operations_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 has_scale_component = true; 156 has_scale_component = true;
157 scale->Scale(operations_[i].scale.x, 157 scale->Scale(operations_[i].scale.x,
158 operations_[i].scale.y, 158 operations_[i].scale.y,
159 operations_[i].scale.z); 159 operations_[i].scale.z);
160 } 160 }
161 } 161 }
162 return true; 162 return true;
163 } 163 }
164 164
165 bool TransformOperations::MatchesTypes(const TransformOperations& other) const { 165 bool TransformOperations::MatchesTypes(const TransformOperations& other) const {
166 if (IsIdentity() || other.IsIdentity()) 166 if (operations_.size() == 0 || other.operations_.size() == 0)
167 return true; 167 return true;
168 168
169 if (operations_.size() != other.operations_.size()) 169 if (operations_.size() != other.operations_.size())
170 return false; 170 return false;
171 171
172 for (size_t i = 0; i < operations_.size(); ++i) { 172 for (size_t i = 0; i < operations_.size(); ++i) {
173 if (operations_[i].type != other.operations_[i].type 173 if (operations_[i].type != other.operations_[i].type)
174 && !operations_[i].IsIdentity()
175 && !other.operations_[i].IsIdentity())
176 return false; 174 return false;
177 } 175 }
178 176
179 return true; 177 return true;
180 } 178 }
181 179
182 bool TransformOperations::CanBlendWith( 180 bool TransformOperations::CanBlendWith(
183 const TransformOperations& other) const { 181 const TransformOperations& other) const {
184 gfx::Transform dummy; 182 gfx::Transform dummy;
185 return BlendInternal(other, 0.5, &dummy); 183 return BlendInternal(other, 0.5, &dummy);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 decomposed_transform_.reset(new gfx::DecomposedTransform()); 307 decomposed_transform_.reset(new gfx::DecomposedTransform());
310 gfx::Transform transform = Apply(); 308 gfx::Transform transform = Apply();
311 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform)) 309 if (!gfx::DecomposeTransform(decomposed_transform_.get(), transform))
312 return false; 310 return false;
313 decomposed_transform_dirty_ = false; 311 decomposed_transform_dirty_ = false;
314 } 312 }
315 return true; 313 return true;
316 } 314 }
317 315
318 } // namespace cc 316 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/animation/transform_operations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698