aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLocalMatrixImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-17 14:27:05 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-17 14:27:05 -0700
commit225db4441e0cb887d52c906e8bb39df506304b3e (patch)
treed76da5559730f212ec2fbf4912d68875a0515a2f /src/core/SkLocalMatrixImageFilter.cpp
parent6fb3cd7209849e665635ac17ef4eef4ad63e7f61 (diff)
Outline SkImageFilter Make methods
Diffstat (limited to 'src/core/SkLocalMatrixImageFilter.cpp')
-rw-r--r--src/core/SkLocalMatrixImageFilter.cpp14
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)