change -d option to write out complete images (that differed from the baseline)
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Apr 2012 20:20:10 +0000 (20:20 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Apr 2012 20:20:10 +0000 (20:20 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@3632 2bbb7eff-a529-9590-31e7-b0007b416f81

gm/gmmain.cpp

index def0094..31e8074 100644 (file)
@@ -423,9 +423,10 @@ static ErrorBitfield compare_to_reference_image(const SkString& name,
     SkBitmap diffBitmap;
     errors = compare(bitmap, comparisonBitmap, name, renderModeDescriptor,
                      diffPath ? &diffBitmap : NULL);
-    if ((ERROR_NONE == errors) && diffPath) {
-        SkString diffName = make_filename(diffPath, "", name, ".diff.png");
-        if (!write_bitmap(diffName, diffBitmap)) {
+    if ((ERROR_NONE != errors) && diffPath) {
+        // write out the generated image
+        SkString genName = make_filename(diffPath, "", name, "png");
+        if (!write_bitmap(genName, bitmap)) {
             errors |= ERROR_WRITING_REFERENCE_IMAGE;
         }
     }