aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-05 11:50:42 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-05 11:50:42 -0700
commit5605b56afa5bd89f3148b397318b616fccfd4004 (patch)
tree67be71f4ab5e83d081c1531daeba3caf7dafeb4c /include/effects
parent235cbf23c4836f87a4d53ac48345942ff605a739 (diff)
Update SkColorFilterImageFilter to sk_sp
Diffstat (limited to 'include/effects')
-rw-r--r--include/effects/SkColorFilterImageFilter.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h
index ebe263930d..5ed051c0de 100644
--- a/include/effects/SkColorFilterImageFilter.h
+++ b/include/effects/SkColorFilterImageFilter.h
@@ -14,12 +14,23 @@ class SkColorFilter;
class SK_API SkColorFilterImageFilter : public SkImageFilter {
public:
- static SkImageFilter* Create(SkColorFilter* cf, SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL);
+ static sk_sp<SkImageFilter> Make(sk_sp<SkColorFilter> cf,
+ sk_sp<SkImageFilter> input,
+ const CropRect* cropRect = NULL);
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterImageFilter)
+#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
+ static SkImageFilter* Create(SkColorFilter* cf,
+ SkImageFilter* input = NULL,
+ const CropRect* cropRect = NULL) {
+ return Make(sk_ref_sp<SkColorFilter>(cf),
+ sk_ref_sp<SkImageFilter>(input),
+ cropRect).release();
+ }
+#endif
+
protected:
void flatten(SkWriteBuffer&) const override;
sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
@@ -28,8 +39,8 @@ protected:
bool affectsTransparentBlack() const override;
private:
- SkColorFilterImageFilter(SkColorFilter* cf,
- SkImageFilter* input,
+ SkColorFilterImageFilter(sk_sp<SkColorFilter> cf,
+ sk_sp<SkImageFilter> input,
const CropRect* cropRect);
sk_sp<SkColorFilter> fColorFilter;