aboutsummaryrefslogtreecommitdiff
path: root/tests/DrawPathTest.cpp
diff options
context:
space:
mode:
authorreed <reed@google.com>2016-03-23 18:59:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 18:59:25 -0700
commite8f3062a36d3682f4019309a32b5b84dc9eddf8c (patch)
treeff5cd50c65edb6e3b77f77327165ad0162557137 /tests/DrawPathTest.cpp
parent041c870425eb0a3e2b0cbc46581b3da2f50571d9 (diff)
switch surface to sk_sp
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817383002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review URL: https://codereview.chromium.org/1817383002
Diffstat (limited to 'tests/DrawPathTest.cpp')
-rw-r--r--tests/DrawPathTest.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp
index 8c46b100b3..9038406e13 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);