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 #include "BenchTimer.h" | 8 #include "BenchTimer.h" |
| 9 #include "ResultsWriter.h" | 9 #include "ResultsWriter.h" |
| 10 #include "SkBenchLogger.h" | 10 #include "SkBenchLogger.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 DEFINE_bool(clip, false, "Clip canvas before bench run?"); | 245 DEFINE_bool(clip, false, "Clip canvas before bench run?"); |
| 246 | 246 |
| 247 DEFINE_bool(forceAA, true, "Force anti-aliasing?"); | 247 DEFINE_bool(forceAA, true, "Force anti-aliasing?"); |
| 248 DEFINE_bool(forceFilter, false, "Force bitmap filtering?"); | 248 DEFINE_bool(forceFilter, false, "Force bitmap filtering?"); |
| 249 DEFINE_string(forceDither, "default", "Force dithering: true, false, or default? "); | 249 DEFINE_string(forceDither, "default", "Force dithering: true, false, or default? "); |
| 250 DEFINE_bool(forceBlend, false, "Force alpha blending?"); | 250 DEFINE_bool(forceBlend, false, "Force alpha blending?"); |
| 251 | 251 |
| 252 DEFINE_int32(gpuCacheBytes, -1, "GPU cache size limit in bytes. 0 to disable ca che."); | 252 DEFINE_int32(gpuCacheBytes, -1, "GPU cache size limit in bytes. 0 to disable ca che."); |
| 253 DEFINE_int32(gpuCacheCount, -1, "GPU cache size limit in object count. 0 to dis able cache."); | 253 DEFINE_int32(gpuCacheCount, -1, "GPU cache size limit in object count. 0 to dis able cache."); |
| 254 | 254 |
| 255 DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects."); | |
| 255 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" | 256 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" |
| 256 "Multiple matches may be separated by spaces.\n" | 257 "Multiple matches may be separated by spaces.\n" |
| 257 "~ causes a matching test to always be skipped\n" | 258 "~ causes a matching test to always be skipped\n" |
| 258 "^ requires the start of the test to match\n" | 259 "^ requires the start of the test to match\n" |
| 259 "$ requires the end of the test to match\n" | 260 "$ requires the end of the test to match\n" |
| 260 "^ and $ requires an exact match\n" | 261 "^ and $ requires an exact match\n" |
| 261 "If a test does not match any list entry,\n" | 262 "If a test does not match any list entry,\n" |
| 262 "it is skipped unless some list entry starts with ~\n" ); | 263 "it is skipped unless some list entry starts with ~\n" ); |
| 263 DEFINE_string(mode, "normal", | 264 DEFINE_string(mode, "normal", |
| 264 "normal: draw to a normal canvas;\n" | 265 "normal: draw to a normal canvas;\n" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 284 if (currRaw < FLAGS_minMs) { | 285 if (currRaw < FLAGS_minMs) { |
| 285 return false; | 286 return false; |
| 286 } | 287 } |
| 287 const double low = 1 - FLAGS_error, high = 1 + FLAGS_error; | 288 const double low = 1 - FLAGS_error, high = 1 + FLAGS_error; |
| 288 const double ratio = currPerLoop / prevPerLoop; | 289 const double ratio = currPerLoop / prevPerLoop; |
| 289 return low < ratio && ratio < high; | 290 return low < ratio && ratio < high; |
| 290 } | 291 } |
| 291 | 292 |
| 292 int tool_main(int argc, char** argv); | 293 int tool_main(int argc, char** argv); |
| 293 int tool_main(int argc, char** argv) { | 294 int tool_main(int argc, char** argv) { |
| 295 SkCommandLineFlags::Parse(argc, argv); | |
| 294 #if SK_ENABLE_INST_COUNT | 296 #if SK_ENABLE_INST_COUNT |
| 295 gPrintInstCount = true; | 297 if (FLAGS_leaks) { |
| 298 gPrintInstCount = true; | |
|
mtklein
2014/01/23 15:24:15
Even, gPrintInstCount = FLAGS_leaks;
| |
| 299 } | |
| 296 #endif | 300 #endif |
| 297 SkAutoGraphics ag; | 301 SkAutoGraphics ag; |
| 298 SkCommandLineFlags::Parse(argc, argv); | |
| 299 | 302 |
| 300 // First, parse some flags. | 303 // First, parse some flags. |
| 301 SkBenchLogger logger; | 304 SkBenchLogger logger; |
| 302 if (FLAGS_logFile.count()) { | 305 if (FLAGS_logFile.count()) { |
| 303 logger.SetLogFile(FLAGS_logFile[0]); | 306 logger.SetLogFile(FLAGS_logFile[0]); |
| 304 } | 307 } |
| 305 | 308 |
| 306 LoggerResultsWriter logWriter(logger, FLAGS_timeFormat[0]); | 309 LoggerResultsWriter logWriter(logger, FLAGS_timeFormat[0]); |
| 307 MultiResultsWriter writer; | 310 MultiResultsWriter writer; |
| 308 writer.add(&logWriter); | 311 writer.add(&logWriter); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 gContextFactory.destroyContexts(); | 690 gContextFactory.destroyContexts(); |
| 688 #endif | 691 #endif |
| 689 return 0; | 692 return 0; |
| 690 } | 693 } |
| 691 | 694 |
| 692 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 695 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 693 int main(int argc, char * const argv[]) { | 696 int main(int argc, char * const argv[]) { |
| 694 return tool_main(argc, (char**) argv); | 697 return tool_main(argc, (char**) argv); |
| 695 } | 698 } |
| 696 #endif | 699 #endif |
| OLD | NEW |