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

Unified Diff: tools/skimage_main.cpp

Issue 18023008: Fix run_decoding_tests on xoom. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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
Index: tools/skimage_main.cpp
diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp
index 01dbc468f13699663b625fa75e79a1d7b05e0e6c..572f9f54f6a8040eb0280db1742c206b98a9083c 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());
« expectations/skimage/base-android-xoom.json ('K') | « expectations/skimage/base-android-xoom.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698