OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |