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

Unified Diff: tests/CodexTest.cpp

Issue 1349563007: Disable dithering in libjpeg-turbo for 565 decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added suggested test 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 | « src/codec/SkJpegCodec.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CodexTest.cpp
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp
index 041e71c67f46b12b356d7b864918b5f458a0696e..2ea6eda57ec86a899a83f5778b31ddea2b0fada6 100644
--- a/tests/CodexTest.cpp
+++ b/tests/CodexTest.cpp
@@ -99,14 +99,6 @@ static void check(skiatest::Reporter* r,
SkImageInfo info = codec->getInfo().makeColorType(kN32_SkColorType);
REPORTER_ASSERT(r, info.dimensions() == size);
- {
- // Test decoding to 565
- SkImageInfo info565 = info.makeColorType(kRGB_565_SkColorType);
- SkCodec::Result expected = (supports565 && info.alphaType() == kOpaque_SkAlphaType) ?
- SkCodec::kSuccess : SkCodec::kInvalidConversion;
- test_info(r, codec, info565, expected, nullptr);
- }
-
SkBitmap bm;
bm.allocPixels(info);
SkAutoLockPixels autoLockPixels(bm);
@@ -117,7 +109,18 @@ static void check(skiatest::Reporter* r,
SkMD5::Digest digest;
md5(bm, &digest);
- // verify that re-decoding gives the same result.
+ {
+ // Test decoding to 565
+ SkImageInfo info565 = info.makeColorType(kRGB_565_SkColorType);
+ SkCodec::Result expected = (supports565 && info.alphaType() == kOpaque_SkAlphaType) ?
+ SkCodec::kSuccess : SkCodec::kInvalidConversion;
+ test_info(r, codec, info565, expected, nullptr);
+ }
+
+ // Verify that re-decoding gives the same result. It is interesting to check this after
+ // a decode to 565, since choosing to decode to 565 may result in some of the decode
+ // options being modified. These options should return to their defaults on another
+ // decode to kN32, so the new digest should match the old digest.
test_info(r, codec, info, SkCodec::kSuccess, &digest);
{
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698