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

Unified Diff: src/core/SkLocalMatrixShader.cpp

Issue 1782703002: sk_sp versions of newWithColorFilter and newWithLocalMatrix (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/SkColorFilterShader.cpp ('k') | tests/SkColor4fTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLocalMatrixShader.cpp
diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp
index 42b378d61a69d033fd1090af18239d1587f7e5f2..ddd6114ca870c95c6e9095bf5428c314c6d38134 100644
--- a/src/core/SkLocalMatrixShader.cpp
+++ b/src/core/SkLocalMatrixShader.cpp
@@ -14,7 +14,7 @@ SkFlattenable* SkLocalMatrixShader::CreateProc(SkReadBuffer& buffer) {
if (!baseShader) {
return nullptr;
}
- return baseShader->newWithLocalMatrix(lm);
+ return baseShader->makeWithLocalMatrix(lm).release();
}
void SkLocalMatrixShader::flatten(SkWriteBuffer& buffer) const {
@@ -47,9 +47,9 @@ void SkLocalMatrixShader::toString(SkString* str) const {
}
#endif
-SkShader* SkShader::newWithLocalMatrix(const SkMatrix& localMatrix) const {
+sk_sp<SkShader> SkShader::makeWithLocalMatrix(const SkMatrix& localMatrix) const {
if (localMatrix.isIdentity()) {
- return SkRef(const_cast<SkShader*>(this));
+ return sk_ref_sp(const_cast<SkShader*>(this));
}
const SkMatrix* lm = &localMatrix;
@@ -63,5 +63,5 @@ SkShader* SkShader::newWithLocalMatrix(const SkMatrix& localMatrix) const {
baseShader = proxy.get();
}
- return new SkLocalMatrixShader(baseShader, *lm);
+ return sk_make_sp<SkLocalMatrixShader>(baseShader, *lm);
}
« no previous file with comments | « src/core/SkColorFilterShader.cpp ('k') | tests/SkColor4fTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698