Index: gm/hairmodes.cpp |
diff --git a/gm/hairmodes.cpp b/gm/hairmodes.cpp |
index 4f85c198836d5d3c607c63799b109d30c27e5df6..15e75fe847fa5a74c278857ec732ca6d1f6dfc3a 100644 |
--- a/gm/hairmodes.cpp |
+++ b/gm/hairmodes.cpp |
@@ -58,7 +58,7 @@ static SkScalar drawCell(SkCanvas* canvas, SkXfermode* mode, SkAlpha a0, SkAlpha |
return H; |
} |
-static SkShader* make_bg_shader() { |
+static sk_sp<SkShader> make_bg_shader() { |
SkBitmap bm; |
bm.allocN32Pixels(2, 2); |
*bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = 0xFFFFFFFF; |
@@ -66,10 +66,8 @@ static SkShader* make_bg_shader() { |
SkMatrix m; |
m.setScale(SkIntToScalar(6), SkIntToScalar(6)); |
- return SkShader::CreateBitmapShader(bm, |
- SkShader::kRepeat_TileMode, |
- SkShader::kRepeat_TileMode, |
- &m); |
+ return SkShader::MakeBitmapShader(bm, |
+ SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &m); |
} |
namespace skiagm { |
@@ -85,7 +83,7 @@ namespace skiagm { |
virtual SkISize onISize() override { return SkISize::Make(640, 480); } |
void onOnceBeforeDraw() override { |
- fBGPaint.setShader(make_bg_shader())->unref(); |
+ fBGPaint.setShader(make_bg_shader()); |
} |
void onDraw(SkCanvas* canvas) override { |