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

Side by Side Diff: tools/render_pictures_main.cpp

Issue 553583008: Add counting of some GL calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update for merge conflict Created 6 years, 3 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 | « 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 18 matching lines...) Expand all
29 DEFINE_bool(bench_record, false, "If true, drop into an infinite loop of recordi ng the picture."); 29 DEFINE_bool(bench_record, false, "If true, drop into an infinite loop of recordi ng the picture.");
30 DECLARE_bool(deferImageDecoding); 30 DECLARE_bool(deferImageDecoding);
31 DEFINE_string(descriptions, "", "one or more key=value pairs to add to the descr iptions section " 31 DEFINE_string(descriptions, "", "one or more key=value pairs to add to the descr iptions section "
32 "of the JSON summary."); 32 "of the JSON summary.");
33 DEFINE_string(imageBaseGSUrl, "", "The Google Storage image base URL the images are stored in."); 33 DEFINE_string(imageBaseGSUrl, "", "The Google Storage image base URL the images are stored in.");
34 DEFINE_int32(maxComponentDiff, 256, "Maximum diff on a component, 0 - 256. Compo nents that differ " 34 DEFINE_int32(maxComponentDiff, 256, "Maximum diff on a component, 0 - 256. Compo nents that differ "
35 "by more than this amount are considered errors, though all diffs a re reported. " 35 "by more than this amount are considered errors, though all diffs a re reported. "
36 "Requires --validate."); 36 "Requires --validate.");
37 DEFINE_string(mismatchPath, "", "Write images for tests that failed due to " 37 DEFINE_string(mismatchPath, "", "Write images for tests that failed due to "
38 "pixel mismatches into this directory."); 38 "pixel mismatches into this directory.");
39 #if GR_GPU_STATS
40 DEFINE_bool(gpuStats, false, "Only meaningful with gpu configurations. "
41 "Report some GPU call statistics.");
42 #endif
39 DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing b efore rendering."); 43 DEFINE_bool(preprocess, false, "If true, perform device specific preprocessing b efore rendering.");
40 DEFINE_string(readJsonSummaryPath, "", "JSON file to read image expectations fro m."); 44 DEFINE_string(readJsonSummaryPath, "", "JSON file to read image expectations fro m.");
41 DECLARE_string(readPath); 45 DECLARE_string(readPath);
42 DEFINE_bool(writeChecksumBasedFilenames, false, 46 DEFINE_bool(writeChecksumBasedFilenames, false,
43 "When writing out images, use checksum-based filenames."); 47 "When writing out images, use checksum-based filenames.");
44 DEFINE_bool(writeEncodedImages, false, "Any time the skp contains an encoded ima ge, write it to a " 48 DEFINE_bool(writeEncodedImages, false, "Any time the skp contains an encoded ima ge, write it to a "
45 "file rather than decoding it. Requires writePath to be set. Skips d rawing the full " 49 "file rather than decoding it. Requires writePath to be set. Skips d rawing the full "
46 "skp to a file. Not compatible with deferImageDecoding."); 50 "skp to a file. Not compatible with deferImageDecoding.");
47 DEFINE_string(writeJsonSummaryPath, "", "File to write a JSON summary of image r esults to."); 51 DEFINE_string(writeJsonSummaryPath, "", "File to write a JSON summary of image r esults to.");
48 DEFINE_string2(writePath, w, "", "Directory to write the rendered images into.") ; 52 DEFINE_string2(writePath, w, "", "Directory to write the rendered images into.") ;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 #if SK_SUPPORT_GPU 493 #if SK_SUPPORT_GPU
490 #if GR_CACHE_STATS 494 #if GR_CACHE_STATS
491 if (renderer->isUsingGpuDevice()) { 495 if (renderer->isUsingGpuDevice()) {
492 GrContext* ctx = renderer->getGrContext(); 496 GrContext* ctx = renderer->getGrContext();
493 ctx->printCacheStats(); 497 ctx->printCacheStats();
494 #ifdef SK_DEVELOPER 498 #ifdef SK_DEVELOPER
495 ctx->dumpFontCache(); 499 ctx->dumpFontCache();
496 #endif 500 #endif
497 } 501 }
498 #endif 502 #endif
503 #if GR_GPU_STATS
504 if (FLAGS_gpuStats && renderer->isUsingGpuDevice()) {
505 GrContext* ctx = renderer->getGrContext();
506 SkDebugf("RenderTarget Binds: %d\n", ctx->gpuStats()->renderTargetBinds( ));
507 SkDebugf("Shader Compilations: %d\n", ctx->gpuStats()->shaderCompilation s());
508 }
509 #endif
499 #endif 510 #endif
500 if (FLAGS_writeJsonSummaryPath.count() == 1) { 511 if (FLAGS_writeJsonSummaryPath.count() == 1) {
501 // If there were any descriptions on the command line, insert them now. 512 // If there were any descriptions on the command line, insert them now.
502 for (int i=0; i<FLAGS_descriptions.count(); i++) { 513 for (int i=0; i<FLAGS_descriptions.count(); i++) {
503 SkTArray<SkString> tokens; 514 SkTArray<SkString> tokens;
504 SkStrSplit(FLAGS_descriptions[i], "=", &tokens); 515 SkStrSplit(FLAGS_descriptions[i], "=", &tokens);
505 SkASSERT(tokens.count() == 2); 516 SkASSERT(tokens.count() == 2);
506 jsonSummary.addDescription(tokens[0].c_str(), tokens[1].c_str()); 517 jsonSummary.addDescription(tokens[0].c_str(), tokens[1].c_str());
507 } 518 }
508 if (FLAGS_imageBaseGSUrl.count() == 1) { 519 if (FLAGS_imageBaseGSUrl.count() == 1) {
509 jsonSummary.setImageBaseGSUrl(FLAGS_imageBaseGSUrl[0]); 520 jsonSummary.setImageBaseGSUrl(FLAGS_imageBaseGSUrl[0]);
510 } 521 }
511 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); 522 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]);
512 } 523 }
513 return 0; 524 return 0;
514 } 525 }
515 526
516 #if !defined SK_BUILD_FOR_IOS 527 #if !defined SK_BUILD_FOR_IOS
517 int main(int argc, char * const argv[]) { 528 int main(int argc, char * const argv[]) {
518 return tool_main(argc, (char**) argv); 529 return tool_main(argc, (char**) argv);
519 } 530 }
520 #endif 531 #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