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

Unified Diff: cc/animation/transform_operations.cc

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/transform_operations.h ('k') | cc/cc_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/transform_operations.cc
diff --git a/cc/animation/transform_operations.cc b/cc/animation/transform_operations.cc
index 7bc4ce2ab6926dc7ba234a73ce094af1c4b04445..d9d58f2d36bbde4d74bb0f5bf6b35db99ea59876 100644
--- a/cc/animation/transform_operations.cc
+++ b/cc/animation/transform_operations.cc
@@ -94,6 +94,27 @@ bool TransformOperations::AffectsScale() const {
return false;
}
+bool TransformOperations::PreservesAxisAlignment() const {
+ for (size_t i = 0; i < operations_.size(); ++i) {
+ switch (operations_[i].type) {
+ case TransformOperation::TransformOperationIdentity:
+ case TransformOperation::TransformOperationTranslate:
+ case TransformOperation::TransformOperationScale:
+ continue;
+ case TransformOperation::TransformOperationMatrix:
+ if (!operations_[i].matrix.IsIdentity() &&
+ !operations_[i].matrix.IsScaleOrTranslation())
+ return false;
+ continue;
+ case TransformOperation::TransformOperationRotate:
+ case TransformOperation::TransformOperationSkew:
+ case TransformOperation::TransformOperationPerspective:
+ return false;
+ }
+ }
+ return true;
+}
+
bool TransformOperations::IsTranslation() const {
for (size_t i = 0; i < operations_.size(); ++i) {
switch (operations_[i].type) {
« no previous file with comments | « cc/animation/transform_operations.h ('k') | cc/cc_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698