aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-03-26 19:57:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-26 19:57:08 -0700
commit1d24b8dfe9aac9cadaf3914b8574a4ff6e9bc19d (patch)
tree19239f2bd95cbdac37f3ec58149fdd30ecd11fe6 /include
parent41f88f0251cf48eb06f3f8d143aac8562a230889 (diff)
Add matrix constructing helpers to SkMatrix
Diffstat (limited to 'include')
-rw-r--r--include/core/SkMatrix.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index d00beda373..89bd7935c9 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -23,6 +23,18 @@ class SkString;
*/
class SK_API SkMatrix {
public:
+ static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy) {
+ SkMatrix m;
+ m.setScale(sx, sy);
+ return m;
+ }
+
+ static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkScalar dx, SkScalar dy) {
+ SkMatrix m;
+ m.setTranslate(dx, dy);
+ return m;
+ }
+
/** Enum of bit fields for the mask return by getType().
Use this to identify the complexity of the matrix.
*/