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

Unified Diff: src/image/SkImage.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/gpu/SkGpuDevice.cpp ('k') | src/image/SkImageShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 07279501a38df3db1b7e4f5d48d771690f3729d3..cbd9edd2e380a27d44c5235ae3d536bedc26c23b 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -91,11 +91,17 @@ void SkImage::preroll(GrContext* ctx) const {
///////////////////////////////////////////////////////////////////////////////////////////////////
-SkShader* SkImage::newShader(SkShader::TileMode tileX,
- SkShader::TileMode tileY,
+sk_sp<SkShader> SkImage::makeShader(SkShader::TileMode tileX, SkShader::TileMode tileY,
+ const SkMatrix* localMatrix) const {
+ return SkImageShader::Make(this, tileX, tileY, localMatrix);
+}
+
+#ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR
+SkShader* SkImage::newShader(SkShader::TileMode tileX, SkShader::TileMode tileY,
const SkMatrix* localMatrix) const {
- return SkImageShader::Create(this, tileX, tileY, localMatrix);
+ return this->makeShader(tileX, tileY, localMatrix).release();
}
+#endif
SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const {
SkBitmap bm;
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/image/SkImageShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698