aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkPaintImageFilter.h
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 /include/effects/SkPaintImageFilter.h
parent2e77ddbb5e7274a83724ceaa5680f367e54163d4 (diff)
Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp
Diffstat (limited to 'include/effects/SkPaintImageFilter.h')
-rw-r--r--include/effects/SkPaintImageFilter.h10
1 files changed, 9 insertions, 1 deletions
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&,