Index: samplecode/SampleHairModes.cpp |
diff --git a/samplecode/SampleHairModes.cpp b/samplecode/SampleHairModes.cpp |
index ae41aa9c9d321f6c53aa6a3e229472586d5a3197..085581cfc958817da68e118b3ad7c6298da670d6 100644 |
--- a/samplecode/SampleHairModes.cpp |
+++ b/samplecode/SampleHairModes.cpp |
@@ -60,7 +60,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; |
@@ -69,17 +69,15 @@ 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); |
} |
class HairModesView : public SampleView { |
SkPaint fBGPaint; |
public: |
HairModesView() { |
- fBGPaint.setShader(make_bg_shader())->unref(); |
+ fBGPaint.setShader(make_bg_shader()); |
} |
protected: |