aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkTileImageFilter.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-15 07:57:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-15 07:57:40 -0700
commit534c270465a9824893d5c9d6c5bacef7726cc389 (patch)
tree8d189a3c806f2fc2232cd6bea5bc344cd9b53c3f /include/effects/SkTileImageFilter.h
parentbfe11fc9a6e660f83a454b6a5f5945089a4800f3 (diff)
Update TileImageFilter to sk_sp
Diffstat (limited to 'include/effects/SkTileImageFilter.h')
-rw-r--r--include/effects/SkTileImageFilter.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h
index 1fccac68b4..ae951e318b 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;