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 "Benchmark.h" | 10 #include "Benchmark.h" |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 // First add all .skps as RecordingBenches. | 518 // First add all .skps as RecordingBenches. |
519 while (fCurrentRecording < fSKPs.count()) { | 519 while (fCurrentRecording < fSKPs.count()) { |
520 const SkString& path = fSKPs[fCurrentRecording++]; | 520 const SkString& path = fSKPs[fCurrentRecording++]; |
521 SkAutoTUnref<SkPicture> pic; | 521 SkAutoTUnref<SkPicture> pic; |
522 if (!ReadPicture(path.c_str(), &pic)) { | 522 if (!ReadPicture(path.c_str(), &pic)) { |
523 continue; | 523 continue; |
524 } | 524 } |
525 SkString name = SkOSPath::Basename(path.c_str()); | 525 SkString name = SkOSPath::Basename(path.c_str()); |
526 fSourceType = "skp"; | 526 fSourceType = "skp"; |
527 fBenchType = "recording"; | 527 fBenchType = "recording"; |
528 fSKPBytes = SkPictureUtils::ApproximateBytesUsed(pic); | 528 fSKPBytes = static_cast<double>(SkPictureUtils::ApproximateBytesUsed
(pic)); |
529 fSKPOps = pic->approximateOpCount(); | 529 fSKPOps = pic->approximateOpCount(); |
530 return SkNEW_ARGS(RecordingBench, (name.c_str(), pic.get(), FLAGS_bb
h)); | 530 return SkNEW_ARGS(RecordingBench, (name.c_str(), pic.get(), FLAGS_bb
h)); |
531 } | 531 } |
532 | 532 |
533 // Then once each for each scale as SKPBenches (playback). | 533 // Then once each for each scale as SKPBenches (playback). |
534 while (fCurrentScale < fScales.count()) { | 534 while (fCurrentScale < fScales.count()) { |
535 while (fCurrentSKP < fSKPs.count()) { | 535 while (fCurrentSKP < fSKPs.count()) { |
536 const SkString& path = fSKPs[fCurrentSKP]; | 536 const SkString& path = fSKPs[fCurrentSKP]; |
537 SkAutoTUnref<SkPicture> pic; | 537 SkAutoTUnref<SkPicture> pic; |
538 if (!ReadPicture(path.c_str(), &pic)) { | 538 if (!ReadPicture(path.c_str(), &pic)) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 796 |
797 return 0; | 797 return 0; |
798 } | 798 } |
799 | 799 |
800 #if !defined SK_BUILD_FOR_IOS | 800 #if !defined SK_BUILD_FOR_IOS |
801 int main(int argc, char** argv) { | 801 int main(int argc, char** argv) { |
802 SkCommandLineFlags::Parse(argc, argv); | 802 SkCommandLineFlags::Parse(argc, argv); |
803 return nanobench_main(); | 803 return nanobench_main(); |
804 } | 804 } |
805 #endif | 805 #endif |
OLD | NEW |