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

Side by Side Diff: tools/render_pictures_main.cpp

Issue 655263005: Build gpu stats tracking in dev builds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up macro usage in render_pictures Created 6 years, 1 month 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 | « tools/bench_pictures_main.cpp ('k') | no next file » | 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 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
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
OLDNEW
« no previous file with comments | « tools/bench_pictures_main.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698