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

Unified Diff: tests/ImageIsOpaqueTest.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/ImageFilterTest.cpp ('k') | tests/ImageNewShaderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « tests/ImageFilterTest.cpp ('k') | tests/ImageNewShaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698