diff options
author | 2015-03-26 19:57:08 -0700 | |
---|---|---|
committer | 2015-03-26 19:57:08 -0700 | |
commit | 1d24b8dfe9aac9cadaf3914b8574a4ff6e9bc19d (patch) | |
tree | 19239f2bd95cbdac37f3ec58149fdd30ecd11fe6 /include | |
parent | 41f88f0251cf48eb06f3f8d143aac8562a230889 (diff) |
Add matrix constructing helpers to SkMatrix
Review URL: https://codereview.chromium.org/1034273002
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkMatrix.h | 12 |
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. */ |