Index: tools/sk_tool_utils.cpp |
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp |
index e2bc0fc42cfb17e284335972234d0c41a043eb18..10e5c305c3c35709f4ea3bb9a083a6c18799674e 100644 |
--- a/tools/sk_tool_utils.cpp |
+++ b/tools/sk_tool_utils.cpp |
@@ -178,13 +178,13 @@ void write_pixels(SkCanvas* canvas, const SkBitmap& bitmap, int x, int y, |
canvas->writePixels(info, tmp.getPixels(), tmp.rowBytes(), x, y); |
} |
-SkShader* create_checkerboard_shader(SkColor c1, SkColor c2, int size) { |
+sk_sp<SkShader> create_checkerboard_shader(SkColor c1, SkColor c2, int size) { |
SkBitmap bm; |
bm.allocN32Pixels(2 * size, 2 * size); |
bm.eraseColor(c1); |
bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2); |
bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2); |
- return SkShader::CreateBitmapShader( |
+ return SkShader::MakeBitmapShader( |
bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode); |
} |
@@ -199,7 +199,7 @@ SkBitmap create_checkerboard_bitmap(int w, int h, SkColor c1, SkColor c2, int ch |
void draw_checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) { |
SkPaint paint; |
- paint.setShader(create_checkerboard_shader(c1, c2, size))->unref(); |
+ paint.setShader(create_checkerboard_shader(c1, c2, size)); |
paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
canvas->drawPaint(paint); |
} |