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

Unified Diff: src/core/SkPaint.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/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 8d62a6aaf42ad2a7d988d504e4225cc09339d2ba..e4eca0cf990fbaec58596b16e50c403d3def8050 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -380,7 +380,9 @@ SET_PTR(Shader)
#ifdef SK_SUPPORT_LEGACY_COLORFILTER_PTR
SET_PTR(ColorFilter)
#endif
+#ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR
SET_PTR(Xfermode)
+#endif
#ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR
SET_PTR(PathEffect)
#endif
@@ -395,8 +397,8 @@ SkDrawLooper* SkPaint::setLooper(SkDrawLooper* looper) {
#endif
SkXfermode* SkPaint::setXfermodeMode(SkXfermode::Mode mode) {
- fXfermode.reset(SkXfermode::Create(mode));
- return fXfermode.get();
+ fXfermode = SkXfermode::Make(mode);
+ return fXfermode.get(); // can/should we change this API to be void, like the other setters?
}
///////////////////////////////////////////////////////////////////////////////
@@ -1927,7 +1929,7 @@ void SkPaint::unflatten(SkReadBuffer& buffer) {
if (flatFlags & kHasEffects_FlatFlag) {
this->setPathEffect(buffer.readPathEffect());
this->setShader(buffer.readShader());
- SkSafeUnref(this->setXfermode(buffer.readXfermode()));
+ this->setXfermode(buffer.readXfermode());
SkSafeUnref(this->setMaskFilter(buffer.readMaskFilter()));
this->setColorFilter(buffer.readColorFilter());
this->setRasterizer(buffer.readRasterizer());

Powered by Google App Engine
This is Rietveld 408576698