aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLocalMatrixImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-03-30 07:32:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-30 07:32:28 -0700
commit372177ee115d46dfb5bfb881a408e6c37ae83678 (patch)
tree674a01098b007017b989cf8d350398a0c794a345 /src/core/SkLocalMatrixImageFilter.cpp
parent2e77ddbb5e7274a83724ceaa5680f367e54163d4 (diff)
Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp
Diffstat (limited to 'src/core/SkLocalMatrixImageFilter.cpp')
-rw-r--r--src/core/SkLocalMatrixImageFilter.cpp21
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 {