Index: include/effects/SkBlurImageFilter.h |
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h |
index 682c08f29400f4183cbb0f88029dbe1075cd60cc..607e76de513e4fb8c92bf04921d5d836b275f6cc 100644 |
--- a/include/effects/SkBlurImageFilter.h |
+++ b/include/effects/SkBlurImageFilter.h |
@@ -13,12 +13,12 @@ |
class SK_API SkBlurImageFilter : public SkImageFilter { |
public: |
- static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input = NULL, |
- const CropRect* cropRect = NULL) { |
+ static sk_sp<SkImageFilter> Make(SkScalar sigmaX, SkScalar sigmaY, sk_sp<SkImageFilter> input, |
+ const CropRect* cropRect = nullptr) { |
if (0 == sigmaX && 0 == sigmaY && nullptr == cropRect) { |
- return SkSafeRef(input); |
+ return input; |
} |
- return new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect); |
+ return sk_sp<SkImageFilter>(new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect)); |
} |
SkRect computeFastBounds(const SkRect&) const override; |
@@ -26,6 +26,13 @@ public: |
SK_TO_STRING_OVERRIDE() |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) |
+#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR |
+ static SkImageFilter* Create(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input = nullptr, |
+ const CropRect* cropRect = nullptr) { |
+ return Make(sigmaX, sigmaY, sk_ref_sp<SkImageFilter>(input), cropRect).release(); |
+ } |
+#endif |
+ |
protected: |
void flatten(SkWriteBuffer&) const override; |
sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, |
@@ -35,7 +42,7 @@ protected: |
private: |
SkBlurImageFilter(SkScalar sigmaX, |
SkScalar sigmaY, |
- SkImageFilter* input, |
+ sk_sp<SkImageFilter> input, |
const CropRect* cropRect); |
SkSize fSigma; |