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

Unified Diff: src/core/SkPicturePlayback.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: src/core/SkPicturePlayback.cpp
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index f21ac32b961f0bcec6984951748b925e93e58189..774c2c065a4d1676468fd642ed392a51e030dea6 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -307,15 +307,15 @@ void SkPicturePlayback::handleOp(SkReader32* reader,
texCoords = (const SkPoint*)reader->skip(SkPatchUtils::kNumCorners *
sizeof(SkPoint));
}
- SkAutoTUnref<SkXfermode> xfer;
+ sk_sp<SkXfermode> xfer;
if (flag & DRAW_VERTICES_HAS_XFER) {
int mode = reader->readInt();
if (mode < 0 || mode > SkXfermode::kLastMode) {
mode = SkXfermode::kModulate_Mode;
}
- xfer.reset(SkXfermode::Create((SkXfermode::Mode)mode));
+ xfer = SkXfermode::Make((SkXfermode::Mode)mode);
}
- canvas->drawPatch(cubics, colors, texCoords, xfer, paint);
+ canvas->drawPatch(cubics, colors, texCoords, std::move(xfer), paint);
} break;
case DRAW_PATH: {
const SkPaint& paint = *fPictureData->getPaint(reader);
@@ -435,7 +435,7 @@ void SkPicturePlayback::handleOp(SkReader32* reader,
canvas->drawTextOnPath(text.text(), text.length(), path, &matrix, paint);
} break;
case DRAW_VERTICES: {
- SkAutoTUnref<SkXfermode> xfer;
+ sk_sp<SkXfermode> xfer;
const SkPaint& paint = *fPictureData->getPaint(reader);
DrawVertexFlags flags = (DrawVertexFlags)reader->readInt();
SkCanvas::VertexMode vmode = (SkCanvas::VertexMode)reader->readInt();
@@ -460,7 +460,7 @@ void SkPicturePlayback::handleOp(SkReader32* reader,
if (mode < 0 || mode > SkXfermode::kLastMode) {
mode = SkXfermode::kModulate_Mode;
}
- xfer.reset(SkXfermode::Create((SkXfermode::Mode)mode));
+ xfer = SkXfermode::Make((SkXfermode::Mode)mode);
}
canvas->drawVertices(vmode, vCount, verts, texs, colors, xfer, indices, iCount, paint);
} break;

Powered by Google App Engine
This is Rietveld 408576698