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 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 "use the default. 0 for either disables the cache."); | 1423 "use the default. 0 for either disables the cache."); |
1424 #endif | 1424 #endif |
1425 DEFINE_bool(hierarchy, false, "Whether to use multilevel directory structure " | 1425 DEFINE_bool(hierarchy, false, "Whether to use multilevel directory structure " |
1426 "when reading/writing files."); | 1426 "when reading/writing files."); |
1427 DEFINE_string(ignoreErrorTypes, kDefaultIgnorableErrorTypes.asString(" ").c_str(
), | 1427 DEFINE_string(ignoreErrorTypes, kDefaultIgnorableErrorTypes.asString(" ").c_str(
), |
1428 "Space-separated list of ErrorTypes that should be ignored. If any
*other* error " | 1428 "Space-separated list of ErrorTypes that should be ignored. If any
*other* error " |
1429 "types are encountered, the tool will exit with a nonzero return v
alue."); | 1429 "types are encountered, the tool will exit with a nonzero return v
alue."); |
1430 DEFINE_string(ignoreFailuresFile, "", "Path to file containing a list of tests f
or which we " | 1430 DEFINE_string(ignoreFailuresFile, "", "Path to file containing a list of tests f
or which we " |
1431 "should ignore failures.\n" | 1431 "should ignore failures.\n" |
1432 "The file should list one test per line, except for comment lines
starting with #"); | 1432 "The file should list one test per line, except for comment lines
starting with #"); |
| 1433 DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects."); |
1433 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" | 1434 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" |
1434 "Multiple matches may be separated by spaces.\n" | 1435 "Multiple matches may be separated by spaces.\n" |
1435 "~ causes a matching test to always be skipped\n" | 1436 "~ causes a matching test to always be skipped\n" |
1436 "^ requires the start of the test to match\n" | 1437 "^ requires the start of the test to match\n" |
1437 "$ requires the end of the test to match\n" | 1438 "$ requires the end of the test to match\n" |
1438 "^ and $ requires an exact match\n" | 1439 "^ and $ requires an exact match\n" |
1439 "If a test does not match any list entry,\n" | 1440 "If a test does not match any list entry,\n" |
1440 "it is skipped unless some list entry starts with ~"); | 1441 "it is skipped unless some list entry starts with ~"); |
1441 DEFINE_string(missingExpectationsPath, "", "Write images for tests without expec
tations " | 1442 DEFINE_string(missingExpectationsPath, "", "Write images for tests without expec
tations " |
1442 "into this directory."); | 1443 "into this directory."); |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2191 if (FLAGS_pdfJpegQuality < -1 || FLAGS_pdfJpegQuality > 100) { | 2192 if (FLAGS_pdfJpegQuality < -1 || FLAGS_pdfJpegQuality > 100) { |
2192 gm_fprintf(stderr, "%s\n", "pdfJpegQuality must be in [-1 .. 100] range.
"); | 2193 gm_fprintf(stderr, "%s\n", "pdfJpegQuality must be in [-1 .. 100] range.
"); |
2193 return false; | 2194 return false; |
2194 } | 2195 } |
2195 return true; | 2196 return true; |
2196 } | 2197 } |
2197 | 2198 |
2198 int tool_main(int argc, char** argv); | 2199 int tool_main(int argc, char** argv); |
2199 int tool_main(int argc, char** argv) { | 2200 int tool_main(int argc, char** argv) { |
2200 | 2201 |
| 2202 SkString usage; |
| 2203 usage.printf("Run the golden master tests.\n"); |
| 2204 SkCommandLineFlags::SetUsage(usage.c_str()); |
| 2205 SkCommandLineFlags::Parse(argc, argv); |
| 2206 |
2201 #if SK_ENABLE_INST_COUNT | 2207 #if SK_ENABLE_INST_COUNT |
2202 gPrintInstCount = true; | 2208 if (FLAGS_leaks) { |
| 2209 gPrintInstCount = true; |
| 2210 } |
2203 #endif | 2211 #endif |
2204 | 2212 |
2205 SkGraphics::Init(); | 2213 SkGraphics::Init(); |
2206 // we don't need to see this during a run | 2214 // we don't need to see this during a run |
2207 gSkSuppressFontCachePurgeSpew = true; | 2215 gSkSuppressFontCachePurgeSpew = true; |
2208 | 2216 |
2209 setSystemPreferences(); | 2217 setSystemPreferences(); |
2210 GMMain gmmain; | 2218 GMMain gmmain; |
2211 | 2219 |
2212 SkString usage; | |
2213 usage.printf("Run the golden master tests.\n"); | |
2214 SkCommandLineFlags::SetUsage(usage.c_str()); | |
2215 SkCommandLineFlags::Parse(argc, argv); | |
2216 | |
2217 SkTDArray<size_t> configs; | 2220 SkTDArray<size_t> configs; |
2218 | 2221 |
2219 int moduloRemainder = -1; | 2222 int moduloRemainder = -1; |
2220 int moduloDivisor = -1; | 2223 int moduloDivisor = -1; |
2221 SkTDArray<const PDFRasterizerData*> pdfRasterizers; | 2224 SkTDArray<const PDFRasterizerData*> pdfRasterizers; |
2222 SkTDArray<SkScalar> tileGridReplayScales; | 2225 SkTDArray<SkScalar> tileGridReplayScales; |
2223 #if SK_SUPPORT_GPU | 2226 #if SK_SUPPORT_GPU |
2224 GrContextFactory* grFactory = new GrContextFactory; | 2227 GrContextFactory* grFactory = new GrContextFactory; |
2225 #else | 2228 #else |
2226 GrContextFactory* grFactory = NULL; | 2229 GrContextFactory* grFactory = NULL; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2409 if (FLAGS_forceBWtext) { | 2412 if (FLAGS_forceBWtext) { |
2410 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2413 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2411 } | 2414 } |
2412 } | 2415 } |
2413 | 2416 |
2414 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2417 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2415 int main(int argc, char * const argv[]) { | 2418 int main(int argc, char * const argv[]) { |
2416 return tool_main(argc, (char**) argv); | 2419 return tool_main(argc, (char**) argv); |
2417 } | 2420 } |
2418 #endif | 2421 #endif |
OLD | NEW |