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

Unified Diff: gm/arithmode.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/arithmode.cpp
diff --git a/gm/arithmode.cpp b/gm/arithmode.cpp
index bddd2005f83fbfbeb199e0b17255801a761beddf..cd074d4b12cd7eb17489e545a7c666d763abd9ec 100644
--- a/gm/arithmode.cpp
+++ b/gm/arithmode.cpp
@@ -110,9 +110,8 @@ protected:
SkRect rect = SkRect::MakeXYWH(x, y, SkIntToScalar(WW), SkIntToScalar(HH));
canvas->saveLayer(&rect, nullptr);
canvas->drawBitmap(dst, x, y, nullptr);
- SkXfermode* xfer = SkArithmeticMode::Create(k[0], k[1], k[2], k[3]);
SkPaint paint;
- paint.setXfermode(xfer)->unref();
+ paint.setXfermode(SkArithmeticMode::Make(k[0], k[1], k[2], k[3]));
canvas->drawBitmap(src, x, y, &paint);
canvas->restore();
x += gap;
@@ -133,13 +132,11 @@ protected:
x += gap;
SkRect rect = SkRect::MakeXYWH(x, y, SkIntToScalar(WW), SkIntToScalar(HH));
canvas->saveLayer(&rect, nullptr);
- SkXfermode* xfer1 = SkArithmeticMode::Create(0, -one / 2, 0, 1, enforcePMColor);
SkPaint paint1;
- paint1.setXfermode(xfer1)->unref();
+ paint1.setXfermode(SkArithmeticMode::Make(0, -one / 2, 0, 1, enforcePMColor));
canvas->drawBitmap(dst, x, y, &paint1);
- SkXfermode* xfer2 = SkArithmeticMode::Create(0, one / 2, -one, 1);
SkPaint paint2;
- paint2.setXfermode(xfer2)->unref();
+ paint2.setXfermode(SkArithmeticMode::Make(0, one / 2, -one, 1));
canvas->drawBitmap(dst, x, y, &paint2);
canvas->restore();
x += gap;

Powered by Google App Engine
This is Rietveld 408576698