diff options
author | robertphillips <robertphillips@google.com> | 2016-03-30 07:32:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-30 07:32:28 -0700 |
commit | 372177ee115d46dfb5bfb881a408e6c37ae83678 (patch) | |
tree | 674a01098b007017b989cf8d350398a0c794a345 /src/core/SkLocalMatrixImageFilter.cpp | |
parent | 2e77ddbb5e7274a83724ceaa5680f367e54163d4 (diff) |
Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842793002
Committed: https://skia.googlesource.com/skia/+/a33cf07a2273315363c0b6fb5d3ce811742f5a85
Review URL: https://codereview.chromium.org/1842793002
Diffstat (limited to 'src/core/SkLocalMatrixImageFilter.cpp')
-rw-r--r-- | src/core/SkLocalMatrixImageFilter.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/core/SkLocalMatrixImageFilter.cpp b/src/core/SkLocalMatrixImageFilter.cpp index 15f2f0ef00..d1b5715b7f 100644 --- a/src/core/SkLocalMatrixImageFilter.cpp +++ b/src/core/SkLocalMatrixImageFilter.cpp @@ -10,21 +10,9 @@ #include "SkSpecialImage.h" #include "SkString.h" -SkImageFilter* SkLocalMatrixImageFilter::Create(const SkMatrix& localM, SkImageFilter* input) { - if (!input) { - return nullptr; - } - if (localM.getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)) { - return nullptr; - } - if (localM.isIdentity()) { - return SkRef(input); - } - return new SkLocalMatrixImageFilter(localM, input); -} - -SkLocalMatrixImageFilter::SkLocalMatrixImageFilter(const SkMatrix& localM, SkImageFilter* input) - : INHERITED(1, &input) +SkLocalMatrixImageFilter::SkLocalMatrixImageFilter(const SkMatrix& localM, + sk_sp<SkImageFilter> input) + : INHERITED(&input, 1, nullptr) , fLocalM(localM) { } @@ -32,7 +20,8 @@ SkFlattenable* SkLocalMatrixImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkMatrix lm; buffer.readMatrix(&lm); - return SkLocalMatrixImageFilter::Create(lm, common.getInput(0)); + return SkLocalMatrixImageFilter::Make(lm, + sk_ref_sp<SkImageFilter>(common.getInput(0))).release(); } void SkLocalMatrixImageFilter::flatten(SkWriteBuffer& buffer) const { |