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