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

Unified Diff: tests/JpegTest.cpp

Issue 1340803002: discardable pixelrefs are gone, update tests accordingly (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/ImageTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « tests/ImageTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698