OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "Benchmark.h" | 10 #include "Benchmark.h" |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 SkTArray<SkScalar> fScales; | 565 SkTArray<SkScalar> fScales; |
566 SkTArray<SkString> fSKPs; | 566 SkTArray<SkString> fSKPs; |
567 | 567 |
568 const char* fSourceType; // What we're benching: bench, GM, SKP, ... | 568 const char* fSourceType; // What we're benching: bench, GM, SKP, ... |
569 const char* fBenchType; // How we bench it: micro, recording, playback, ..
. | 569 const char* fBenchType; // How we bench it: micro, recording, playback, ..
. |
570 int fCurrentRecording; | 570 int fCurrentRecording; |
571 int fCurrentScale; | 571 int fCurrentScale; |
572 int fCurrentSKP; | 572 int fCurrentSKP; |
573 }; | 573 }; |
574 | 574 |
| 575 int nanobench_main(); |
575 int nanobench_main() { | 576 int nanobench_main() { |
| 577 SetupCrashHandler(); |
576 SkAutoGraphics ag; | 578 SkAutoGraphics ag; |
577 | 579 |
578 #if SK_SUPPORT_GPU | 580 #if SK_SUPPORT_GPU |
579 GrContext::Options grContextOpts; | 581 GrContext::Options grContextOpts; |
580 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; | 582 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; |
581 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts))); | 583 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts))); |
582 #endif | 584 #endif |
583 | 585 |
584 if (FLAGS_veryVerbose) { | 586 if (FLAGS_veryVerbose) { |
585 FLAGS_verbose = true; | 587 FLAGS_verbose = true; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 } | 745 } |
744 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) { | 746 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) { |
745 gGrFactory->destroyContexts(); | 747 gGrFactory->destroyContexts(); |
746 } | 748 } |
747 #endif | 749 #endif |
748 } | 750 } |
749 | 751 |
750 return 0; | 752 return 0; |
751 } | 753 } |
752 | 754 |
| 755 #if !defined SK_BUILD_FOR_IOS |
| 756 int main(int argc, char** argv) { |
| 757 SkCommandLineFlags::Parse(argc, argv); |
| 758 return nanobench_main(); |
| 759 } |
| 760 #endif |
OLD | NEW |