Add VALIDATE_FAILURE_IS_A_TOOL_FAILURE to specify whether a failure in validation
means the tool should return failure or not. For now it is not defined, which
means any failed pixels are still reported to stdout, but the tool does not
return an error, allowing the bots to go green (until we can fix these failures).
Review URL: https://codereview.appspot.com/7105056
git-svn-id: http://skia.googlecode.com/svn/trunk@7211 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index 99bf7d1..fda5350 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -21,6 +21,10 @@
#include "PictureRenderer.h"
#include "picture_utils.h"
+// Define this if validation failures should cause the tool to return failure
+// If not, it will still printf the messages.
+//#define VALIDATE_FAILURE_IS_A_TOOL_FAILURE
+
static void usage(const char* argv0) {
SkDebugf("SkPicture rendering tool\n");
SkDebugf("\n"
@@ -226,12 +230,17 @@
x, y,
*referenceBitmap->getAddr32(x, y),
*bitmap->getAddr32(x, y));
+#ifdef VALIDATE_FAILURE_IS_A_TOOL_FAILURE
SkDELETE(bitmap);
SkDELETE(referenceBitmap);
return false;
+#else
+ goto DONE;
+#endif
}
}
}
+ DONE:
SkDELETE(referenceBitmap);
}