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