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

Side by Side Diff: bench/nanobench.cpp

Issue 873753002: Spin off GM::runAsBench() from flags. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | gm/circularclips.cpp » ('j') | 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 Benchmark* bench = fBenches->factory()(NULL); 496 Benchmark* bench = fBenches->factory()(NULL);
497 fBenches = fBenches->next(); 497 fBenches = fBenches->next();
498 fSourceType = "bench"; 498 fSourceType = "bench";
499 fBenchType = "micro"; 499 fBenchType = "micro";
500 return bench; 500 return bench;
501 } 501 }
502 502
503 while (fGMs) { 503 while (fGMs) {
504 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL)); 504 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL));
505 fGMs = fGMs->next(); 505 fGMs = fGMs->next();
506 if (gm->getFlags() & skiagm::GM::kAsBench_Flag) { 506 if (gm->runAsBench()) {
507 fSourceType = "gm"; 507 fSourceType = "gm";
508 fBenchType = "micro"; 508 fBenchType = "micro";
509 return SkNEW_ARGS(GMBench, (gm.detach())); 509 return SkNEW_ARGS(GMBench, (gm.detach()));
510 } 510 }
511 } 511 }
512 512
513 // First add all .skps as RecordingBenches. 513 // First add all .skps as RecordingBenches.
514 while (fCurrentRecording < fSKPs.count()) { 514 while (fCurrentRecording < fSKPs.count()) {
515 const SkString& path = fSKPs[fCurrentRecording++]; 515 const SkString& path = fSKPs[fCurrentRecording++];
516 SkAutoTUnref<SkPicture> pic; 516 SkAutoTUnref<SkPicture> pic;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 791
792 return 0; 792 return 0;
793 } 793 }
794 794
795 #if !defined SK_BUILD_FOR_IOS 795 #if !defined SK_BUILD_FOR_IOS
796 int main(int argc, char** argv) { 796 int main(int argc, char** argv) {
797 SkCommandLineFlags::Parse(argc, argv); 797 SkCommandLineFlags::Parse(argc, argv);
798 return nanobench_main(); 798 return nanobench_main();
799 } 799 }
800 #endif 800 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/circularclips.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698