diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-28 16:08:18 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-28 16:08:18 +0000 |
commit | 16182f74c66a92a65ff48ab8ec0448edc9e9fc1b (patch) | |
tree | f618d21d701c894b55097dfcfd8166ac554c7f19 | |
parent | 28361fad1054d59ed4e6a320c7a8b8782a1487c7 (diff) |
Lazy image decoding to reduce bench_record overhead.
We want bench_record to time recording only, and are willing to accept
some time spent playing back the source pictures only out of necessity.
This lets us skip the JPEG and PNG decoding, which are a pretty fair
chunk of time. Should mean better record numbers at the same --loops.
BUG=skia:
R=tomhudson@chromium.org, halcanary@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/212563009
git-svn-id: http://skia.googlecode.com/svn/trunk@13977 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gyp/tools.gyp | 11 | ||||
-rw-r--r-- | tools/bench_record.cpp | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gyp/tools.gyp b/gyp/tools.gyp index 7fa7f7244f..fe84a97813 100644 --- a/gyp/tools.gyp +++ b/gyp/tools.gyp @@ -292,8 +292,15 @@ { 'target_name': 'bench_record', 'type': 'executable', - 'sources': ['../tools/bench_record.cpp'], - 'include_dirs': [ '../src/core/' ], + 'sources': [ + '../tools/bench_record.cpp', + '../tools/LazyDecodeBitmap.cpp', + ], + 'include_dirs': [ + '../src/core/', + '../src/images', + '../src/lazy', + ], 'dependencies': [ 'flags.gyp:flags', 'skia_lib.gyp:skia_lib', diff --git a/tools/bench_record.cpp b/tools/bench_record.cpp index a2c354729e..cc8cc0e39d 100644 --- a/tools/bench_record.cpp +++ b/tools/bench_record.cpp @@ -15,6 +15,7 @@ #include "SkString.h" #include "SkTileGridPicture.h" #include "SkTime.h" +#include "LazyDecodeBitmap.h" __SK_FORCE_IMAGE_DECODER_LINKING; @@ -116,7 +117,8 @@ int tool_main(int argc, char** argv) { failed = true; continue; } - SkAutoTUnref<SkPicture> src(SkPicture::CreateFromStream(stream)); + SkAutoTUnref<SkPicture> src( + SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap)); if (!src) { SkDebugf("Could not read %s as an SkPicture.\n", path.c_str()); failed = true; |