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

Side by Side Diff: bench/nanobench.cpp

Issue 2343933002: Revert of SkFontData to use smart pointers. (Closed)
Patch Set: Created 4 years, 3 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/DMSrcSink.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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 } 638 }
639 } 639 }
640 640
641 static sk_sp<SkPicture> ReadPicture(const char* path) { 641 static sk_sp<SkPicture> ReadPicture(const char* path) {
642 // Not strictly necessary, as it will be checked again later, 642 // Not strictly necessary, as it will be checked again later,
643 // but helps to avoid a lot of pointless work if we're going to skip it. 643 // but helps to avoid a lot of pointless work if we're going to skip it.
644 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, SkOSPath::Basename(path) .c_str())) { 644 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, SkOSPath::Basename(path) .c_str())) {
645 return nullptr; 645 return nullptr;
646 } 646 }
647 647
648 std::unique_ptr<SkStream> stream = SkStream::MakeFromFile(path); 648 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path));
649 if (!stream) { 649 if (stream.get() == nullptr) {
650 SkDebugf("Could not read %s.\n", path); 650 SkDebugf("Could not read %s.\n", path);
651 return nullptr; 651 return nullptr;
652 } 652 }
653 653
654 return SkPicture::MakeFromStream(stream.get()); 654 return SkPicture::MakeFromStream(stream.get());
655 } 655 }
656 656
657 static sk_sp<SkPicture> ReadSVGPicture(const char* path) { 657 static sk_sp<SkPicture> ReadSVGPicture(const char* path) {
658 SkFILEStream stream(path); 658 SkFILEStream stream(path);
659 if (!stream.isValid()) { 659 if (!stream.isValid()) {
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 1347
1348 return 0; 1348 return 0;
1349 } 1349 }
1350 1350
1351 #if !defined SK_BUILD_FOR_IOS 1351 #if !defined SK_BUILD_FOR_IOS
1352 int main(int argc, char** argv) { 1352 int main(int argc, char** argv) {
1353 SkCommandLineFlags::Parse(argc, argv); 1353 SkCommandLineFlags::Parse(argc, argv);
1354 return nanobench_main(); 1354 return nanobench_main();
1355 } 1355 }
1356 #endif 1356 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698