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
This commit is contained in:
parent
28361fad10
commit
16182f74c6
@ -292,8 +292,15 @@
|
|||||||
{
|
{
|
||||||
'target_name': 'bench_record',
|
'target_name': 'bench_record',
|
||||||
'type': 'executable',
|
'type': 'executable',
|
||||||
'sources': ['../tools/bench_record.cpp'],
|
'sources': [
|
||||||
'include_dirs': [ '../src/core/' ],
|
'../tools/bench_record.cpp',
|
||||||
|
'../tools/LazyDecodeBitmap.cpp',
|
||||||
|
],
|
||||||
|
'include_dirs': [
|
||||||
|
'../src/core/',
|
||||||
|
'../src/images',
|
||||||
|
'../src/lazy',
|
||||||
|
],
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'flags.gyp:flags',
|
'flags.gyp:flags',
|
||||||
'skia_lib.gyp:skia_lib',
|
'skia_lib.gyp:skia_lib',
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "SkString.h"
|
#include "SkString.h"
|
||||||
#include "SkTileGridPicture.h"
|
#include "SkTileGridPicture.h"
|
||||||
#include "SkTime.h"
|
#include "SkTime.h"
|
||||||
|
#include "LazyDecodeBitmap.h"
|
||||||
|
|
||||||
__SK_FORCE_IMAGE_DECODER_LINKING;
|
__SK_FORCE_IMAGE_DECODER_LINKING;
|
||||||
|
|
||||||
@ -116,7 +117,8 @@ int tool_main(int argc, char** argv) {
|
|||||||
failed = true;
|
failed = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SkAutoTUnref<SkPicture> src(SkPicture::CreateFromStream(stream));
|
SkAutoTUnref<SkPicture> src(
|
||||||
|
SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap));
|
||||||
if (!src) {
|
if (!src) {
|
||||||
SkDebugf("Could not read %s as an SkPicture.\n", path.c_str());
|
SkDebugf("Could not read %s as an SkPicture.\n", path.c_str());
|
||||||
failed = true;
|
failed = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user