Index: tests/JpegTest.cpp |
diff --git a/tests/JpegTest.cpp b/tests/JpegTest.cpp |
index daa932c4c9b046f2a1b89da1578d3d357923e190..d61b0bd3111cd89f62930c3ed9cff2d81b3abea9 100644 |
--- a/tests/JpegTest.cpp |
+++ b/tests/JpegTest.cpp |
@@ -457,22 +457,16 @@ DEF_TEST(Jpeg, reporter) { |
DEF_TEST(Jpeg_YUV, reporter) { |
size_t len = sizeof(goodJpegImage); |
SkMemoryStream* stream = new SkMemoryStream(goodJpegImage, len); |
- |
- SkBitmap bitmap; |
SkDecodingImageGenerator::Options opts; |
- bool pixelsInstalled = SkInstallDiscardablePixelRef( |
- SkDecodingImageGenerator::Create(stream, opts), &bitmap); |
- REPORTER_ASSERT(reporter, pixelsInstalled); |
- |
- if (!pixelsInstalled) { |
+ SkAutoTDelete<SkImageGenerator> gen(SkDecodingImageGenerator::Create(stream, opts)); |
+ REPORTER_ASSERT(reporter, gen); |
+ if (!gen) { |
return; |
} |
- SkPixelRef* pixelRef = bitmap.pixelRef(); |
SkISize yuvSizes[3]; |
- bool sizesComputed = (nullptr != pixelRef) && pixelRef->getYUV8Planes(yuvSizes, nullptr, nullptr, nullptr); |
+ bool sizesComputed = gen->getYUV8Planes(yuvSizes, nullptr, nullptr, nullptr); |
REPORTER_ASSERT(reporter, sizesComputed); |
- |
if (!sizesComputed) { |
return; |
} |
@@ -495,5 +489,5 @@ DEF_TEST(Jpeg_YUV, reporter) { |
planes[2] = (uint8_t*)planes[1] + sizes[1]; |
// Get the YUV planes |
- REPORTER_ASSERT(reporter, pixelRef->getYUV8Planes(yuvSizes, planes, rowBytes, nullptr)); |
+ REPORTER_ASSERT(reporter, gen->getYUV8Planes(yuvSizes, planes, rowBytes, nullptr)); |
} |