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

Unified Diff: tests/DrawPathTest.cpp

Issue 1817383002: switch surface to sk_sp (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/DrawFilterTest.cpp ('k') | tests/GpuDrawPathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/DrawPathTest.cpp
diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp
index 8c46b100b387267e641d6bc1c557ab7cd817b18c..9038406e13b0cd77c62a5120e8457a772004f24d 100644
--- a/tests/DrawPathTest.cpp
+++ b/tests/DrawPathTest.cpp
@@ -18,7 +18,7 @@ static void test_big_aa_rect(skiatest::Reporter* reporter) {
SkPMColor pixel[1];
output.installPixels(SkImageInfo::MakeN32Premul(1, 1), pixel, 4);
- SkSurface* surf = SkSurface::NewRasterN32Premul(300, 33300);
+ auto surf = SkSurface::MakeRasterN32Premul(300, 33300);
SkCanvas* canvas = surf->getCanvas();
SkRect r = { 0, 33000, 300, 33300 };
@@ -46,7 +46,6 @@ static void test_big_aa_rect(skiatest::Reporter* reporter) {
} else {
REPORTER_ASSERT_MESSAGE(reporter, false, "readPixels failed");
}
- surf->unref();
}
///////////////////////////////////////////////////////////////////////////////
@@ -95,7 +94,7 @@ static void test_crbug131181() {
moveToH(&path, &data[0]);
cubicToH(&path, &data[2]);
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(640, 480));
+ auto surface(SkSurface::MakeRasterN32Premul(640, 480));
SkPaint paint;
paint.setAntiAlias(true);
@@ -132,7 +131,7 @@ static void test_inversepathwithclip() {
SkPaint paint;
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(640, 480));
+ auto surface(SkSurface::MakeRasterN32Premul(640, 480));
SkCanvas* canvas = surface->getCanvas();
canvas->save();
canvas->clipRect(SkRect::MakeWH(19, 11));
@@ -171,7 +170,7 @@ static void test_bug533() {
SkPaint paint;
paint.setAntiAlias(true);
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(640, 480));
+ auto surface(SkSurface::MakeRasterN32Premul(640, 480));
surface->getCanvas()->drawPath(path, paint);
}
@@ -213,7 +212,7 @@ static void test_bigcubic() {
SkPaint paint;
paint.setAntiAlias(true);
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(640, 480));
+ auto surface(SkSurface::MakeRasterN32Premul(640, 480));
surface->getCanvas()->drawPath(path, paint);
}
@@ -241,7 +240,7 @@ static void test_halfway() {
m.postTranslate(0.001f, 0.001f);
path.transform(m, &p2);
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(640, 480));
+ auto surface(SkSurface::MakeRasterN32Premul(640, 480));
SkCanvas* canvas = surface->getCanvas();
canvas->translate(-16366, -1383);
canvas->drawPath(p2, paint);
@@ -262,7 +261,7 @@ static void test_halfway() {
static void test_giantaa() {
const int W = 400;
const int H = 400;
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(33000, 10));
+ auto surface(SkSurface::MakeRasterN32Premul(33000, 10));
SkPaint paint;
paint.setAntiAlias(true);
@@ -316,7 +315,7 @@ static void test_crbug_165432(skiatest::Reporter* reporter) {
// http://crbug.com/472147
// This is a simplified version from the bug. RRect radii not properly scaled.
static void test_crbug_472147_simple(skiatest::Reporter* reporter) {
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(1000, 1000));
+ auto surface(SkSurface::MakeRasterN32Premul(1000, 1000));
SkCanvas* canvas = surface->getCanvas();
SkPaint p;
SkRect r = SkRect::MakeLTRB(-246.0f, 33.0f, 848.0f, 33554464.0f);
@@ -331,7 +330,7 @@ static void test_crbug_472147_simple(skiatest::Reporter* reporter) {
// http://crbug.com/472147
// RRect radii not properly scaled.
static void test_crbug_472147_actual(skiatest::Reporter* reporter) {
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(1000, 1000));
+ auto surface(SkSurface::MakeRasterN32Premul(1000, 1000));
SkCanvas* canvas = surface->getCanvas();
SkPaint p;
SkRect r = SkRect::MakeLTRB(-246.0f, 33.0f, 848.0f, 33554464.0f);
« no previous file with comments | « tests/DrawFilterTest.cpp ('k') | tests/GpuDrawPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698