diff options
author | robertphillips <robertphillips@google.com> | 2016-04-17 14:27:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-17 14:27:05 -0700 |
commit | 225db4441e0cb887d52c906e8bb39df506304b3e (patch) | |
tree | d76da5559730f212ec2fbf4912d68875a0515a2f /src/core/SkLocalMatrixImageFilter.cpp | |
parent | 6fb3cd7209849e665635ac17ef4eef4ad63e7f61 (diff) |
Outline SkImageFilter Make methods
Mainly mechanical CL.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1893973002
Review URL: https://codereview.chromium.org/1893973002
Diffstat (limited to 'src/core/SkLocalMatrixImageFilter.cpp')
-rw-r--r-- | src/core/SkLocalMatrixImageFilter.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/SkLocalMatrixImageFilter.cpp b/src/core/SkLocalMatrixImageFilter.cpp index 42acee0c22..b4d5bb2741 100644 --- a/src/core/SkLocalMatrixImageFilter.cpp +++ b/src/core/SkLocalMatrixImageFilter.cpp @@ -10,6 +10,20 @@ #include "SkSpecialImage.h" #include "SkString.h" +sk_sp<SkImageFilter> SkLocalMatrixImageFilter::Make(const SkMatrix& localM, + sk_sp<SkImageFilter> input) { + if (!input) { + return nullptr; + } + if (localM.getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)) { + return nullptr; + } + if (localM.isIdentity()) { + return input; + } + return sk_sp<SkImageFilter>(new SkLocalMatrixImageFilter(localM, input)); +} + SkLocalMatrixImageFilter::SkLocalMatrixImageFilter(const SkMatrix& localM, sk_sp<SkImageFilter> input) : INHERITED(&input, 1, nullptr) |