OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 for (size_t i = 0; i < SK_ARRAY_COUNT(BenchMode_Name); i++) { | 324 for (size_t i = 0; i < SK_ARRAY_COUNT(BenchMode_Name); i++) { |
325 if (strcmp(FLAGS_mode[0], BenchMode_Name[i]) == 0) { | 325 if (strcmp(FLAGS_mode[0], BenchMode_Name[i]) == 0) { |
326 benchMode = static_cast<BenchMode>(i); | 326 benchMode = static_cast<BenchMode>(i); |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 SkTDArray<int> configs; | 330 SkTDArray<int> configs; |
331 bool runDefaultConfigs = false; | 331 bool runDefaultConfigs = false; |
332 // Try user-given configs first. | 332 // Try user-given configs first. |
333 for (int i = 0; i < FLAGS_config.count(); i++) { | 333 for (int i = 0; i < FLAGS_config.count(); i++) { |
334 for (size_t j = 0; j < SK_ARRAY_COUNT(gConfigs); j++) { | 334 for (int j = 0; j < static_cast<int>(SK_ARRAY_COUNT(gConfigs)); ++j) { |
335 if (0 == strcmp(FLAGS_config[i], gConfigs[j].name)) { | 335 if (0 == strcmp(FLAGS_config[i], gConfigs[j].name)) { |
336 *configs.append() = j; | 336 *configs.append() = j; |
337 } else if (0 == strcmp(FLAGS_config[i], kDefaultsConfigStr)) { | 337 } else if (0 == strcmp(FLAGS_config[i], kDefaultsConfigStr)) { |
338 runDefaultConfigs = true; | 338 runDefaultConfigs = true; |
339 } | 339 } |
340 } | 340 } |
341 } | 341 } |
342 // If there weren't any, fill in with defaults. | 342 // If there weren't any, fill in with defaults. |
343 if (runDefaultConfigs) { | 343 if (runDefaultConfigs) { |
344 for (size_t i = 0; i < SK_ARRAY_COUNT(gConfigs); ++i) { | 344 for (int i = 0; i < static_cast<int>(SK_ARRAY_COUNT(gConfigs)); ++i) { |
345 if (gConfigs[i].runByDefault) { | 345 if (gConfigs[i].runByDefault) { |
346 *configs.append() = i; | 346 *configs.append() = i; |
347 } | 347 } |
348 } | 348 } |
349 } | 349 } |
350 // Filter out things we can't run. | 350 // Filter out things we can't run. |
351 if (kNormal_BenchMode != benchMode) { | 351 if (kNormal_BenchMode != benchMode) { |
352 // Non-rendering configs only run in normal mode | 352 // Non-rendering configs only run in normal mode |
353 for (int i = 0; i < configs.count(); ++i) { | 353 for (int i = 0; i < configs.count(); ++i) { |
354 const Config& config = gConfigs[configs[i]]; | 354 const Config& config = gConfigs[configs[i]]; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 gContextFactory.destroyContexts(); | 707 gContextFactory.destroyContexts(); |
708 #endif | 708 #endif |
709 return 0; | 709 return 0; |
710 } | 710 } |
711 | 711 |
712 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 712 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
713 int main(int argc, char * const argv[]) { | 713 int main(int argc, char * const argv[]) { |
714 return tool_main(argc, (char**) argv); | 714 return tool_main(argc, (char**) argv); |
715 } | 715 } |
716 #endif | 716 #endif |
OLD | NEW |