| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "Timer.h" | 9 #include "Timer.h" |
| 10 #include "CopyTilesRenderer.h" | 10 #include "CopyTilesRenderer.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 DEFINE_bool(timeIndividualTiles, false, "Report times for drawing individual til
es, rather than " | 47 DEFINE_bool(timeIndividualTiles, false, "Report times for drawing individual til
es, rather than " |
| 48 "times for drawing the whole page. Requires tiled rendering."); | 48 "times for drawing the whole page. Requires tiled rendering."); |
| 49 DEFINE_bool(purgeDecodedTex, false, "Purge decoded and GPU-uploaded textures " | 49 DEFINE_bool(purgeDecodedTex, false, "Purge decoded and GPU-uploaded textures " |
| 50 "after each iteration."); | 50 "after each iteration."); |
| 51 DEFINE_string(timers, "c", "[wcgWC]*: Display wall, cpu, gpu, truncated wall or
truncated cpu time" | 51 DEFINE_string(timers, "c", "[wcgWC]*: Display wall, cpu, gpu, truncated wall or
truncated cpu time" |
| 52 " for each picture."); | 52 " for each picture."); |
| 53 DEFINE_bool(trackDeferredCaching, false, "Only meaningful with --deferImageDecod
ing and " | 53 DEFINE_bool(trackDeferredCaching, false, "Only meaningful with --deferImageDecod
ing and " |
| 54 "SK_LAZY_CACHE_STATS set to true. Report percentage of cache hits wh
en using " | 54 "SK_LAZY_CACHE_STATS set to true. Report percentage of cache hits wh
en using " |
| 55 "deferred image decoding."); | 55 "deferred image decoding."); |
| 56 | 56 |
| 57 #if GR_GPU_STATS |
| 58 DEFINE_bool(gpuStats, false, "Only meaningful with gpu configurations. " |
| 59 "Report some GPU call statistics."); |
| 60 #endif |
| 61 |
| 57 DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing b
efore timing."); | 62 DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing b
efore timing."); |
| 58 | 63 |
| 59 // Buildbot-specific parameters | 64 // Buildbot-specific parameters |
| 60 DEFINE_string(builderName, "", "Name of the builder this is running on."); | 65 DEFINE_string(builderName, "", "Name of the builder this is running on."); |
| 61 DEFINE_int32(buildNumber, -1, "Build number of the build this test is running on
"); | 66 DEFINE_int32(buildNumber, -1, "Build number of the build this test is running on
"); |
| 62 DEFINE_int32(timestamp, 0, "Timestamp of the revision of Skia being tested."); | 67 DEFINE_int32(timestamp, 0, "Timestamp of the revision of Skia being tested."); |
| 63 DEFINE_string(gitHash, "", "Commit hash of the revision of Skia being run."); | 68 DEFINE_string(gitHash, "", "Commit hash of the revision of Skia being run."); |
| 64 DEFINE_int32(gitNumber, -1, "Git number of the revision of Skia being run."); | 69 DEFINE_int32(gitNumber, -1, "Git number of the revision of Skia being run."); |
| 65 | 70 |
| 66 | 71 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 err.printf("Failed to run %i benchmarks.\n", failures); | 474 err.printf("Failed to run %i benchmarks.\n", failures); |
| 470 gLogger.logError(err); | 475 gLogger.logError(err); |
| 471 return 1; | 476 return 1; |
| 472 } | 477 } |
| 473 #if SK_LAZY_CACHE_STATS | 478 #if SK_LAZY_CACHE_STATS |
| 474 if (FLAGS_trackDeferredCaching) { | 479 if (FLAGS_trackDeferredCaching) { |
| 475 SkDebugf("Total cache hit rate: %f\n", | 480 SkDebugf("Total cache hit rate: %f\n", |
| 476 (double) gTotalCacheHits / (gTotalCacheHits + gTotalCacheMisses
)); | 481 (double) gTotalCacheHits / (gTotalCacheHits + gTotalCacheMisses
)); |
| 477 } | 482 } |
| 478 #endif | 483 #endif |
| 484 |
| 485 #if GR_GPU_STATS |
| 486 if (FLAGS_gpuStats && benchmark.renderer()->isUsingGpuDevice()) { |
| 487 GrContext* ctx = benchmark.renderer()->getGrContext(); |
| 488 SkDebugf("RenderTarget Binds: %d\n", ctx->gpuStats()->renderTargetBinds(
)); |
| 489 SkDebugf("Shader Compilations: %d\n", ctx->gpuStats()->shaderCompilation
s()); |
| 490 } |
| 491 #endif |
| 492 |
| 479 gWriter.end(); | 493 gWriter.end(); |
| 480 return 0; | 494 return 0; |
| 481 } | 495 } |
| 482 | 496 |
| 483 #if !defined SK_BUILD_FOR_IOS | 497 #if !defined SK_BUILD_FOR_IOS |
| 484 int main(int argc, char * const argv[]) { | 498 int main(int argc, char * const argv[]) { |
| 485 return tool_main(argc, (char**) argv); | 499 return tool_main(argc, (char**) argv); |
| 486 } | 500 } |
| 487 #endif | 501 #endif |
| OLD | NEW |