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

Side by Side Diff: bench/nanobench.cpp

Issue 743613005: nanobench: lazily decode bitmaps in .skps. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | gyp/bench.gyp » ('j') | gyp/bench.gyp » ('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"
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 "SkBBoxHierarchy.h" 21 #include "SkBBoxHierarchy.h"
21 #include "SkCanvas.h" 22 #include "SkCanvas.h"
22 #include "SkCommonFlags.h" 23 #include "SkCommonFlags.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { 481 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) {
481 return false; 482 return false;
482 } 483 }
483 484
484 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); 485 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path));
485 if (stream.get() == NULL) { 486 if (stream.get() == NULL) {
486 SkDebugf("Could not read %s.\n", path); 487 SkDebugf("Could not read %s.\n", path);
487 return false; 488 return false;
488 } 489 }
489 490
490 pic->reset(SkPicture::CreateFromStream(stream.get())); 491 pic->reset(SkPicture::CreateFromStream(stream.get(), &sk_tools::LazyDeco deBitmap));
scroggo 2014/11/25 20:31:13 Alternatively, we could optionally do lazy decodes
491 if (pic->get() == NULL) { 492 if (pic->get() == NULL) {
492 SkDebugf("Could not read %s as an SkPicture.\n", path); 493 SkDebugf("Could not read %s as an SkPicture.\n", path);
493 return false; 494 return false;
494 } 495 }
495 return true; 496 return true;
496 } 497 }
497 498
498 Benchmark* next() { 499 Benchmark* next() {
499 if (fBenches) { 500 if (fBenches) {
500 Benchmark* bench = fBenches->factory()(NULL); 501 Benchmark* bench = fBenches->factory()(NULL);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 788
788 return 0; 789 return 0;
789 } 790 }
790 791
791 #if !defined SK_BUILD_FOR_IOS 792 #if !defined SK_BUILD_FOR_IOS
792 int main(int argc, char** argv) { 793 int main(int argc, char** argv) {
793 SkCommandLineFlags::Parse(argc, argv); 794 SkCommandLineFlags::Parse(argc, argv);
794 return nanobench_main(); 795 return nanobench_main();
795 } 796 }
796 #endif 797 #endif
OLDNEW
« no previous file with comments | « no previous file | gyp/bench.gyp » ('j') | gyp/bench.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698