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

Unified Diff: src/image/SkImageShader.cpp

Issue 1785473002: SkImage now has makeShader to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use build guard for impl of newShader 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/image/SkImageShader.h ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImageShader.cpp
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index b1bb3ab8f80e3fd396669a5b270666ca837a3dad..00c038ab88511fb86c3f6aef4e12f96cb4242090 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -28,7 +28,7 @@ SkFlattenable* SkImageShader::CreateProc(SkReadBuffer& buffer) {
if (!img) {
return nullptr;
}
- return new SkImageShader(img, tx, ty, &matrix);
+ return SkImageShader::Make(img, tx, ty, &matrix).release();
}
void SkImageShader::flatten(SkWriteBuffer& buffer) const {
@@ -51,12 +51,12 @@ SkShader::Context* SkImageShader::onCreateContext(const ContextRec& rec, void* s
SkBitmapProvider(fImage), rec, storage);
}
-SkShader* SkImageShader::Create(const SkImage* image, TileMode tx, TileMode ty,
- const SkMatrix* localMatrix) {
+sk_sp<SkShader> SkImageShader::Make(const SkImage* image, TileMode tx, TileMode ty,
+ const SkMatrix* localMatrix) {
if (!image) {
return nullptr;
}
- return new SkImageShader(image, tx, ty, localMatrix);
+ return sk_sp<SkShader>(new SkImageShader(image, tx, ty, localMatrix));
}
#ifndef SK_IGNORE_TO_STRING
« no previous file with comments | « src/image/SkImageShader.h ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698