Index: samplecode/SampleAARectModes.cpp |
diff --git a/samplecode/SampleAARectModes.cpp b/samplecode/SampleAARectModes.cpp |
index ae28925a428cbb8e3f4c8db9b11d3466e2673e05..43392235c9fed3a0fee0e1dfb9aad45176ca299c 100644 |
--- a/samplecode/SampleAARectModes.cpp |
+++ b/samplecode/SampleAARectModes.cpp |
@@ -61,7 +61,7 @@ static SkScalar drawCell(SkCanvas* canvas, SkXfermode* mode, |
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; |
@@ -71,17 +71,17 @@ 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 AARectsModesView : public SampleView { |
SkPaint fBGPaint; |
public: |
AARectsModesView () { |
- fBGPaint.setShader(make_bg_shader())->unref(); |
+ fBGPaint.setShader(make_bg_shader()); |
} |
protected: |