Index: include/effects/SkXfermodeImageFilter.h |
diff --git a/include/effects/SkXfermodeImageFilter.h b/include/effects/SkXfermodeImageFilter.h |
index 6df7903fa4474127d4fa5f9cf6dec953a4ca7233..f1e5d71070a9537300dbe62d2ff40d23650b0a8b 100644 |
--- a/include/effects/SkXfermodeImageFilter.h |
+++ b/include/effects/SkXfermodeImageFilter.h |
@@ -21,13 +21,19 @@ class SK_API SkXfermodeImageFilter : public SkImageFilter { |
*/ |
public: |
+ static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, SkImageFilter* background, |
dogben
2016/04/01 20:08:52
Shouldn't this accept background and foreground as
reed1
2016/04/02 14:26:56
Indeed. Subsequent changes will fix those. Since (
robertphillips
2016/04/03 18:26:46
Yep - I'm slowly churning my way through all the I
|
+ SkImageFilter* foreground, const CropRect* cropRect); |
+ static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, SkImageFilter* background) { |
+ return Make(std::move(mode), background, nullptr, nullptr); |
+ } |
+#ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR |
static SkImageFilter* Create(SkXfermode* mode, SkImageFilter* background, |
SkImageFilter* foreground = NULL, |
const CropRect* cropRect = NULL) { |
- SkImageFilter* inputs[2] = { background, foreground }; |
- return new SkXfermodeImageFilter(mode, inputs, cropRect); |
+ return Make(sk_ref_sp(mode), background, foreground, cropRect).release(); |
} |
- |
+#endif |
+ |
SK_TO_STRING_OVERRIDE() |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkXfermodeImageFilter) |
@@ -43,12 +49,12 @@ public: |
#endif |
protected: |
- SkXfermodeImageFilter(SkXfermode* mode, SkImageFilter* inputs[2], |
+ SkXfermodeImageFilter(sk_sp<SkXfermode> mode, SkImageFilter* inputs[2], |
const CropRect* cropRect); |
void flatten(SkWriteBuffer&) const override; |
private: |
- SkAutoTUnref<SkXfermode> fMode; |
+ sk_sp<SkXfermode> fMode; |
typedef SkImageFilter INHERITED; |
}; |