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

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: Treat SkFontMgr::createFromStream as taking ownership of the stream (is this correct?) 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 | dm/DM.cpp » ('j') | gm/gmmain.cpp » ('J')
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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } 475 }
476 } 476 }
477 477
478 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) { 478 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) {
479 // Not strictly necessary, as it will be checked again later, 479 // Not strictly necessary, as it will be checked again later,
480 // but helps to avoid a lot of pointless work if we're going to skip it. 480 // but helps to avoid a lot of pointless work if we're going to skip it.
481 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { 481 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) {
482 return false; 482 return false;
483 } 483 }
484 484
485 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); 485 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path));
486 if (stream.get() == NULL) { 486 if (stream.get() == NULL) {
487 SkDebugf("Could not read %s.\n", path); 487 SkDebugf("Could not read %s.\n", path);
488 return false; 488 return false;
489 } 489 }
490 490
491 pic->reset(SkPicture::CreateFromStream(stream.get())); 491 pic->reset(SkPicture::CreateFromStream(stream.get()));
492 if (pic->get() == NULL) { 492 if (pic->get() == NULL) {
493 SkDebugf("Could not read %s as an SkPicture.\n", path); 493 SkDebugf("Could not read %s as an SkPicture.\n", path);
494 return false; 494 return false;
495 } 495 }
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 796
797 return 0; 797 return 0;
798 } 798 }
799 799
800 #if !defined SK_BUILD_FOR_IOS 800 #if !defined SK_BUILD_FOR_IOS
801 int main(int argc, char** argv) { 801 int main(int argc, char** argv) {
802 SkCommandLineFlags::Parse(argc, argv); 802 SkCommandLineFlags::Parse(argc, argv);
803 return nanobench_main(); 803 return nanobench_main();
804 } 804 }
805 #endif 805 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | gm/gmmain.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698