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

Side by Side Diff: bench/nanobench.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. 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 | debugger/QT/SkDebuggerGUI.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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 469 }
470 } 470 }
471 471
472 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) { 472 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) {
473 // Not strictly necessary, as it will be checked again later, 473 // Not strictly necessary, as it will be checked again later,
474 // but helps to avoid a lot of pointless work if we're going to skip it. 474 // but helps to avoid a lot of pointless work if we're going to skip it.
475 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { 475 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) {
476 return false; 476 return false;
477 } 477 }
478 478
479 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); 479 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path));
480 if (stream.get() == NULL) { 480 if (stream.get() == NULL) {
481 SkDebugf("Could not read %s.\n", path); 481 SkDebugf("Could not read %s.\n", path);
482 return false; 482 return false;
483 } 483 }
484 484
485 pic->reset(SkPicture::CreateFromStream(stream.get())); 485 pic->reset(SkPicture::CreateFromStream(stream.get()));
486 if (pic->get() == NULL) { 486 if (pic->get() == NULL) {
487 SkDebugf("Could not read %s as an SkPicture.\n", path); 487 SkDebugf("Could not read %s as an SkPicture.\n", path);
488 return false; 488 return false;
489 } 489 }
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 790
791 return 0; 791 return 0;
792 } 792 }
793 793
794 #if !defined SK_BUILD_FOR_IOS 794 #if !defined SK_BUILD_FOR_IOS
795 int main(int argc, char** argv) { 795 int main(int argc, char** argv) {
796 SkCommandLineFlags::Parse(argc, argv); 796 SkCommandLineFlags::Parse(argc, argv);
797 return nanobench_main(); 797 return nanobench_main();
798 } 798 }
799 #endif 799 #endif
OLDNEW
« no previous file with comments | « no previous file | debugger/QT/SkDebuggerGUI.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698