aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils/SkMatrix44.h
diff options
context:
space:
mode:
authorGravatar tfarina <tfarina@chromium.org>2014-10-24 08:07:05 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-24 08:07:05 -0700
commit20b7960798320e6804ffee78fd92e6c001eba30b (patch)
treeea392e016c80d26d7b827085c36ddf4bb824f94a /include/utils/SkMatrix44.h
parentda0de7ed901ee4d4b5c35cec7864ee1e1cb3881b (diff)
Add isScale() helper function to SkMatrix44.
This will be used later in Chromium to cleanup gfx::Transform::IsScale2d(). BUG=408710,skia:997 TEST=None R=bsalomon@google.com,danakj@chromium.org Review URL: https://codereview.chromium.org/676583002
Diffstat (limited to 'include/utils/SkMatrix44.h')
-rw-r--r--include/utils/SkMatrix44.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h
index 553e8d7c4f..90f29a994a 100644
--- a/include/utils/SkMatrix44.h
+++ b/include/utils/SkMatrix44.h
@@ -225,6 +225,13 @@ public:
return !(this->getType() & ~(kScale_Mask | kTranslate_Mask));
}
+ /**
+ * Returns true if the matrix only contains scale or is identity.
+ */
+ inline bool isScale() const {
+ return !(this->getType() & ~kScale_Mask);
+ }
+
inline bool hasPerspective() const {
return SkToBool(this->getType() & kPerspective_Mask);
}