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

Unified Diff: ui/gfx/codec/png_codec_unittest.cc

Issue 1874403003: Tweak libpng encoding parameters to increase speed on very large images. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks and improve perf tests. Created 4 years, 8 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
« ui/gfx/codec/png_codec.cc ('K') | « ui/gfx/codec/png_codec_perftest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/codec/png_codec_unittest.cc
diff --git a/ui/gfx/codec/png_codec_unittest.cc b/ui/gfx/codec/png_codec_unittest.cc
index b0d1e3de40e98c3dbee5e956c57ef9d93130c065..eaada742fc1e91960e9997341e34c68419a9a9b2 100644
--- a/ui/gfx/codec/png_codec_unittest.cc
+++ b/ui/gfx/codec/png_codec_unittest.cc
@@ -1173,9 +1173,14 @@ TEST(PNGCodec, EncodeDecodeWithVaryingCompressionLevels) {
EXPECT_TRUE(
PNGCodec::FastEncodeBGRASkBitmap(original_bitmap, false, &encoded_fast));
+ std::vector<unsigned char> encoded_no_compress;
+ EXPECT_TRUE(PNGCodec::FastEncodeBGRASkBitmap(original_bitmap, false,
+ &encoded_no_compress));
+
// Make sure the different compression settings actually do something; the
// sizes should be different.
- EXPECT_NE(encoded_normal.size(), encoded_fast.size());
+ EXPECT_GT(encoded_normal.size(), encoded_fast.size());
+ EXPECT_GT(encoded_fast.size(), encoded_no_compress.size());
// decode, they should be identical to the original.
SkBitmap decoded;
@@ -1186,6 +1191,10 @@ TEST(PNGCodec, EncodeDecodeWithVaryingCompressionLevels) {
EXPECT_TRUE(
PNGCodec::Decode(&encoded_fast[0], encoded_fast.size(), &decoded));
EXPECT_TRUE(BitmapsAreEqual(decoded, original_bitmap));
+
+ EXPECT_TRUE(PNGCodec::Decode(&encoded_no_compress[0],
+ encoded_no_compress.size(), &decoded));
+ EXPECT_TRUE(BitmapsAreEqual(decoded, original_bitmap));
}
« ui/gfx/codec/png_codec.cc ('K') | « ui/gfx/codec/png_codec_perftest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698