Index: tests/PictureShaderTest.cpp |
diff --git a/tests/PictureShaderTest.cpp b/tests/PictureShaderTest.cpp |
index 14bdcf2d81fbecf110430d961c77a4f9c2212791..4da7aab5116d1fc481806a04d7cda00d70bda76a 100644 |
--- a/tests/PictureShaderTest.cpp |
+++ b/tests/PictureShaderTest.cpp |
@@ -22,9 +22,8 @@ DEF_TEST(PictureShader_empty, reporter) { |
SkCanvas canvas(bitmap); |
canvas.clear(SK_ColorGREEN); |
- SkShader* shader = SkShader::CreatePictureShader( |
- nullptr, SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, nullptr, nullptr); |
- paint.setShader(shader)->unref(); |
+ paint.setShader(SkShader::MakePictureShader( |
+ nullptr, SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, nullptr, nullptr)); |
canvas.drawRect(SkRect::MakeWH(1,1), paint); |
REPORTER_ASSERT(reporter, *bitmap.getAddr32(0,0) == SK_ColorGREEN); |
@@ -32,10 +31,9 @@ DEF_TEST(PictureShader_empty, reporter) { |
SkPictureRecorder factory; |
factory.beginRecording(0, 0, nullptr, 0); |
- SkAutoTUnref<SkPicture> picture(factory.endRecording()); |
- shader = SkShader::CreatePictureShader( |
- picture.get(), SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, nullptr, nullptr); |
- paint.setShader(shader)->unref(); |
+ sk_sp<SkPicture> picture(factory.endRecording()); |
+ paint.setShader(SkShader::MakePictureShader(std::move(picture), SkShader::kClamp_TileMode, |
+ SkShader::kClamp_TileMode, nullptr, nullptr)); |
canvas.drawRect(SkRect::MakeWH(1,1), paint); |
REPORTER_ASSERT(reporter, *bitmap.getAddr32(0,0) == SK_ColorGREEN); |