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

Unified Diff: samplecode/SampleFilterQuality.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 | « include/core/SkImage.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleFilterQuality.cpp
diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp
index c37fcae457c4cc8e1b9a2521cbeb649b8d20f8e7..27c092fc476f2e8249fdb16c8641197e6c4909fc 100644
--- a/samplecode/SampleFilterQuality.cpp
+++ b/samplecode/SampleFilterQuality.cpp
@@ -27,7 +27,7 @@ static SkSurface* make_surface(SkCanvas* canvas, const SkImageInfo& info) {
return surface;
}
-static SkShader* make_shader(const SkRect& bounds) {
+static sk_sp<SkShader> make_shader(const SkRect& bounds) {
#if 0
const SkPoint pts[] = {
{ bounds.left(), bounds.top() },
@@ -45,7 +45,7 @@ static SkShader* make_shader(const SkRect& bounds) {
if (nullptr == image) {
return nullptr;
}
- return image->newShader(SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
+ return image->makeShader(SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
#endif
}
@@ -67,7 +67,7 @@ static SkImage* make_image() {
path.moveTo(0, 0); path.lineTo(N, 0); path.lineTo(0, N); path.close();
SkPaint paint;
- SkSafeUnref(paint.setShader(make_shader(SkRect::MakeWH(N, N))));
+ paint.setShader(make_shader(SkRect::MakeWH(N, N)));
canvas->drawPath(path, paint);
return surface->newImageSnapshot();
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698