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

Unified Diff: tests/PictureShaderTest.cpp

Issue 1790353002: Revert of 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
« no previous file with comments | « tests/PaintImageFilterTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « tests/PaintImageFilterTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698