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

Unified Diff: tests/PictureTest.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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/PictureShaderTest.cpp ('k') | tests/RecorderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 448e079958ef5a01444fc0c5a9b009c16325b27e..3654a77173e9fcd1e872d22c1b47dbba2e727f10 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -79,10 +79,9 @@ static void test_analysis(skiatest::Reporter* reporter) {
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(Picture_getRecordingCanvas, r) {
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));
« no previous file with comments | « tests/PictureShaderTest.cpp ('k') | tests/RecorderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698