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

Unified Diff: include/effects/SkXfermodeImageFilter.h

Issue 1852123002: Update SkXfermodeImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Overload Make methods 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/xfermodeimagefilter.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/SkXfermodeImageFilter.h
diff --git a/include/effects/SkXfermodeImageFilter.h b/include/effects/SkXfermodeImageFilter.h
index f1e5d71070a9537300dbe62d2ff40d23650b0a8b..634422747a9b86af7d0a4fc6908e225f4affa419 100644
--- a/include/effects/SkXfermodeImageFilter.h
+++ b/include/effects/SkXfermodeImageFilter.h
@@ -21,19 +21,35 @@ class SK_API SkXfermodeImageFilter : public SkImageFilter {
*/
public:
- static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, SkImageFilter* background,
- SkImageFilter* foreground, const CropRect* cropRect);
- static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, SkImageFilter* background) {
- return Make(std::move(mode), background, nullptr, nullptr);
+ static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, sk_sp<SkImageFilter> background,
+ sk_sp<SkImageFilter> foreground, const CropRect* cropRect);
+ static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, sk_sp<SkImageFilter> background) {
+ return Make(std::move(mode), std::move(background), nullptr, nullptr);
}
+
#ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR
static SkImageFilter* Create(SkXfermode* mode, SkImageFilter* background,
SkImageFilter* foreground = NULL,
const CropRect* cropRect = NULL) {
- return Make(sk_ref_sp(mode), background, foreground, cropRect).release();
+ return Make(sk_ref_sp(mode),
+ sk_ref_sp(background),
+ sk_ref_sp(foreground),
+ cropRect).release();
}
#endif
-
+#ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
+ static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, SkImageFilter* background,
+ SkImageFilter* foreground, const CropRect* cropRect) {
+ return Make(std::move(mode),
+ sk_ref_sp(background),
+ sk_ref_sp(foreground),
+ cropRect);
+ }
+ static sk_sp<SkImageFilter> Make(sk_sp<SkXfermode> mode, SkImageFilter* background) {
+ return Make(std::move(mode), sk_ref_sp(background));
+ }
+#endif
+
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkXfermodeImageFilter)
@@ -49,7 +65,7 @@ public:
#endif
protected:
- SkXfermodeImageFilter(sk_sp<SkXfermode> mode, SkImageFilter* inputs[2],
+ SkXfermodeImageFilter(sk_sp<SkXfermode> mode, sk_sp<SkImageFilter> inputs[2],
const CropRect* cropRect);
void flatten(SkWriteBuffer&) const override;
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698