Start from scratch on a faster SkFlatDictionary.
This is like codereview.chromium.org/19276003, except it fits in better with the existing code, doesn't leak memory, and because it's back using SkChunkFlatController it's a little faster too, now a win across the board:
Slowdown bench
-1.59% desk_youtubetvbrowse.skp
-2.56% desk_googlehome.skp
-6.40% tabl_androidpolice.skp
-6.45% desk_youtubetvvideo.skp
-6.91% tabl_googlecalendar.skp
...
-29.70% desk_yahoogames.skp
-32.17% desk_googlespreadsheet.skp
-32.23% mobi_wikipedia.skp
-37.16% desk_chalkboard.skp
-41.57% desk_pokemonwiki.skp
Overall slowdown: -22.74%
running bench [640 480] picture_record_recurring_paint_dictionary NONRENDERING: cmsecs = 9.92
running bench [640 480] picture_record_unique_paint_dictionary NONRENDERING: cmsecs = 22.16
running bench [640 480] picture_record_dictionaries NONRENDERING: cmsecs = 9.18
BUG=
Committed: http://code.google.com/p/skia/source/detail?r=10328
R=tomhudson@google.com, reed@google.com, scroggo@google.com
Author: mtklein@google.com
Review URL: https://chromiumcodereview.appspot.com/19564007
git-svn-id: http://skia.googlecode.com/svn/trunk@10336 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index a2dff67..bf82831 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -39,6 +39,8 @@
"the picture rendered in simple mode. When used in conjunction with --bbh, results "
"are validated against the picture rendered in the same mode, but without the bbh.");
+DEFINE_bool(bench_record, false, "If true, drop into an infinite loop of recording the picture.");
+
static void make_output_filepath(SkString* path, const SkString& dir,
const SkString& name) {
sk_tools::make_filepath(path, dir, name);
@@ -163,6 +165,13 @@
return false;
}
+ while (FLAGS_bench_record) {
+ const int kRecordFlags = 0;
+ SkPicture other;
+ picture->draw(other.beginRecording(picture->width(), picture->height(), kRecordFlags));
+ other.endRecording();
+ }
+
for (int i = 0; i < FLAGS_clone; ++i) {
SkPicture* clone = picture->clone();
SkDELETE(picture);