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

Unified Diff: gm/aaxfermodes.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/aaxfermodes.cpp
diff --git a/gm/aaxfermodes.cpp b/gm/aaxfermodes.cpp
index f1264db9646383433149d1f5593933b70e487599..2ea1844e274ebedb584e2885f278ab7c2c94c9f5 100644
--- a/gm/aaxfermodes.cpp
+++ b/gm/aaxfermodes.cpp
@@ -210,7 +210,7 @@ protected:
if (maxSum > 255) {
SkPaint dimPaint;
dimPaint.setAntiAlias(false);
- dimPaint.setXfermode(SkXfermode::Create(SkXfermode::kDstIn_Mode));
+ dimPaint.setXfermode(SkXfermode::Make(SkXfermode::kDstIn_Mode));
if (255 != paint->getAlpha()) {
// Dim the src and dst colors.
dimPaint.setARGB(255 * 255 / maxSum, 0, 0, 0);
@@ -230,13 +230,13 @@ protected:
SkPaint shapePaint(paint);
shapePaint.setAntiAlias(kSquare_Shape != shape);
- SkAutoTUnref<SkXfermode> xfermode;
+ sk_sp<SkXfermode> xfermode;
if (mode <= SkXfermode::kLastMode) {
- xfermode.reset(SkXfermode::Create(mode));
+ xfermode = SkXfermode::Make(mode);
} else {
- xfermode.reset(SkArithmeticMode::Create(+1.0f, +0.25f, -0.5f, +0.1f));
+ xfermode = SkArithmeticMode::Make(+1.0f, +0.25f, -0.5f, +0.1f);
}
- shapePaint.setXfermode(xfermode);
+ shapePaint.setXfermode(std::move(xfermode));
switch (shape) {
case kSquare_Shape:
« no previous file with comments | « gm/aarectmodes.cpp ('k') | gm/arithmode.cpp » ('j') | include/effects/SkXfermodeImageFilter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698