From ff36a1d07f23f2b7feddaba110d448073a96f83c Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Wed, 24 Jul 2013 20:37:30 +0000 Subject: 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 --- tests/Writer32Test.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/Writer32Test.cpp') diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp index 498be9cb81..e5b93634ac 100644 --- a/tests/Writer32Test.cpp +++ b/tests/Writer32Test.cpp @@ -187,18 +187,23 @@ static void Tests(skiatest::Reporter* reporter) { SkWriter32 writer(0); uint32_t storage[256]; writer.reset(storage, sizeof(storage)); + // These three writes are small enough to fit in storage. test1(reporter, &writer); + REPORTER_ASSERT(reporter, writer.wroteOnlyToStorage()); writer.reset(storage, sizeof(storage)); test2(reporter, &writer); + REPORTER_ASSERT(reporter, writer.wroteOnlyToStorage()); writer.reset(storage, sizeof(storage)); testWritePad(reporter, &writer); + REPORTER_ASSERT(reporter, writer.wroteOnlyToStorage()); - // try overflowing the storage-block + // Try overflowing the storage-block. uint32_t smallStorage[8]; writer.reset(smallStorage, sizeof(smallStorage)); test2(reporter, &writer); + REPORTER_ASSERT(reporter, !writer.wroteOnlyToStorage()); } // small storage -- cgit v1.2.3