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

Side by Side Diff: bench/nanobench.cpp

Issue 787923002: Update nanobench so the non-MPD path doesn't permit layer hoisting (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « no previous file | 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 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 541 }
542 542
543 while (fCurrentUseMPD < fUseMPDs.count()) { 543 while (fCurrentUseMPD < fUseMPDs.count()) {
544 if (FLAGS_bbh) { 544 if (FLAGS_bbh) {
545 // The SKP we read off disk doesn't have a BBH. Re-reco rd so it grows one. 545 // The SKP we read off disk doesn't have a BBH. Re-reco rd so it grows one.
546 SkRTreeFactory factory; 546 SkRTreeFactory factory;
547 SkPictureRecorder recorder; 547 SkPictureRecorder recorder;
548 static const int kFlags = SkPictureRecorder::kComputeSav eLayerInfo_RecordFlag; 548 static const int kFlags = SkPictureRecorder::kComputeSav eLayerInfo_RecordFlag;
549 pic->playback(recorder.beginRecording(pic->cullRect().wi dth(), 549 pic->playback(recorder.beginRecording(pic->cullRect().wi dth(),
550 pic->cullRect().he ight(), 550 pic->cullRect().he ight(),
551 &factory, kFlags)) ; 551 &factory,
552 fUseMPDs[fCurrentU seMPD] ? kFlags : 0));
552 pic.reset(recorder.endRecording()); 553 pic.reset(recorder.endRecording());
553 } 554 }
554 SkString name = SkOSPath::Basename(path.c_str()); 555 SkString name = SkOSPath::Basename(path.c_str());
555 fSourceType = "skp"; 556 fSourceType = "skp";
556 fBenchType = "playback"; 557 fBenchType = "playback";
557 return SkNEW_ARGS(SKPBench, 558 return SkNEW_ARGS(SKPBench,
558 (name.c_str(), pic.get(), fClip, 559 (name.c_str(), pic.get(), fClip,
559 fScales[fCurrentScale], fUseMPDs[fCurrentUseMPD++]) ); 560 fScales[fCurrentScale], fUseMPDs[fCurrentUseMPD++]) );
560 } 561 }
561 fCurrentUseMPD = 0; 562 fCurrentUseMPD = 0;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 796
796 return 0; 797 return 0;
797 } 798 }
798 799
799 #if !defined SK_BUILD_FOR_IOS 800 #if !defined SK_BUILD_FOR_IOS
800 int main(int argc, char** argv) { 801 int main(int argc, char** argv) {
801 SkCommandLineFlags::Parse(argc, argv); 802 SkCommandLineFlags::Parse(argc, argv);
802 return nanobench_main(); 803 return nanobench_main();
803 } 804 }
804 #endif 805 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698