Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: tests/PictureShaderTest.cpp

Issue 1789633002: more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698