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

Side by Side Diff: bench/nanobench.cpp

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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 | dm/DM.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 "nanobench.h" 10 #include "nanobench.h"
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 640
641 Benchmark* next() { 641 Benchmark* next() {
642 SkAutoTDelete<Benchmark> bench; 642 SkAutoTDelete<Benchmark> bench;
643 do { 643 do {
644 bench.reset(this->rawNext()); 644 bench.reset(this->rawNext());
645 if (!bench) { 645 if (!bench) {
646 return nullptr; 646 return nullptr;
647 } 647 }
648 } while(SkCommandLineFlags::ShouldSkip(FLAGS_sourceType, fSourceType) || 648 } while(SkCommandLineFlags::ShouldSkip(FLAGS_sourceType, fSourceType) ||
649 SkCommandLineFlags::ShouldSkip(FLAGS_benchType, fBenchType)); 649 SkCommandLineFlags::ShouldSkip(FLAGS_benchType, fBenchType));
650 return bench.detach(); 650 return bench.release();
651 } 651 }
652 652
653 Benchmark* rawNext() { 653 Benchmark* rawNext() {
654 if (fBenches) { 654 if (fBenches) {
655 Benchmark* bench = fBenches->factory()(nullptr); 655 Benchmark* bench = fBenches->factory()(nullptr);
656 fBenches = fBenches->next(); 656 fBenches = fBenches->next();
657 fSourceType = "bench"; 657 fSourceType = "bench";
658 fBenchType = "micro"; 658 fBenchType = "micro";
659 return bench; 659 return bench;
660 } 660 }
661 661
662 while (fGMs) { 662 while (fGMs) {
663 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(nullptr)); 663 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(nullptr));
664 fGMs = fGMs->next(); 664 fGMs = fGMs->next();
665 if (gm->runAsBench()) { 665 if (gm->runAsBench()) {
666 fSourceType = "gm"; 666 fSourceType = "gm";
667 fBenchType = "micro"; 667 fBenchType = "micro";
668 return new GMBench(gm.detach()); 668 return new GMBench(gm.release());
669 } 669 }
670 } 670 }
671 671
672 // First add all .skps as RecordingBenches. 672 // First add all .skps as RecordingBenches.
673 while (fCurrentRecording < fSKPs.count()) { 673 while (fCurrentRecording < fSKPs.count()) {
674 const SkString& path = fSKPs[fCurrentRecording++]; 674 const SkString& path = fSKPs[fCurrentRecording++];
675 SkAutoTUnref<SkPicture> pic; 675 SkAutoTUnref<SkPicture> pic;
676 if (!ReadPicture(path.c_str(), &pic)) { 676 if (!ReadPicture(path.c_str(), &pic)) {
677 continue; 677 continue;
678 } 678 }
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 1286
1287 return 0; 1287 return 0;
1288 } 1288 }
1289 1289
1290 #if !defined SK_BUILD_FOR_IOS 1290 #if !defined SK_BUILD_FOR_IOS
1291 int main(int argc, char** argv) { 1291 int main(int argc, char** argv) {
1292 SkCommandLineFlags::Parse(argc, argv); 1292 SkCommandLineFlags::Parse(argc, argv);
1293 return nanobench_main(); 1293 return nanobench_main();
1294 } 1294 }
1295 #endif 1295 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698