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

Unified Diff: include/effects/SkTileImageFilter.h

Issue 1882113002: Update TileImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT 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/tileimagefilter.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/SkTileImageFilter.h
diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h
index 1fccac68b4892b5873b28c7c7a1047b4b38f858f..ae951e318b7b956e4694fecb4590e4b832f9a58d 100644
--- a/include/effects/SkTileImageFilter.h
+++ b/include/effects/SkTileImageFilter.h
@@ -17,7 +17,9 @@ public:
@param dst Defines the pixels where tiles are drawn
@param input Input from which the subregion defined by srcRect will be tiled
*/
- static SkImageFilter* Create(const SkRect& src, const SkRect& dst, SkImageFilter* input);
+ static sk_sp<SkImageFilter> Make(const SkRect& src,
+ const SkRect& dst,
+ sk_sp<SkImageFilter> input);
SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override;
SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override;
@@ -26,6 +28,12 @@ public:
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter)
+#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
+ static SkImageFilter* Create(const SkRect& src, const SkRect& dst, SkImageFilter* input) {
+ return Make(src, dst, sk_ref_sp<SkImageFilter>(input)).release();
+ }
+#endif
+
protected:
void flatten(SkWriteBuffer& buffer) const override;
@@ -33,8 +41,8 @@ protected:
SkIPoint* offset) const override;
private:
- SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilter* input)
- : INHERITED(1, &input, NULL), fSrcRect(srcRect), fDstRect(dstRect) {}
+ SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, sk_sp<SkImageFilter> input)
+ : INHERITED(&input, 1, nullptr), fSrcRect(srcRect), fDstRect(dstRect) {}
SkRect fSrcRect;
SkRect fDstRect;
« no previous file with comments | « gm/tileimagefilter.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698