diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-01 16:24:06 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-01 16:24:06 +0000 |
commit | e3ff558a4baf4cb924e7513a81c8073ddae385fc (patch) | |
tree | 245339b6d7d39e36212bbbe6b975fcfd802f0ff5 /tools | |
parent | d48ad8e33307ad651264a3c3068b4468201fccf6 (diff) |
SkRecord strawman
Record performance as measured by bench_record (out/Release/bench_record --skr) improves by at least 1.9x, at most 6.7x, arithmetic mean 2.6x, geometric mean 3.0x. So, good.
Correctness as measured by DM (out/Debug/dm --skr) is ~ok. One GM (shadertext2) fails because we're assuming all paint effects are immutable, but SkShaders are still mutable.
To do after this CL:
- measure playback speed
- catch up feature-wise to SkPicture
- match today's playback speed
BUG=skia:
R=robertphillips@google.com, bsalomon@google.com, reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/206313003
git-svn-id: http://skia.googlecode.com/svn/trunk@14010 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bench_record.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/tools/bench_record.cpp b/tools/bench_record.cpp index cc8cc0e39d..db0ea9b71f 100644 --- a/tools/bench_record.cpp +++ b/tools/bench_record.cpp @@ -11,6 +11,7 @@ #include "SkOSFile.h" #include "SkPicture.h" #include "SkQuadTreePicture.h" +#include "SkRecorder.h" #include "SkStream.h" #include "SkString.h" #include "SkTileGridPicture.h" @@ -30,6 +31,7 @@ DEFINE_bool(endRecording, true, "If false, don't time SkPicture::endRecording()" DEFINE_int32(nullSize, 1000, "Pretend dimension of null source picture."); DEFINE_int32(tileGridSize, 512, "Set the tile grid size. Has no effect if bbh is not set to tilegrid."); DEFINE_string(bbh, "", "Turn on the bbh and select the type, one of rtree, tilegrid, quadtree"); +DEFINE_bool(skr, false, "Record SKR instead of SKP."); typedef SkPicture* (*PictureFactory)(const int width, const int height, int* recordingFlags); @@ -75,14 +77,22 @@ static void bench_record(SkPicture* src, const char* name, PictureFactory pictur const int height = src ? src->height() : FLAGS_nullSize; for (int i = 0; i < FLAGS_loops; i++) { - int recordingFlags = FLAGS_flags; - SkAutoTUnref<SkPicture> dst(pictureFactory(width, height, &recordingFlags)); - SkCanvas* canvas = dst->beginRecording(width, height, recordingFlags); - if (NULL != src) { - src->draw(canvas); - } - if (FLAGS_endRecording) { - dst->endRecording(); + if (FLAGS_skr) { + SkRecord record; + SkRecorder canvas(&record, width, height); + if (NULL != src) { + src->draw(&canvas); + } + } else { + int recordingFlags = FLAGS_flags; + SkAutoTUnref<SkPicture> dst(pictureFactory(width, height, &recordingFlags)); + SkCanvas* canvas = dst->beginRecording(width, height, recordingFlags); + if (NULL != src) { + src->draw(canvas); + } + if (FLAGS_endRecording) { + dst->endRecording(); + } } } |