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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 sleep(kSec); | 1018 sleep(kSec); |
1019 #endif | 1019 #endif |
1020 SkDebugf("\nBenchmarks still running...\n"); | 1020 SkDebugf("\nBenchmarks still running...\n"); |
1021 } | 1021 } |
1022 } | 1022 } |
1023 }; | 1023 }; |
1024 static SkThread* intentionallyLeaked = new SkThread(Loop::forever); | 1024 static SkThread* intentionallyLeaked = new SkThread(Loop::forever); |
1025 intentionallyLeaked->start(); | 1025 intentionallyLeaked->start(); |
1026 } | 1026 } |
1027 | 1027 |
1028 extern bool gDefaultProfileIsSRGB; | |
1029 | |
1030 int nanobench_main(); | 1028 int nanobench_main(); |
1031 int nanobench_main() { | 1029 int nanobench_main() { |
1032 SetupCrashHandler(); | 1030 SetupCrashHandler(); |
1033 SkAutoGraphics ag; | 1031 SkAutoGraphics ag; |
1034 SkTaskGroup::Enabler enabled(FLAGS_threads); | 1032 SkTaskGroup::Enabler enabled(FLAGS_threads); |
1035 | 1033 |
1036 #if SK_SUPPORT_GPU | 1034 #if SK_SUPPORT_GPU |
1037 GrContextOptions grContextOpts; | 1035 GrContextOptions grContextOpts; |
1038 gGrFactory.reset(new GrContextFactory(grContextOpts)); | 1036 gGrFactory.reset(new GrContextFactory(grContextOpts)); |
1039 #endif | 1037 #endif |
1040 | 1038 |
1041 if (FLAGS_forceSRGB) { | |
1042 gDefaultProfileIsSRGB = true; | |
1043 } | |
1044 | |
1045 if (FLAGS_veryVerbose) { | 1039 if (FLAGS_veryVerbose) { |
1046 FLAGS_verbose = true; | 1040 FLAGS_verbose = true; |
1047 } | 1041 } |
1048 | 1042 |
1049 if (kAutoTuneLoops != FLAGS_loops) { | 1043 if (kAutoTuneLoops != FLAGS_loops) { |
1050 FLAGS_samples = 1; | 1044 FLAGS_samples = 1; |
1051 FLAGS_gpuFrameLag = 0; | 1045 FLAGS_gpuFrameLag = 0; |
1052 } | 1046 } |
1053 | 1047 |
1054 if (!FLAGS_writePath.isEmpty()) { | 1048 if (!FLAGS_writePath.isEmpty()) { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 | 1282 |
1289 return 0; | 1283 return 0; |
1290 } | 1284 } |
1291 | 1285 |
1292 #if !defined SK_BUILD_FOR_IOS | 1286 #if !defined SK_BUILD_FOR_IOS |
1293 int main(int argc, char** argv) { | 1287 int main(int argc, char** argv) { |
1294 SkCommandLineFlags::Parse(argc, argv); | 1288 SkCommandLineFlags::Parse(argc, argv); |
1295 return nanobench_main(); | 1289 return nanobench_main(); |
1296 } | 1290 } |
1297 #endif | 1291 #endif |
OLD | NEW |