OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "nanobench.h" | 10 #include "nanobench.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 DEFINE_string(outResultsFile, "", "If given, write results here as JSON."); | 104 DEFINE_string(outResultsFile, "", "If given, write results here as JSON."); |
105 DEFINE_int32(maxCalibrationAttempts, 3, | 105 DEFINE_int32(maxCalibrationAttempts, 3, |
106 "Try up to this many times to guess loops for a bench, or skip the
bench."); | 106 "Try up to this many times to guess loops for a bench, or skip the
bench."); |
107 DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this."); | 107 DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this."); |
108 DEFINE_string(clip, "0,0,1000,1000", "Clip for SKPs."); | 108 DEFINE_string(clip, "0,0,1000,1000", "Clip for SKPs."); |
109 DEFINE_string(scales, "1.0", "Space-separated scales for SKPs."); | 109 DEFINE_string(scales, "1.0", "Space-separated scales for SKPs."); |
110 DEFINE_string(zoom, "1.0,0", "Comma-separated zoomMax,zoomPeriodMs factors for a
periodic SKP zoom " | 110 DEFINE_string(zoom, "1.0,0", "Comma-separated zoomMax,zoomPeriodMs factors for a
periodic SKP zoom " |
111 "function that ping-pongs between 1.0 and zoomMax."
); | 111 "function that ping-pongs between 1.0 and zoomMax."
); |
112 DEFINE_bool(bbh, true, "Build a BBH for SKPs?"); | 112 DEFINE_bool(bbh, true, "Build a BBH for SKPs?"); |
| 113 DEFINE_bool(lite, false, "Use SkLiteRecorder in recording benchmarks?"); |
113 DEFINE_bool(mpd, true, "Use MultiPictureDraw for the SKPs?"); | 114 DEFINE_bool(mpd, true, "Use MultiPictureDraw for the SKPs?"); |
114 DEFINE_bool(loopSKP, true, "Loop SKPs like we do for micro benches?"); | 115 DEFINE_bool(loopSKP, true, "Loop SKPs like we do for micro benches?"); |
115 DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run."); | 116 DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run."); |
116 DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each test
."); | 117 DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each test
."); |
117 DEFINE_bool(gpuStats, false, "Print GPU stats after each gpu benchmark?"); | 118 DEFINE_bool(gpuStats, false, "Print GPU stats after each gpu benchmark?"); |
118 DEFINE_bool(gpuStatsDump, false, "Dump GPU states after each benchmark to json")
; | 119 DEFINE_bool(gpuStatsDump, false, "Dump GPU states after each benchmark to json")
; |
119 DEFINE_bool(keepAlive, false, "Print a message every so often so that we don't t
ime out"); | 120 DEFINE_bool(keepAlive, false, "Print a message every so often so that we don't t
ime out"); |
120 DEFINE_string(useThermalManager, "0,1,10,1000", "enabled,threshold,sleepTimeMs,T
imeoutMs for " | 121 DEFINE_string(useThermalManager, "0,1,10,1000", "enabled,threshold,sleepTimeMs,T
imeoutMs for " |
121 "thermalManager\n"); | 122 "thermalManager\n"); |
122 | 123 |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 const SkString& path = fSKPs[fCurrentRecording++]; | 685 const SkString& path = fSKPs[fCurrentRecording++]; |
685 sk_sp<SkPicture> pic = ReadPicture(path.c_str()); | 686 sk_sp<SkPicture> pic = ReadPicture(path.c_str()); |
686 if (!pic) { | 687 if (!pic) { |
687 continue; | 688 continue; |
688 } | 689 } |
689 SkString name = SkOSPath::Basename(path.c_str()); | 690 SkString name = SkOSPath::Basename(path.c_str()); |
690 fSourceType = "skp"; | 691 fSourceType = "skp"; |
691 fBenchType = "recording"; | 692 fBenchType = "recording"; |
692 fSKPBytes = static_cast<double>(SkPictureUtils::ApproximateBytesUsed
(pic.get())); | 693 fSKPBytes = static_cast<double>(SkPictureUtils::ApproximateBytesUsed
(pic.get())); |
693 fSKPOps = pic->approximateOpCount(); | 694 fSKPOps = pic->approximateOpCount(); |
694 return new RecordingBench(name.c_str(), pic.get(), FLAGS_bbh); | 695 return new RecordingBench(name.c_str(), pic.get(), FLAGS_bbh, FLAGS_
lite); |
695 } | 696 } |
696 | 697 |
697 // Then once each for each scale as SKPBenches (playback). | 698 // Then once each for each scale as SKPBenches (playback). |
698 while (fCurrentScale < fScales.count()) { | 699 while (fCurrentScale < fScales.count()) { |
699 while (fCurrentSKP < fSKPs.count()) { | 700 while (fCurrentSKP < fSKPs.count()) { |
700 const SkString& path = fSKPs[fCurrentSKP]; | 701 const SkString& path = fSKPs[fCurrentSKP]; |
701 sk_sp<SkPicture> pic = ReadPicture(path.c_str()); | 702 sk_sp<SkPicture> pic = ReadPicture(path.c_str()); |
702 if (!pic) { | 703 if (!pic) { |
703 fCurrentSKP++; | 704 fCurrentSKP++; |
704 continue; | 705 continue; |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 | 1303 |
1303 return 0; | 1304 return 0; |
1304 } | 1305 } |
1305 | 1306 |
1306 #if !defined SK_BUILD_FOR_IOS | 1307 #if !defined SK_BUILD_FOR_IOS |
1307 int main(int argc, char** argv) { | 1308 int main(int argc, char** argv) { |
1308 SkCommandLineFlags::Parse(argc, argv); | 1309 SkCommandLineFlags::Parse(argc, argv); |
1309 return nanobench_main(); | 1310 return nanobench_main(); |
1310 } | 1311 } |
1311 #endif | 1312 #endif |
OLD | NEW |