Index: tests/ImageIsOpaqueTest.cpp |
diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp |
index 6f1370833516c011b9fe861b54d9f9a9d31497e0..6b8b64ac21b9e5fdd82482847d67d62836aa5d68 100644 |
--- a/tests/ImageIsOpaqueTest.cpp |
+++ b/tests/ImageIsOpaqueTest.cpp |
@@ -48,18 +48,19 @@ DEF_TEST(ImageInfo_flattening, reporter) { |
} |
} |
-static void check_isopaque(skiatest::Reporter* reporter, SkSurface* surface, bool expectedOpaque) { |
+static void check_isopaque(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface, |
+ bool expectedOpaque) { |
sk_sp<SkImage> image(surface->makeImageSnapshot()); |
REPORTER_ASSERT(reporter, image->isOpaque() == expectedOpaque); |
} |
DEF_TEST(ImageIsOpaqueTest, reporter) { |
SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5); |
- SkAutoTUnref<SkSurface> surfaceTransparent(SkSurface::NewRaster(infoTransparent)); |
+ auto surfaceTransparent(SkSurface::MakeRaster(infoTransparent)); |
check_isopaque(reporter, surfaceTransparent, false); |
SkImageInfo infoOpaque = SkImageInfo::MakeN32(5, 5, kOpaque_SkAlphaType); |
- SkAutoTUnref<SkSurface> surfaceOpaque(SkSurface::NewRaster(infoOpaque)); |
+ auto surfaceOpaque(SkSurface::MakeRaster(infoOpaque)); |
check_isopaque(reporter, surfaceOpaque, true); |
} |
@@ -67,13 +68,11 @@ DEF_TEST(ImageIsOpaqueTest, reporter) { |
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageIsOpaqueTest_Gpu, reporter, context) { |
SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5); |
- SkAutoTUnref<SkSurface> surfaceTransparent( |
- SkSurface::NewRenderTarget(context, SkBudgeted::kNo, infoTransparent)); |
+ auto surfaceTransparent(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, infoTransparent)); |
check_isopaque(reporter, surfaceTransparent, false); |
SkImageInfo infoOpaque = SkImageInfo::MakeN32(5, 5, kOpaque_SkAlphaType); |
- SkAutoTUnref<SkSurface> surfaceOpaque( |
- SkSurface::NewRenderTarget(context,SkBudgeted::kNo, infoOpaque)); |
+ auto surfaceOpaque(SkSurface::MakeRenderTarget(context,SkBudgeted::kNo, infoOpaque)); |
check_isopaque(reporter, surfaceOpaque, true); |
} |