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

Unified Diff: include/effects/SkDropShadowImageFilter.h

Issue 1861843002: Update DropShadowImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review issues Created 4 years, 8 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/imagefilterstransformed.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/SkDropShadowImageFilter.h
diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h
index 7f1aa332208c62a79e1849c6fb1759fe12d0da36..a4726f3247f8207b78c5bf157de375034d9a3c1b 100644
--- a/include/effects/SkDropShadowImageFilter.h
+++ b/include/effects/SkDropShadowImageFilter.h
@@ -23,17 +23,30 @@ public:
static const int kShadowModeCount = kLast_ShadowMode+1;
- static SkImageFilter* Create(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY,
- SkColor color, ShadowMode shadowMode, SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL) {
- return new SkDropShadowImageFilter(dx, dy, sigmaX, sigmaY, color, shadowMode, input,
- cropRect);
+ static sk_sp<SkImageFilter> Make(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY,
+ SkColor color, ShadowMode shadowMode,
+ sk_sp<SkImageFilter> input,
+ const CropRect* cropRect = nullptr) {
+ return sk_sp<SkImageFilter>(new SkDropShadowImageFilter(dx, dy, sigmaX, sigmaY,
+ color, shadowMode,
+ std::move(input),
+ cropRect));
}
SkRect computeFastBounds(const SkRect&) const override;
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDropShadowImageFilter)
+#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
+ static SkImageFilter* Create(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY,
+ SkColor color, ShadowMode shadowMode,
+ SkImageFilter* input = nullptr,
+ const CropRect* cropRect = nullptr) {
+ return Make(dx, dy, sigmaX, sigmaY, color, shadowMode,
+ sk_ref_sp<SkImageFilter>(input), cropRect).release();
+ }
+#endif
+
protected:
void flatten(SkWriteBuffer&) const override;
sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
@@ -42,7 +55,8 @@ protected:
private:
SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor,
- ShadowMode shadowMode, SkImageFilter* input, const CropRect* cropRect);
+ ShadowMode shadowMode, sk_sp<SkImageFilter> input,
+ const CropRect* cropRect);
SkScalar fDx, fDy, fSigmaX, fSigmaY;
SkColor fColor;
« no previous file with comments | « gm/imagefilterstransformed.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698