gm self-test: make all test cases exercise transparency
authorepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Sat, 2 Mar 2013 19:56:18 +0000 (19:56 +0000)
committerepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Sat, 2 Mar 2013 19:56:18 +0000 (19:56 +0000)
BUG=https://code.google.com/p/skia/issues/detail?id=1142
Review URL: https://codereview.chromium.org/12379047

git-svn-id: http://skia.googlecode.com/svn/trunk@7943 2bbb7eff-a529-9590-31e7-b0007b416f81

18 files changed:
gm/selftest.cpp
gm/tests/outputs/aaclip-readback/output-expected/command_line [deleted file]
gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt [deleted file]
gm/tests/outputs/aaclip-readback/output-expected/return_value [deleted file]
gm/tests/outputs/aaclip-readback/output-expected/stdout [deleted file]
gm/tests/outputs/aaclip-write/output-expected/command_line [deleted file]
gm/tests/outputs/aaclip-write/output-expected/json-summary.txt [deleted file]
gm/tests/outputs/aaclip-write/output-expected/return_value [deleted file]
gm/tests/outputs/aaclip-write/output-expected/stdout [deleted file]
gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt
gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt
gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt
gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt
gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt
gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt
gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt
gm/tests/outputs/no-readpath/output-expected/json-summary.txt
gm/tests/run.sh

index 840dac2e8570983f5e81a90f7219ae28fe4e2ab5..812d47512f872b8f398be2fd52890c7e3a147d05 100644 (file)
@@ -41,8 +41,14 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-static skiagm::GM* F1(void*) { return new SelfTestGM("selftest1", SK_ColorGREEN); }
-static skiagm::GM* F2(void*) { return new SelfTestGM("selftest2", SK_ColorBLUE); }
+// We use translucent colors to make sure we are properly handling cases like
+// those which caused https://code.google.com/p/skia/issues/detail?id=1079
+// ('gm generating spurious pixel_error messages as of r7258')
+static SkColor kTranslucentGreen = 0x7700EE00;
+static SkColor kTranslucentBlue  = 0x770000DD;
+
+static skiagm::GM* F1(void*) { return new SelfTestGM("selftest1", kTranslucentGreen); }
+static skiagm::GM* F2(void*) { return new SelfTestGM("selftest2", kTranslucentBlue); }
 
 static skiagm::GMRegistry gR1(F1);
 static skiagm::GMRegistry gR2(F2);
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/command_line b/gm/tests/outputs/aaclip-readback/output-expected/command_line
deleted file mode 100644 (file)
index db66e2e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-out/Debug/gm --match simpleaaclip_path --config 8888 --config 565 -r gm/tests/tempfiles/aaclip-images --writeJsonSummary gm/tests/outputs/aaclip-readback/output-actual/json-summary.txt
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt b/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt
deleted file mode 100644 (file)
index f5b3319..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-   "actual-results" : {
-      "failed" : null,
-      "failure-ignored" : null,
-      "no-comparison" : null,
-      "succeeded" : {
-         "simpleaaclip_path_565" : {
-            "checksum" : 14145667878792355483
-         },
-         "simpleaaclip_path_8888" : {
-            "checksum" : 3793109275220252029
-         }
-      }
-   },
-   "expected-results" : {
-      "simpleaaclip_path_565" : {
-         "checksums" : [ 14145667878792355483 ],
-         "ignore-failure" : false
-      },
-      "simpleaaclip_path_8888" : {
-         "checksums" : [ 3793109275220252029 ],
-         "ignore-failure" : false
-      }
-   }
-}
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/return_value b/gm/tests/outputs/aaclip-readback/output-expected/return_value
deleted file mode 100644 (file)
index 573541a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/stdout b/gm/tests/outputs/aaclip-readback/output-expected/stdout
deleted file mode 100644 (file)
index 52931ca..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-reading from gm/tests/tempfiles/aaclip-images
-drawing... simpleaaclip_path [640 480]
-Ran 1 tests: 1 passed, 0 failed, 0 missing reference images
diff --git a/gm/tests/outputs/aaclip-write/output-expected/command_line b/gm/tests/outputs/aaclip-write/output-expected/command_line
deleted file mode 100644 (file)
index db030e1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-out/Debug/gm --match simpleaaclip_path --config 8888 --config 565 -w gm/tests/tempfiles/aaclip-images --writeJsonSummary gm/tests/outputs/aaclip-write/output-actual/json-summary.txt
diff --git a/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt b/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt
deleted file mode 100644 (file)
index 62a2e9f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-   "actual-results" : {
-      "failed" : null,
-      "failure-ignored" : null,
-      "no-comparison" : {
-         "simpleaaclip_path_565" : {
-            "checksum" : 14145667878792355483
-         },
-         "simpleaaclip_path_8888" : {
-            "checksum" : 3793109275220252029
-         }
-      },
-      "succeeded" : null
-   },
-   "expected-results" : null
-}
diff --git a/gm/tests/outputs/aaclip-write/output-expected/return_value b/gm/tests/outputs/aaclip-write/output-expected/return_value
deleted file mode 100644 (file)
index 573541a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/gm/tests/outputs/aaclip-write/output-expected/stdout b/gm/tests/outputs/aaclip-write/output-expected/stdout
deleted file mode 100644 (file)
index 87b8e47..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-writing to gm/tests/tempfiles/aaclip-images
-drawing... simpleaaclip_path [640 480]
-Ran 1 tests: 1 passed, 0 failed, 1 missing reference images
index 2fca4157b0770bed729aab711fffe935a1d30402..4cfe15127bf021b486f7e5e4a6a93269000bdacc 100644 (file)
@@ -2,10 +2,10 @@
    "actual-results" : {
       "failed" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       },
       "failure-ignored" : null,
    },
    "expected-results" : {
       "565/selftest1" : {
-         "checksums" : [ 8143889227369140487 ],
+         "checksums" : [ 11071285354315388429 ],
          "ignore-failure" : false
       },
       "8888/selftest1" : {
-         "checksums" : [ 8143889227369140487 ],
+         "checksums" : [ 16527650414256125612 ],
          "ignore-failure" : false
       }
    }
index 2fca4157b0770bed729aab711fffe935a1d30402..4cfe15127bf021b486f7e5e4a6a93269000bdacc 100644 (file)
@@ -2,10 +2,10 @@
    "actual-results" : {
       "failed" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       },
       "failure-ignored" : null,
    },
    "expected-results" : {
       "565/selftest1" : {
-         "checksums" : [ 8143889227369140487 ],
+         "checksums" : [ 11071285354315388429 ],
          "ignore-failure" : false
       },
       "8888/selftest1" : {
-         "checksums" : [ 8143889227369140487 ],
+         "checksums" : [ 16527650414256125612 ],
          "ignore-failure" : false
       }
    }
index fdc6ab33873f35adf488fed083e1c29d3efa818b..69ef127716f3d771bba9b7d2a4d897ec99bd2cd3 100644 (file)
@@ -4,10 +4,10 @@
       "failure-ignored" : null,
       "no-comparison" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       },
       "succeeded" : null
index 1fcd8f0b75eccf7a44a0ea462acf3076cfba58c8..cfaf455462c8e74581da3af2cff6e7de9ce69b2b 100644 (file)
@@ -5,20 +5,20 @@
       "no-comparison" : null,
       "succeeded" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       }
    },
    "expected-results" : {
       "565/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 9512553915271796906 ],
          "ignore-failure" : false
       },
       "8888/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 14022967492765711532 ],
          "ignore-failure" : false
       }
    }
index 1fcd8f0b75eccf7a44a0ea462acf3076cfba58c8..cfaf455462c8e74581da3af2cff6e7de9ce69b2b 100644 (file)
@@ -5,20 +5,20 @@
       "no-comparison" : null,
       "succeeded" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       }
    },
    "expected-results" : {
       "565/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 9512553915271796906 ],
          "ignore-failure" : false
       },
       "8888/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 14022967492765711532 ],
          "ignore-failure" : false
       }
    }
index 1fcd8f0b75eccf7a44a0ea462acf3076cfba58c8..cfaf455462c8e74581da3af2cff6e7de9ce69b2b 100644 (file)
@@ -5,20 +5,20 @@
       "no-comparison" : null,
       "succeeded" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       }
    },
    "expected-results" : {
       "565/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 9512553915271796906 ],
          "ignore-failure" : false
       },
       "8888/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 14022967492765711532 ],
          "ignore-failure" : false
       }
    }
index 1fcd8f0b75eccf7a44a0ea462acf3076cfba58c8..cfaf455462c8e74581da3af2cff6e7de9ce69b2b 100644 (file)
@@ -5,20 +5,20 @@
       "no-comparison" : null,
       "succeeded" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       }
    },
    "expected-results" : {
       "565/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 9512553915271796906 ],
          "ignore-failure" : false
       },
       "8888/selftest1" : {
-         "checksums" : [ 9948284449770991531 ],
+         "checksums" : [ 14022967492765711532 ],
          "ignore-failure" : false
       }
    }
index dbe8a481da1a553fcfb31eab1d2f02d2b8a37194..0e19ec194d541fed84b23d412d863cbbe1d67b4b 100644 (file)
@@ -4,10 +4,10 @@
       "failure-ignored" : null,
       "no-comparison" : {
          "565/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 9512553915271796906
          },
          "8888/selftest1" : {
-            "checksum" : 9948284449770991531
+            "checksum" : 14022967492765711532
          }
       },
       "succeeded" : null
index fdfb2f26904b74fee9f816651e47c4eeec594cc6..5293ed29d3cea69711cac3b6b1ab1fae59fbd013 100755 (executable)
@@ -154,20 +154,4 @@ gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/empty-dir"
 # section should be empty.
 gm_test "--hierarchy --match selftest1 $CONFIGS" "$GM_OUTPUTS/no-readpath"
 
-# Run a test which generates partially transparent images, write out those
-# images, and read them back in.
-#
-# This test would have caught
-# http://code.google.com/p/skia/issues/detail?id=1079 ('gm generating
-# spurious pixel_error messages as of r7258').
-#
-# TODO(epoger): Disabled pending https://code.google.com/p/skia/issues/detail?id=1142
-# ('gm self-tests: aaclip checksums failing')
-#
-#IMAGEDIR=$GM_TEMPFILES/aaclip-images
-#rm -rf $IMAGEDIR
-#mkdir -p $IMAGEDIR
-#gm_test "--match simpleaaclip_path $CONFIGS -w $IMAGEDIR" "$GM_OUTPUTS/aaclip-write"
-#gm_test "--match simpleaaclip_path $CONFIGS -r $IMAGEDIR" "$GM_OUTPUTS/aaclip-readback"
-
 echo "All tests passed."