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

Unified Diff: tests/ImageDecodingTest.cpp

Issue 428603002: SkDiscardablePixelRef returns correct indexed color on relock. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 years, 5 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 | « src/lazy/SkDiscardablePixelRef.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageDecodingTest.cpp
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index d070f615b351285ef5d0bdfa0c3adc1abed2d308..d8e813d10e78af60b53665f17a106fff332e4f89 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -723,3 +723,27 @@ DEF_TEST(ImageDecoderOptions, reporter) {
}
}
}
+
+DEF_TEST(DiscardablePixelRef_SecondLockColorTableCheck, r) {
+ SkString resourceDir = GetResourcePath();
+ SkString path = SkOSPath::SkPathJoin(resourceDir.c_str(), "randPixels.gif");
+ if (!sk_exists(path.c_str())) {
+ return;
+ }
+ SkAutoDataUnref encoded(SkData::NewFromFileName(path.c_str()));
+ SkBitmap bitmap;
+ if (!SkInstallDiscardablePixelRef(
+ SkDecodingImageGenerator::Create(
+ encoded, SkDecodingImageGenerator::Options()), &bitmap)) {
+ ERRORF(r, "SkInstallDiscardablePixelRef [randPixels.gif] failed.");
+ return;
+ }
+ {
+ SkAutoLockPixels alp(bitmap);
+ REPORTER_ASSERT(r, bitmap.getColorTable() && "first pass");
+ }
+ {
+ SkAutoLockPixels alp(bitmap);
+ REPORTER_ASSERT(r, bitmap.getColorTable() && "second pass");
+ }
+}
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698