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(); | |
576 int nanobench_main() { | 575 int nanobench_main() { |
577 SetupCrashHandler(); | |
578 SkAutoGraphics ag; | 576 SkAutoGraphics ag; |
579 | 577 |
580 #if SK_SUPPORT_GPU | 578 #if SK_SUPPORT_GPU |
581 GrContext::Options grContextOpts; | 579 GrContext::Options grContextOpts; |
582 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; | 580 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; |
583 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts))); | 581 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts))); |
584 #endif | 582 #endif |
585 | 583 |
586 if (FLAGS_veryVerbose) { | 584 if (FLAGS_veryVerbose) { |
587 FLAGS_verbose = true; | 585 FLAGS_verbose = true; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 } | 743 } |
746 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) { | 744 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) { |
747 gGrFactory->destroyContexts(); | 745 gGrFactory->destroyContexts(); |
748 } | 746 } |
749 #endif | 747 #endif |
750 } | 748 } |
751 | 749 |
752 return 0; | 750 return 0; |
753 } | 751 } |
754 | 752 |
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 |