Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: include/effects/SkBlurImageFilter.h

Issue 1852743002: Update SkBlurImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT & address code review comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/testimagefilters.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « gm/testimagefilters.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698