Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 /* | 8 /* |
| 9 * Code for the "gm" (Golden Master) rendering comparison tool. | 9 * Code for the "gm" (Golden Master) rendering comparison tool. |
| 10 * | 10 * |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 898 * | 898 * |
| 899 * TODO(epoger): This relies on the fact that | 899 * TODO(epoger): This relies on the fact that |
| 900 * force_all_opaque() was called on the bitmap before it | 900 * force_all_opaque() was called on the bitmap before it |
| 901 * was written to disk as a PNG in the first place. If | 901 * was written to disk as a PNG in the first place. If |
| 902 * not, the hash digest returned here may not match the | 902 * not, the hash digest returned here may not match the |
| 903 * hash digest of actualBitmap, which *has* been run through | 903 * hash digest of actualBitmap, which *has* been run through |
| 904 * force_all_opaque(). | 904 * force_all_opaque(). |
| 905 * See comments above complete_bitmap() for more detail. | 905 * See comments above complete_bitmap() for more detail. |
| 906 */ | 906 */ |
| 907 Expectations expectations = expectationsSource->get(nameWithExte nsion.c_str()); | 907 Expectations expectations = expectationsSource->get(nameWithExte nsion.c_str()); |
| 908 if (gm->isIgnoringFailures()) { | |
| 909 expectations.setIgnoreFailure(true); | |
| 910 } | |
| 908 errors.add(compare_to_expectations(expectations, *actualBitmapAn dDigest, | 911 errors.add(compare_to_expectations(expectations, *actualBitmapAn dDigest, |
| 909 gm->shortName(), configName, "", true)); | 912 gm->shortName(), configName, "", true)); |
| 910 } else { | 913 } else { |
| 911 // If we are running without expectations, we still want to | 914 // If we are running without expectations, we still want to |
| 912 // record the actual results. | 915 // record the actual results. |
| 913 add_actual_results_to_json_summary(nameWithExtension.c_str(), | 916 add_actual_results_to_json_summary(nameWithExtension.c_str(), |
| 914 actualBitmapAndDigest->fDiges t, | 917 actualBitmapAndDigest->fDiges t, |
| 915 ErrorCombination(kMissingExpe ctations_ErrorType), | 918 ErrorCombination(kMissingExpe ctations_ErrorType), |
| 916 false); | 919 false); |
| 917 errors.add(ErrorCombination(kMissingExpectations_ErrorType)); | 920 errors.add(ErrorCombination(kMissingExpectations_ErrorType)); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1373 #if SK_SUPPORT_GPU | 1376 #if SK_SUPPORT_GPU |
| 1374 DEFINE_string(gpuCacheSize, "", "<bytes> <count>: Limit the gpu cache to byte si ze or " | 1377 DEFINE_string(gpuCacheSize, "", "<bytes> <count>: Limit the gpu cache to byte si ze or " |
| 1375 "object count. " TOSTRING(DEFAULT_CACHE_VALUE) " for either value means " | 1378 "object count. " TOSTRING(DEFAULT_CACHE_VALUE) " for either value means " |
| 1376 "use the default. 0 for either disables the cache."); | 1379 "use the default. 0 for either disables the cache."); |
| 1377 #endif | 1380 #endif |
| 1378 DEFINE_bool(hierarchy, false, "Whether to use multilevel directory structure " | 1381 DEFINE_bool(hierarchy, false, "Whether to use multilevel directory structure " |
| 1379 "when reading/writing files."); | 1382 "when reading/writing files."); |
| 1380 DEFINE_string(ignoreErrorTypes, kDefaultIgnorableErrorTypes.asString(" ").c_str( ), | 1383 DEFINE_string(ignoreErrorTypes, kDefaultIgnorableErrorTypes.asString(" ").c_str( ), |
| 1381 "Space-separated list of ErrorTypes that should be ignored. If any *other* error " | 1384 "Space-separated list of ErrorTypes that should be ignored. If any *other* error " |
| 1382 "types are encountered, the tool will exit with a nonzero return v alue."); | 1385 "types are encountered, the tool will exit with a nonzero return v alue."); |
| 1386 DEFINE_string(ignoreTests, "", "Space delimited list of tests for which we shoul d ignore " | |
| 1387 "failures."); | |
| 1383 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" | 1388 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" |
| 1384 "Multiple matches may be separated by spaces.\n" | 1389 "Multiple matches may be separated by spaces.\n" |
| 1385 "~ causes a matching test to always be skipped\n" | 1390 "~ causes a matching test to always be skipped\n" |
| 1386 "^ requires the start of the test to match\n" | 1391 "^ requires the start of the test to match\n" |
| 1387 "$ requires the end of the test to match\n" | 1392 "$ requires the end of the test to match\n" |
| 1388 "^ and $ requires an exact match\n" | 1393 "^ and $ requires an exact match\n" |
| 1389 "If a test does not match any list entry,\n" | 1394 "If a test does not match any list entry,\n" |
| 1390 "it is skipped unless some list entry starts with ~"); | 1395 "it is skipped unless some list entry starts with ~"); |
| 1391 DEFINE_string(missingExpectationsPath, "", "Write images for tests without expec tations " | 1396 DEFINE_string(missingExpectationsPath, "", "Write images for tests without expec tations " |
| 1392 "into this directory."); | 1397 "into this directory."); |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2156 continue; | 2161 continue; |
| 2157 } | 2162 } |
| 2158 moduloStr.printf("[%d.%d] ", gmIndex, moduloDivisor); | 2163 moduloStr.printf("[%d.%d] ", gmIndex, moduloDivisor); |
| 2159 } | 2164 } |
| 2160 | 2165 |
| 2161 const char* shortName = gm->shortName(); | 2166 const char* shortName = gm->shortName(); |
| 2162 | 2167 |
| 2163 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, shortName)) { | 2168 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, shortName)) { |
| 2164 continue; | 2169 continue; |
| 2165 } | 2170 } |
| 2171 if (FLAGS_ignoreTests.contains(shortName)) { | |
|
epoger
2013/09/18 20:10:35
Patchset 3: if the --ignoreTests flag has been pas
scroggo
2013/09/18 20:16:54
Might it make sense to allow pattern matching? (If
epoger
2013/09/19 06:16:36
That's a worthy suggestion, thanks. As per https:
| |
| 2172 gm->setIgnoreFailures(true); | |
| 2173 } | |
| 2166 | 2174 |
| 2167 gmsRun++; | 2175 gmsRun++; |
| 2168 SkISize size = gm->getISize(); | 2176 SkISize size = gm->getISize(); |
| 2169 gm_fprintf(stdout, "%sdrawing... %s [%d %d]\n", moduloStr.c_str(), short Name, | 2177 gm_fprintf(stdout, "%sdrawing... %s [%d %d]\n", moduloStr.c_str(), short Name, |
| 2170 size.width(), size.height()); | 2178 size.width(), size.height()); |
| 2171 | 2179 |
| 2172 run_multiple_configs(gmmain, gm, configs, pdfRasterizers, grFactory); | 2180 run_multiple_configs(gmmain, gm, configs, pdfRasterizers, grFactory); |
| 2173 | 2181 |
| 2174 SkBitmap comparisonBitmap; | 2182 SkBitmap comparisonBitmap; |
| 2175 const ConfigData compareConfig = | 2183 const ConfigData compareConfig = |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2246 if (FLAGS_forceBWtext) { | 2254 if (FLAGS_forceBWtext) { |
| 2247 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2255 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
| 2248 } | 2256 } |
| 2249 } | 2257 } |
| 2250 | 2258 |
| 2251 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2259 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 2252 int main(int argc, char * const argv[]) { | 2260 int main(int argc, char * const argv[]) { |
| 2253 return tool_main(argc, (char**) argv); | 2261 return tool_main(argc, (char**) argv); |
| 2254 } | 2262 } |
| 2255 #endif | 2263 #endif |
| OLD | NEW |