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 "nanobench.h" | 10 #include "nanobench.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 40 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
41 #include "nanobenchAndroid.h" | 41 #include "nanobenchAndroid.h" |
42 #endif | 42 #endif |
43 | 43 |
44 #if SK_SUPPORT_GPU | 44 #if SK_SUPPORT_GPU |
45 #include "gl/GrGLDefines.h" | 45 #include "gl/GrGLDefines.h" |
46 #include "GrContextFactory.h" | 46 #include "GrContextFactory.h" |
47 SkAutoTDelete<GrContextFactory> gGrFactory; | 47 SkAutoTDelete<GrContextFactory> gGrFactory; |
48 #endif | 48 #endif |
49 | 49 |
| 50 struct GrContextOptions; |
| 51 |
50 __SK_FORCE_IMAGE_DECODER_LINKING; | 52 __SK_FORCE_IMAGE_DECODER_LINKING; |
51 | 53 |
52 static const int kAutoTuneLoops = 0; | 54 static const int kAutoTuneLoops = 0; |
53 | 55 |
54 static const int kDefaultLoops = | 56 static const int kDefaultLoops = |
55 #ifdef SK_DEBUG | 57 #ifdef SK_DEBUG |
56 1; | 58 1; |
57 #else | 59 #else |
58 kAutoTuneLoops; | 60 kAutoTuneLoops; |
59 #endif | 61 #endif |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 const int fDivisor; | 839 const int fDivisor; |
838 }; | 840 }; |
839 | 841 |
840 int nanobench_main(); | 842 int nanobench_main(); |
841 int nanobench_main() { | 843 int nanobench_main() { |
842 SetupCrashHandler(); | 844 SetupCrashHandler(); |
843 SkAutoGraphics ag; | 845 SkAutoGraphics ag; |
844 SkTaskGroup::Enabler enabled; | 846 SkTaskGroup::Enabler enabled; |
845 | 847 |
846 #if SK_SUPPORT_GPU | 848 #if SK_SUPPORT_GPU |
847 GrContext::Options grContextOpts; | 849 GrContextOptions grContextOpts; |
848 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; | 850 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; |
849 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts))); | 851 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts))); |
850 #endif | 852 #endif |
851 | 853 |
852 if (FLAGS_veryVerbose) { | 854 if (FLAGS_veryVerbose) { |
853 FLAGS_verbose = true; | 855 FLAGS_verbose = true; |
854 } | 856 } |
855 | 857 |
856 if (kAutoTuneLoops != FLAGS_loops) { | 858 if (kAutoTuneLoops != FLAGS_loops) { |
857 FLAGS_samples = 1; | 859 FLAGS_samples = 1; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 | 1028 |
1027 return 0; | 1029 return 0; |
1028 } | 1030 } |
1029 | 1031 |
1030 #if !defined SK_BUILD_FOR_IOS | 1032 #if !defined SK_BUILD_FOR_IOS |
1031 int main(int argc, char** argv) { | 1033 int main(int argc, char** argv) { |
1032 SkCommandLineFlags::Parse(argc, argv); | 1034 SkCommandLineFlags::Parse(argc, argv); |
1033 return nanobench_main(); | 1035 return nanobench_main(); |
1034 } | 1036 } |
1035 #endif | 1037 #endif |
OLD | NEW |