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" |
11 #include "CrashHandler.h" | 11 #include "CrashHandler.h" |
12 #include "GMBench.h" | 12 #include "GMBench.h" |
| 13 #include "LazyDecodeBitmap.h" |
13 #include "ProcStats.h" | 14 #include "ProcStats.h" |
14 #include "ResultsWriter.h" | 15 #include "ResultsWriter.h" |
15 #include "RecordingBench.h" | 16 #include "RecordingBench.h" |
16 #include "SKPBench.h" | 17 #include "SKPBench.h" |
17 #include "Stats.h" | 18 #include "Stats.h" |
18 #include "Timer.h" | 19 #include "Timer.h" |
19 | 20 |
20 #include "SkBBHFactory.h" | 21 #include "SkBBHFactory.h" |
21 #include "SkCanvas.h" | 22 #include "SkCanvas.h" |
22 #include "SkCommonFlags.h" | 23 #include "SkCommonFlags.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { | 444 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { |
444 return false; | 445 return false; |
445 } | 446 } |
446 | 447 |
447 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); | 448 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); |
448 if (stream.get() == NULL) { | 449 if (stream.get() == NULL) { |
449 SkDebugf("Could not read %s.\n", path); | 450 SkDebugf("Could not read %s.\n", path); |
450 return false; | 451 return false; |
451 } | 452 } |
452 | 453 |
453 pic->reset(SkPicture::CreateFromStream(stream.get())); | 454 pic->reset(SkPicture::CreateFromStream(stream.get(), sk_tools::LazyDecod
eBitmap)); |
454 if (pic->get() == NULL) { | 455 if (pic->get() == NULL) { |
455 SkDebugf("Could not read %s as an SkPicture.\n", path); | 456 SkDebugf("Could not read %s as an SkPicture.\n", path); |
456 return false; | 457 return false; |
457 } | 458 } |
458 return true; | 459 return true; |
459 } | 460 } |
460 | 461 |
461 Benchmark* next() { | 462 Benchmark* next() { |
462 if (fBenches) { | 463 if (fBenches) { |
463 Benchmark* bench = fBenches->factory()(NULL); | 464 Benchmark* bench = fBenches->factory()(NULL); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 | 714 |
714 return 0; | 715 return 0; |
715 } | 716 } |
716 | 717 |
717 #if !defined SK_BUILD_FOR_IOS | 718 #if !defined SK_BUILD_FOR_IOS |
718 int main(int argc, char** argv) { | 719 int main(int argc, char** argv) { |
719 SkCommandLineFlags::Parse(argc, argv); | 720 SkCommandLineFlags::Parse(argc, argv); |
720 return nanobench_main(); | 721 return nanobench_main(); |
721 } | 722 } |
722 #endif | 723 #endif |
OLD | NEW |