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

Unified Diff: gm/avoidxfermode.cpp

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: gm/avoidxfermode.cpp
diff --git a/gm/avoidxfermode.cpp b/gm/avoidxfermode.cpp
index d224b4e2d05d56808b76e9e2d2e700e970215fea..8e8dc2855372343970abc426679e9f0f6019f77e 100644
--- a/gm/avoidxfermode.cpp
+++ b/gm/avoidxfermode.cpp
@@ -37,9 +37,7 @@ protected:
// UL corner: replace white with black with a tight tolerance
SkPaint p1;
p1.setColor(SK_ColorBLACK);
- p1.setXfermode(SkAvoidXfermode::Create(SK_ColorWHITE,
- 5,
- SkAvoidXfermode::kTargetColor_Mode))->unref();
+ p1.setXfermode(SkAvoidXfermode::Make(SK_ColorWHITE, 5, SkAvoidXfermode::kTargetColor_Mode));
canvas->drawRect(r, p1);
@@ -48,9 +46,8 @@ protected:
// UR corner: draw black everywhere except white with a tight tolerance
SkPaint p2;
p2.setColor(SK_ColorBLACK);
- p2.setXfermode(SkAvoidXfermode::Create(SK_ColorWHITE,
- 250,
- SkAvoidXfermode::kAvoidColor_Mode))->unref();
+ p2.setXfermode(SkAvoidXfermode::Make(SK_ColorWHITE, 250,
+ SkAvoidXfermode::kAvoidColor_Mode));
canvas->drawRect(r, p2);
@@ -59,9 +56,7 @@ protected:
// LL corner: replace red with transparent blue with a loose tolerance
SkPaint p3;
p3.setColor(0x7F0000FF);
- p3.setXfermode(SkAvoidXfermode::Create(SK_ColorRED,
- 250,
- SkAvoidXfermode::kTargetColor_Mode))->unref();
+ p3.setXfermode(SkAvoidXfermode::Make(SK_ColorRED, 250, SkAvoidXfermode::kTargetColor_Mode));
canvas->drawRect(r, p3);
@@ -70,9 +65,7 @@ protected:
// LR corner: draw black everywhere except red with a loose tolerance
SkPaint p4;
p4.setColor(SK_ColorBLACK);
- p4.setXfermode(SkAvoidXfermode::Create(SK_ColorRED,
- 5,
- SkAvoidXfermode::kAvoidColor_Mode))->unref();
+ p4.setXfermode(SkAvoidXfermode::Make(SK_ColorRED, 5, SkAvoidXfermode::kAvoidColor_Mode));
canvas->drawRect(r, p4);
}
« no previous file with comments | « gm/arithmode.cpp ('k') | gm/avoidxfermode2.cpp » ('j') | include/effects/SkXfermodeImageFilter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698