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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |