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

Unified Diff: src/core/SkXfermode.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/SkXfermode.cpp
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 98eb796b735d8f8a7313bc5e7c132d06ada6f21d..01d6dc53c2a4ab4cecaafd2c51ca5d34753c68ce 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -1097,7 +1097,7 @@ SkFlattenable* SkProcCoeffXfermode::CreateProc(SkReadBuffer& buffer) {
if (!buffer.validate(mode32 < SK_ARRAY_COUNT(gProcCoeffs))) {
return nullptr;
}
- return SkXfermode::Create((SkXfermode::Mode)mode32);
+ return SkXfermode::Make((SkXfermode::Mode)mode32).release();
}
void SkProcCoeffXfermode::flatten(SkWriteBuffer& buffer) const {
@@ -1305,7 +1305,7 @@ void SkProcCoeffXfermode::toString(SkString* str) const {
SK_DECLARE_STATIC_ONCE_PTR(SkXfermode, cached[SkXfermode::kLastMode + 1]);
-SkXfermode* SkXfermode::Create(Mode mode) {
+sk_sp<SkXfermode> SkXfermode::Make(Mode mode) {
SkASSERT(SK_ARRAY_COUNT(gProcCoeffs) == kModeCount);
if ((unsigned)mode >= kModeCount) {
@@ -1319,7 +1319,7 @@ SkXfermode* SkXfermode::Create(Mode mode) {
return nullptr;
}
- return SkSafeRef(cached[mode].get([=]{
+ return sk_ref_sp(cached[mode].get([=]{
ProcCoeff rec = gProcCoeffs[mode];
if (auto xfermode = SkOpts::create_xfermode(rec, mode)) {
return xfermode;

Powered by Google App Engine
This is Rietveld 408576698