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

Unified Diff: tests/CodecTest.cpp

Issue 2288163003: Add Alpha8 support to SkPNGImageEncoder Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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
« src/codec/SkPngCodec.cpp ('K') | « src/images/SkPNGImageEncoder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CodecTest.cpp
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index fcbfadd0680bc25225fd1f0bb1f94d85dc779a60..09264181bee1f81741d0ce3cedb6139501650f1b 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -1119,4 +1119,16 @@ DEF_TEST(Codec_PngRoundTrip, r) {
result = codec->getPixels(codec->getInfo(), bm2.getPixels(), bm2.rowBytes());
REPORTER_ASSERT(r, SkCodec::kSuccess == result);
check_round_trip(r, bm2);
+
+ // Create an arbitrary alpha8 bitmap.
+ path = "arrow.png";
+ stream.reset(resource(path));
+ codec.reset(SkCodec::NewFromStream(stream.release()));
+ SkBitmap tmp;
+ tmp.allocPixels(codec->getInfo());
+ result = codec->getPixels(codec->getInfo(), tmp.getPixels(), tmp.rowBytes());
+ REPORTER_ASSERT(r, SkCodec::kSuccess == result);
+ SkBitmap bm3;
+ tmp.copyTo(&bm3, kAlpha_8_SkColorType);
+ check_round_trip(r, bm3);
}
« src/codec/SkPngCodec.cpp ('K') | « src/images/SkPNGImageEncoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698