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 |