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 "CrashHandler.h" |
9 #include "ResultsWriter.h" | 10 #include "ResultsWriter.h" |
10 #include "SkBenchLogger.h" | 11 #include "SkBenchLogger.h" |
11 #include "SkBenchmark.h" | 12 #include "SkBenchmark.h" |
12 #include "SkBitmapDevice.h" | 13 #include "SkBitmapDevice.h" |
13 #include "SkCanvas.h" | 14 #include "SkCanvas.h" |
14 #include "SkColorPriv.h" | 15 #include "SkColorPriv.h" |
15 #include "SkCommandLineFlags.h" | 16 #include "SkCommandLineFlags.h" |
16 #include "SkData.h" | 17 #include "SkData.h" |
17 #include "SkDeferredCanvas.h" | 18 #include "SkDeferredCanvas.h" |
18 #include "SkGMBench.h" | 19 #include "SkGMBench.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 if (currRaw < FLAGS_minMs) { | 267 if (currRaw < FLAGS_minMs) { |
267 return false; | 268 return false; |
268 } | 269 } |
269 const double low = 1 - FLAGS_error, high = 1 + FLAGS_error; | 270 const double low = 1 - FLAGS_error, high = 1 + FLAGS_error; |
270 const double ratio = currPerLoop / prevPerLoop; | 271 const double ratio = currPerLoop / prevPerLoop; |
271 return low < ratio && ratio < high; | 272 return low < ratio && ratio < high; |
272 } | 273 } |
273 | 274 |
274 int tool_main(int argc, char** argv); | 275 int tool_main(int argc, char** argv); |
275 int tool_main(int argc, char** argv) { | 276 int tool_main(int argc, char** argv) { |
| 277 SetupCrashHandler(); |
276 SkCommandLineFlags::Parse(argc, argv); | 278 SkCommandLineFlags::Parse(argc, argv); |
277 #if SK_ENABLE_INST_COUNT | 279 #if SK_ENABLE_INST_COUNT |
278 if (FLAGS_leaks) { | 280 if (FLAGS_leaks) { |
279 gPrintInstCount = true; | 281 gPrintInstCount = true; |
280 } | 282 } |
281 #endif | 283 #endif |
282 SkAutoGraphics ag; | 284 SkAutoGraphics ag; |
283 | 285 |
284 // First, parse some flags. | 286 // First, parse some flags. |
285 SkBenchLogger logger; | 287 SkBenchLogger logger; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 gContextFactory.destroyContexts(); | 686 gContextFactory.destroyContexts(); |
685 #endif | 687 #endif |
686 return 0; | 688 return 0; |
687 } | 689 } |
688 | 690 |
689 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 691 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
690 int main(int argc, char * const argv[]) { | 692 int main(int argc, char * const argv[]) { |
691 return tool_main(argc, (char**) argv); | 693 return tool_main(argc, (char**) argv); |
692 } | 694 } |
693 #endif | 695 #endif |
OLD | NEW |