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

Unified Diff: include/client/android/SkAvoidXfermode.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
Index: include/client/android/SkAvoidXfermode.h
diff --git a/include/client/android/SkAvoidXfermode.h b/include/client/android/SkAvoidXfermode.h
index 34deb8f02fd6b4bf7128e05ee77a18ca77714746..b752d07c403750205784483bccd39bd8bf0d02dd 100644
--- a/include/client/android/SkAvoidXfermode.h
+++ b/include/client/android/SkAvoidXfermode.h
@@ -39,9 +39,14 @@ public:
Tolerance near 0: draw only on colors that are nearly identical to the op-color
Tolerance near 255: draw on any colors even remotely similar to the op-color
*/
+ static sk_sp<SkXfermode> Make(SkColor opColor, U8CPU tolerance, Mode mode) {
+ return sk_sp<SkXfermode>(new SkAvoidXfermode(opColor, tolerance, mode));
+ }
+#ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR
static SkAvoidXfermode* Create(SkColor opColor, U8CPU tolerance, Mode mode) {
- return new SkAvoidXfermode(opColor, tolerance, mode);
+ return (SkAvoidXfermode*)(Make(opColor, tolerance, mode).release());
}
+#endif
// overrides from SkXfermode
void xfer32(SkPMColor dst[], const SkPMColor src[], int count,

Powered by Google App Engine
This is Rietveld 408576698