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

Unified Diff: src/core/SkShader.cpp

Issue 1855733002: change flattenable factory to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkShader.cpp
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index e4cbc7b2171340a1ec00aab1f976fdcdadec9629..8032cc6e4cbc1655640b37359a56857cf2b17270 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -264,8 +264,8 @@ bool SkColorShader::isOpaque() const {
return SkColorGetA(fColor) == 255;
}
-SkFlattenable* SkColorShader::CreateProc(SkReadBuffer& buffer) {
- return new SkColorShader(buffer.readColor());
+sk_sp<SkFlattenable> SkColorShader::CreateProc(SkReadBuffer& buffer) {
+ return sk_make_sp<SkColorShader>(buffer.readColor());
}
void SkColorShader::flatten(SkWriteBuffer& buffer) const {
@@ -419,8 +419,8 @@ bool SkColorShader::ColorShaderContext::onChooseBlitProcs(const SkImageInfo& inf
///////////////////////////////////////////////////////////////////////////////
-SkFlattenable* SkEmptyShader::CreateProc(SkReadBuffer&) {
- return SkShader::MakeEmptyShader().release();
+sk_sp<SkFlattenable> SkEmptyShader::CreateProc(SkReadBuffer&) {
+ return SkShader::MakeEmptyShader();
}
#ifndef SK_IGNORE_TO_STRING
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698