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 "LazyDecodeBitmap.h" | 8 #include "LazyDecodeBitmap.h" |
9 #include "CopyTilesRenderer.h" | 9 #include "CopyTilesRenderer.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 467 |
468 int failures = 0; | 468 int failures = 0; |
469 for (int i = 0; i < FLAGS_readPath.count(); i ++) { | 469 for (int i = 0; i < FLAGS_readPath.count(); i ++) { |
470 failures += process_input(FLAGS_readPath[i], &writePath, &mismatchPath,
*renderer.get(), | 470 failures += process_input(FLAGS_readPath[i], &writePath, &mismatchPath,
*renderer.get(), |
471 jsonSummaryPtr); | 471 jsonSummaryPtr); |
472 } | 472 } |
473 if (failures != 0) { | 473 if (failures != 0) { |
474 SkDebugf("Failed to render %i pictures.\n", failures); | 474 SkDebugf("Failed to render %i pictures.\n", failures); |
475 return 1; | 475 return 1; |
476 } | 476 } |
477 #if SK_SUPPORT_GPU | 477 #if GR_CACHE_STATS && SK_SUPPORT_GPU |
478 #if GR_CACHE_STATS | |
479 if (renderer->isUsingGpuDevice()) { | 478 if (renderer->isUsingGpuDevice()) { |
480 GrContext* ctx = renderer->getGrContext(); | 479 GrContext* ctx = renderer->getGrContext(); |
481 ctx->printCacheStats(); | 480 ctx->printCacheStats(); |
482 #ifdef SK_DEVELOPER | 481 #ifdef SK_DEVELOPER |
483 ctx->dumpFontCache(); | 482 ctx->dumpFontCache(); |
484 #endif | 483 #endif |
485 } | 484 } |
486 #endif | 485 #endif |
487 #if GR_GPU_STATS | 486 |
| 487 #if GR_GPU_STATS && SK_SUPPORT_GPU |
488 if (FLAGS_gpuStats && renderer->isUsingGpuDevice()) { | 488 if (FLAGS_gpuStats && renderer->isUsingGpuDevice()) { |
489 GrContext* ctx = renderer->getGrContext(); | 489 GrContext* ctx = renderer->getGrContext(); |
490 SkDebugf("RenderTarget Binds: %d\n", ctx->gpuStats()->renderTargetBinds(
)); | 490 SkDebugf("RenderTarget Binds: %d\n", ctx->gpuStats()->renderTargetBinds(
)); |
491 SkDebugf("Shader Compilations: %d\n", ctx->gpuStats()->shaderCompilation
s()); | 491 SkDebugf("Shader Compilations: %d\n", ctx->gpuStats()->shaderCompilation
s()); |
492 } | 492 } |
493 #endif | 493 #endif |
494 #endif | 494 |
495 if (FLAGS_writeJsonSummaryPath.count() == 1) { | 495 if (FLAGS_writeJsonSummaryPath.count() == 1) { |
496 // If there were any descriptions on the command line, insert them now. | 496 // If there were any descriptions on the command line, insert them now. |
497 for (int i=0; i<FLAGS_descriptions.count(); i++) { | 497 for (int i=0; i<FLAGS_descriptions.count(); i++) { |
498 SkTArray<SkString> tokens; | 498 SkTArray<SkString> tokens; |
499 SkStrSplit(FLAGS_descriptions[i], "=", &tokens); | 499 SkStrSplit(FLAGS_descriptions[i], "=", &tokens); |
500 SkASSERT(tokens.count() == 2); | 500 SkASSERT(tokens.count() == 2); |
501 jsonSummary.addDescription(tokens[0].c_str(), tokens[1].c_str()); | 501 jsonSummary.addDescription(tokens[0].c_str(), tokens[1].c_str()); |
502 } | 502 } |
503 if (FLAGS_imageBaseGSUrl.count() == 1) { | 503 if (FLAGS_imageBaseGSUrl.count() == 1) { |
504 jsonSummary.setImageBaseGSUrl(FLAGS_imageBaseGSUrl[0]); | 504 jsonSummary.setImageBaseGSUrl(FLAGS_imageBaseGSUrl[0]); |
505 } | 505 } |
506 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); | 506 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); |
507 } | 507 } |
508 return 0; | 508 return 0; |
509 } | 509 } |
510 | 510 |
511 #if !defined SK_BUILD_FOR_IOS | 511 #if !defined SK_BUILD_FOR_IOS |
512 int main(int argc, char * const argv[]) { | 512 int main(int argc, char * const argv[]) { |
513 return tool_main(argc, (char**) argv); | 513 return tool_main(argc, (char**) argv); |
514 } | 514 } |
515 #endif | 515 #endif |
OLD | NEW |