Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: bench/benchmain.cpp

Issue 376643002: gpu and cpu flags for gm and bench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix indentation Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gm/gmmain.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "BenchLogger.h" 8 #include "BenchLogger.h"
9 #include "Benchmark.h" 9 #include "Benchmark.h"
10 #include "CrashHandler.h" 10 #include "CrashHandler.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 DEFINE_string(forceDither, "default", "Force dithering: true, false, or default? "); 230 DEFINE_string(forceDither, "default", "Force dithering: true, false, or default? ");
231 DEFINE_bool(forceBlend, false, "Force alpha blending?"); 231 DEFINE_bool(forceBlend, false, "Force alpha blending?");
232 232
233 DEFINE_string(gpuAPI, "", "Force use of specific gpu API. Using \"gl\" " 233 DEFINE_string(gpuAPI, "", "Force use of specific gpu API. Using \"gl\" "
234 "forces OpenGL API. Using \"gles\" forces OpenGL ES API. " 234 "forces OpenGL API. Using \"gles\" forces OpenGL ES API. "
235 "Defaults to empty string, which selects the API native to the " 235 "Defaults to empty string, which selects the API native to the "
236 "system."); 236 "system.");
237 DEFINE_int32(gpuCacheBytes, -1, "GPU cache size limit in bytes. 0 to disable ca che."); 237 DEFINE_int32(gpuCacheBytes, -1, "GPU cache size limit in bytes. 0 to disable ca che.");
238 DEFINE_int32(gpuCacheCount, -1, "GPU cache size limit in object count. 0 to dis able cache."); 238 DEFINE_int32(gpuCacheCount, -1, "GPU cache size limit in object count. 0 to dis able cache.");
239 239
240 DEFINE_bool(gpu, true, "Allows GPU configs to be run. Applied after --configs.") ;
241 DEFINE_bool(cpu, true, "Allows non-GPU configs to be run. Applied after --config .");
242
240 DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects."); 243 DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects.");
241 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" 244 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n"
242 "Multiple matches may be separated by spaces.\n" 245 "Multiple matches may be separated by spaces.\n"
243 "~ causes a matching test to always be skipped\n" 246 "~ causes a matching test to always be skipped\n"
244 "^ requires the start of the test to match\n" 247 "^ requires the start of the test to match\n"
245 "$ requires the end of the test to match\n" 248 "$ requires the end of the test to match\n"
246 "^ and $ requires an exact match\n" 249 "^ and $ requires an exact match\n"
247 "If a test does not match any list entry,\n" 250 "If a test does not match any list entry,\n"
248 "it is skipped unless some list entry starts with ~\n" ); 251 "it is skipped unless some list entry starts with ~\n" );
249 DEFINE_string(mode, "normal", 252 DEFINE_string(mode, "normal",
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 if (kNormal_BenchMode != benchMode) { 349 if (kNormal_BenchMode != benchMode) {
347 // Non-rendering configs only run in normal mode 350 // Non-rendering configs only run in normal mode
348 for (int i = 0; i < configs.count(); ++i) { 351 for (int i = 0; i < configs.count(); ++i) {
349 const Config& config = gConfigs[configs[i]]; 352 const Config& config = gConfigs[configs[i]];
350 if (Benchmark::kNonRendering_Backend == config.backend) { 353 if (Benchmark::kNonRendering_Backend == config.backend) {
351 configs.remove(i, 1); 354 configs.remove(i, 1);
352 --i; 355 --i;
353 } 356 }
354 } 357 }
355 } 358 }
359 // Apply the gpu/cpu only flags
360 for (int i = 0; i < configs.count(); ++i) {
361 const Config& config = gConfigs[configs[i]];
362 if (config.backend == Benchmark::kGPU_Backend) {
363 if (!FLAGS_gpu) {
364 configs.remove(i, 1);
365 --i;
366 }
367 } else if (!FLAGS_cpu) {
368 configs.remove(i, 1);
369 --i;
370 }
371 }
356 372
357 #if SK_SUPPORT_GPU 373 #if SK_SUPPORT_GPU
358 GrGLStandard gpuAPI = kNone_GrGLStandard; 374 GrGLStandard gpuAPI = kNone_GrGLStandard;
359 if (1 == FLAGS_gpuAPI.count()) { 375 if (1 == FLAGS_gpuAPI.count()) {
360 if (FLAGS_gpuAPI.contains(kGpuAPINameGL)) { 376 if (FLAGS_gpuAPI.contains(kGpuAPINameGL)) {
361 gpuAPI = kGL_GrGLStandard; 377 gpuAPI = kGL_GrGLStandard;
362 } else if (FLAGS_gpuAPI.contains(kGpuAPINameGLES)) { 378 } else if (FLAGS_gpuAPI.contains(kGpuAPINameGLES)) {
363 gpuAPI = kGLES_GrGLStandard; 379 gpuAPI = kGLES_GrGLStandard;
364 } else { 380 } else {
365 SkDebugf("Selected gpu API could not be used. Using the default.\n") ; 381 SkDebugf("Selected gpu API could not be used. Using the default.\n") ;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 gContextFactory.destroyContexts(); 713 gContextFactory.destroyContexts();
698 #endif 714 #endif
699 return 0; 715 return 0;
700 } 716 }
701 717
702 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 718 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
703 int main(int argc, char * const argv[]) { 719 int main(int argc, char * const argv[]) {
704 return tool_main(argc, (char**) argv); 720 return tool_main(argc, (char**) argv);
705 } 721 }
706 #endif 722 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698