aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-03-29 13:54:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-29 13:54:26 -0700
commita33cf07a2273315363c0b6fb5d3ce811742f5a85 (patch)
treec3eab040c77ea20073c82c3eaa3711f203468d6d /include
parent9b2ef62d4708081979ff954e1ac0623d1d4ffada (diff)
Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp
Diffstat (limited to 'include')
-rw-r--r--include/core/SkImageFilter.h12
-rw-r--r--include/effects/SkPaintImageFilter.h10
2 files changed, 19 insertions, 3 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index ab72547fed..f4273cb8da 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -255,7 +255,13 @@ public:
* If this filter can be represented by another filter + a localMatrix, return that filter,
* else return null.
*/
- SkImageFilter* newWithLocalMatrix(const SkMatrix& matrix) const;
+ sk_sp<SkImageFilter> makeWithLocalMatrix(const SkMatrix&) const;
+
+#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
+ SkImageFilter* newWithLocalMatrix(const SkMatrix& matrix) const {
+ this->makeWithLocalMatrix(matrix).release();
+ }
+#endif
/**
* Create an SkMatrixImageFilter, which transforms its input by the given matrix.
@@ -320,7 +326,9 @@ protected:
void allocInputs(int count);
};
- SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect = NULL);
+ SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect = nullptr);
+
+ SkImageFilter(sk_sp<SkImageFilter>* inputs, int inputCount, const CropRect* cropRect);
virtual ~SkImageFilter();
diff --git a/include/effects/SkPaintImageFilter.h b/include/effects/SkPaintImageFilter.h
index 51d375f44d..2876c0431b 100644
--- a/include/effects/SkPaintImageFilter.h
+++ b/include/effects/SkPaintImageFilter.h
@@ -22,13 +22,21 @@ public:
* not specified, the source primitive's bounds are used
* instead.
*/
- static SkImageFilter* Create(const SkPaint& paint, const CropRect* rect = NULL);
+ static sk_sp<SkImageFilter> Make(const SkPaint& paint, const CropRect* cropRect = nullptr) {
+ return sk_sp<SkImageFilter>(new SkPaintImageFilter(paint, cropRect));
+ }
bool canComputeFastBounds() const override;
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPaintImageFilter)
+#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
+ static SkImageFilter* Create(const SkPaint& paint, const CropRect* rect = nullptr) {
+ return Make(paint, rect).release();
+ }
+#endif
+
protected:
void flatten(SkWriteBuffer&) const override;
sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,