From 5671c5b9124f17d33bc14b6d347cdc6fe5d19dc8 Mon Sep 17 00:00:00 2001 From: reed Date: Wed, 9 Mar 2016 14:47:34 -0800 Subject: SkImage now has makeShader to return sk_sp BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1785473002 Review URL: https://codereview.chromium.org/1785473002 --- samplecode/SampleFilterQuality.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'samplecode/SampleFilterQuality.cpp') diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp index c37fcae457..27c092fc47 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 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(); -- cgit v1.2.3