diff options
-rw-r--r-- | expectations/skimage/base-android-xoom.json | 142 | ||||
-rw-r--r-- | tools/skimage_main.cpp | 28 |
2 files changed, 165 insertions, 5 deletions
diff --git a/expectations/skimage/base-android-xoom.json b/expectations/skimage/base-android-xoom.json new file mode 100644 index 0000000000..cb7d6d71da --- /dev/null +++ b/expectations/skimage/base-android-xoom.json @@ -0,0 +1,142 @@ +{ + "actual-results" : { + "failed" : null, + "failure-ignored" : null, + "no-comparison" : null, + "succeeded" : null + }, + "expected-results" : { + "01_original.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 6357612266670593419 ] + ], + "ignore-failure" : false + }, + "02_empty_filter.JPG" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 13796732312180268210 ] + ], + "ignore-failure" : false + }, + "03_none_filter.JPG" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 6388620656649963843 ] + ], + "ignore-failure" : false + }, + "Lower_Left.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 3518857344143029942 ] + ], + "ignore-failure" : false + }, + "Lower_Right.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 4640356172221432257 ] + ], + "ignore-failure" : false + }, + "PANO_20121023_214540.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 15493791864227637231 ] + ], + "ignore-failure" : false + }, + "Upper_Left.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 7518208176958373090 ] + ], + "ignore-failure" : false + }, + "Upper_Right.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 10122895588403815825 ] + ], + "ignore-failure" : false + }, + "desk_yahoonews_0.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 15513164475782874663 ] + ], + "ignore-failure" : true + }, + "kokteylogo.png" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 168800254427225818 ] + ], + "ignore-failure" : false + }, + "kokteylogo.png_[26,0,57,17]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 3464562511481035166 ] + ], + "ignore-failure" : false + }, + "kokteylogo.png_[26,4,45,5]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 11569166933584178547 ] + ], + "ignore-failure" : false + }, + "kokteylogo.png_[27,8,36,9]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 14506072359562678944 ] + ], + "ignore-failure" : false + }, + "kokteylogo.png_[38,4,53,17]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 4980413816844234835 ] + ], + "ignore-failure" : false + }, + "kokteylogo.png_[69,4,71,17]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 15430159324265259188 ] + ], + "ignore-failure" : false + }, + "photo.jpg.png" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 76400998740744557 ] + ], + "ignore-failure" : false + }, + "photo.jpg.png_[134,45,259,424]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 10088437173476931079 ] + ], + "ignore-failure" : false + }, + "photo.jpg.png_[2,132,367,377]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 6938435300895122197 ] + ], + "ignore-failure" : false + }, + "photo.jpg.png_[231,348,282,433]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 13214547049530016247 ] + ], + "ignore-failure" : false + }, + "photo.jpg.png_[238,80,267,373]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 7766349704315583680 ] + ], + "ignore-failure" : false + }, + "photo.jpg.png_[306,233,351,308]" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 11244796826105366429 ] + ], + "ignore-failure" : false + }, + "tabl_mozilla_0.jpg" : { + "allowed-digests" : [ + [ "bitmap-64bitMD5", 13794277939360474741 ] + ], + "ignore-failure" : true + } + } +} diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp index 01dbc468f1..572f9f54f6 100644 --- a/tools/skimage_main.cpp +++ b/tools/skimage_main.cpp @@ -164,6 +164,18 @@ static void write_expectations(const SkBitmap& bitmap, const char* filename) { } /** + * Return true if this filename is a known failure, and therefore a failure + * to decode should be ignored. + */ +static bool expect_to_fail(const char* filename) { + if (NULL == gJsonExpectations.get()) { + return false; + } + skiagm::Expectations jsExpectations = gJsonExpectations->get(filename); + return jsExpectations.ignoreFailure(); +} + +/** * Compare against an expectation for this filename, if there is one. * @param bitmap SkBitmap to compare to the expected value. * @param filename String used to find the expected value. @@ -299,16 +311,22 @@ static void decodeFileAndWrite(const char srcPath[], const SkString* writePath) SkAutoTDelete<SkImageDecoder> ad(codec); stream.rewind(); - if (!codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config, - SkImageDecoder::kDecodePixels_Mode)) { - gDecodeFailures.push_back().set(srcPath); - return; - } // Create a string representing just the filename itself, for use in json expectations. SkString basename = SkOSPath::SkBasename(srcPath); const char* filename = basename.c_str(); + if (!codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config, + SkImageDecoder::kDecodePixels_Mode)) { + if (expect_to_fail(filename)) { + gSuccessfulDecodes.push_back().appendf( + "failed to decode %s, which is a known failure.", srcPath); + } else { + gDecodeFailures.push_back().set(srcPath); + } + return; + } + if (compare_to_expectations_if_necessary(bitmap, filename, &gDecodeFailures)) { gSuccessfulDecodes.push_back().printf("%s [%d %d]", srcPath, bitmap.width(), bitmap.height()); |