| 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 if (!pic) { | 698 if (!pic) { |
| 699 fCurrentSKP++; | 699 fCurrentSKP++; |
| 700 continue; | 700 continue; |
| 701 } | 701 } |
| 702 | 702 |
| 703 while (fCurrentUseMPD < fUseMPDs.count()) { | 703 while (fCurrentUseMPD < fUseMPDs.count()) { |
| 704 if (FLAGS_bbh) { | 704 if (FLAGS_bbh) { |
| 705 // The SKP we read off disk doesn't have a BBH. Re-reco
rd so it grows one. | 705 // The SKP we read off disk doesn't have a BBH. Re-reco
rd so it grows one. |
| 706 SkRTreeFactory factory; | 706 SkRTreeFactory factory; |
| 707 SkPictureRecorder recorder; | 707 SkPictureRecorder recorder; |
| 708 static const int kFlags = SkPictureRecorder::kComputeSav
eLayerInfo_RecordFlag; | |
| 709 pic->playback(recorder.beginRecording(pic->cullRect().wi
dth(), | 708 pic->playback(recorder.beginRecording(pic->cullRect().wi
dth(), |
| 710 pic->cullRect().he
ight(), | 709 pic->cullRect().he
ight(), |
| 711 &factory, | 710 &factory, |
| 712 fUseMPDs[fCurrentU
seMPD] ? kFlags : 0)); | 711 0)); |
| 713 pic = recorder.finishRecordingAsPicture(); | 712 pic = recorder.finishRecordingAsPicture(); |
| 714 } | 713 } |
| 715 SkString name = SkOSPath::Basename(path.c_str()); | 714 SkString name = SkOSPath::Basename(path.c_str()); |
| 716 fSourceType = "skp"; | 715 fSourceType = "skp"; |
| 717 fBenchType = "playback"; | 716 fBenchType = "playback"; |
| 718 return new SKPBench(name.c_str(), pic.get(), fClip, fScales[
fCurrentScale], | 717 return new SKPBench(name.c_str(), pic.get(), fClip, fScales[
fCurrentScale], |
| 719 fUseMPDs[fCurrentUseMPD++], FLAGS_loopSK
P); | 718 fUseMPDs[fCurrentUseMPD++], FLAGS_loopSK
P); |
| 720 } | 719 } |
| 721 fCurrentUseMPD = 0; | 720 fCurrentUseMPD = 0; |
| 722 fCurrentSKP++; | 721 fCurrentSKP++; |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 | 1297 |
| 1299 return 0; | 1298 return 0; |
| 1300 } | 1299 } |
| 1301 | 1300 |
| 1302 #if !defined SK_BUILD_FOR_IOS | 1301 #if !defined SK_BUILD_FOR_IOS |
| 1303 int main(int argc, char** argv) { | 1302 int main(int argc, char** argv) { |
| 1304 SkCommandLineFlags::Parse(argc, argv); | 1303 SkCommandLineFlags::Parse(argc, argv); |
| 1305 return nanobench_main(); | 1304 return nanobench_main(); |
| 1306 } | 1305 } |
| 1307 #endif | 1306 #endif |
| OLD | NEW |