Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium.org/1789633002/ )"
This reverts commit 9283d20afc27571f7a871d1bd1100dd5df584941.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1793303002
Review URL: https://codereview.chromium.org/1793303002
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 448e079..3654a77 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -79,10 +79,9 @@
bitmap.allocPixels(SkImageInfo::MakeN32Premul(2, 2));
bitmap.eraseColor(SK_ColorBLUE);
*(bitmap.getAddr32(0, 0)) = SK_ColorGREEN;
- SkShader* shader = SkShader::CreateBitmapShader(bitmap, SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode);
- paint.setShader(shader)->unref();
- REPORTER_ASSERT(reporter, shader->isABitmap());
+ paint.setShader(SkShader::MakeBitmapShader(bitmap, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode));
+ REPORTER_ASSERT(reporter, paint.getShader()->isABitmap());
canvas->drawRect(SkRect::MakeWH(10, 10), paint);
}
@@ -1389,7 +1388,7 @@
DEF_TEST(MiniRecorderLeftHanging, r) {
// Any shader or other ref-counted effect will do just fine here.
SkPaint paint;
- paint.setShader(SkShader::CreateColorShader(SK_ColorRED))->unref();
+ paint.setShader(SkShader::MakeColorShader(SK_ColorRED));
SkMiniRecorder rec;
REPORTER_ASSERT(r, rec.drawRect(SkRect::MakeWH(20,30), paint));