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

Unified Diff: tests/CodexTest.cpp

Issue 1055743003: Swizzler changes Index8 and 565 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix windows errors Created 5 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
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | tests/SwizzlerTest.cpp » ('j') | 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 26846a4550816371281c0797781a1b90cb31c355..a771716a24dfef27ac42f28bad1a59fefb1625c1 100644
--- a/tests/CodexTest.cpp
+++ b/tests/CodexTest.cpp
@@ -41,7 +41,12 @@ static void check(skiatest::Reporter* r,
ERRORF(r, "Unable to decode '%s'", path);
return;
}
- SkImageInfo info = codec->getInfo();
+
+ // This test is used primarily to verify rewinding works properly. Using kN32 allows
+ // us to test this without the added overhead of creating different bitmaps depending
+ // on the color type (ex: building a color table for kIndex8). DM is where we test
+ // decodes to all possible destination color types.
+ SkImageInfo info = codec->getInfo().makeColorType(kN32_SkColorType);
REPORTER_ASSERT(r, info.dimensions() == size);
SkBitmap bm;
bm.allocPixels(info);
@@ -94,6 +99,11 @@ DEF_TEST(Codec, r) {
// Decodes an embedded PNG image
check(r, "google_chrome.ico", SkISize::Make(256, 256), false);
+ // GIF
+ check(r, "box.gif", SkISize::Make(200, 55), false);
+ check(r, "color_wheel.gif", SkISize::Make(128, 128), false);
+ check(r, "randPixels.gif", SkISize::Make(8, 8), false);
+
// PNG
check(r, "arrow.png", SkISize::Make(187, 312), true);
check(r, "baby_tux.png", SkISize::Make(240, 246), true);
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | tests/SwizzlerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698