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

Unified Diff: include/effects/SkXfermodeImageFilter.h

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 9 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 | « include/effects/SkArithmeticMode.h ('k') | public.bzl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « include/effects/SkArithmeticMode.h ('k') | public.bzl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698