aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecord.cpp
diff options
context:
space:
mode:
authorGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-20 16:48:47 +0000
committerGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-20 16:48:47 +0000
commit9e3074e968f52eb02fdc329bb9fbe7be5e674268 (patch)
tree2257a3fc594b3f281c974fc48bed4156551b46a2 /src/core/SkPictureRecord.cpp
parent85e9db0347fb64e26ca702340cd641c5dda328c4 (diff)
use SkTDynamicHash in picture recording
cleaned up SkPictureFlat.h quite a bit while working on this. bench --match picture_record_ shows some improvement: compare.sh bench --match picture_record_ --repeat 100 master -> usehash N=3 p=0.001000 (corrected to 0.000333) sig? rel. speed bench y 1.0x picture_record_dictionaries y 1.5x picture_record_recurring_paint_dictionary y 3.8x picture_record_unique_paint_dictionary Overall relative speed: 1.9x bench_pictures --record is pretty much neutral: compare.sh bench_pictures -r ../skp --mode record --repeat 30 master -> usehash N=63 p=0.001000 (corrected to 0.000016) sig? rel. speed bench n 0.9x desk_pokemonwiki.skp y 0.9x desk_googlespreadsheet.skp y 0.9x tabl_pravda.skp y 1.0x desk_googlespreadsheetdashed.skp n 1.0x tabl_onlinewsj.skp n 1.0x tabl_nytimes.skp n 1.0x desk_googlehome.skp y 1.0x desk_techcrunch.skp n 1.0x tabl_slashdot.skp n 1.0x tabl_techmeme.skp n 1.0x desk_googleplus.skp n 1.0x desk_sfgate.skp n 1.0x tabl_transformice.skp n 1.0x desk_espn.skp n 1.0x desk_baidu.skp n 1.0x tabl_worldjournal.skp n 1.0x desk_chalkboard.skp n 1.0x tabl_frantzen.skp n 1.0x desk_gws.skp n 1.0x tabl_androidpolice.skp n 1.0x desk_linkedin.skp n 1.0x mobi_wikipedia.skp n 1.0x desk_wowwiki.skp n 1.0x desk_css3gradients.skp n 1.0x desk_gmailthread.skp n 1.0x desk_yahoogames.skp n 1.0x desk_facebook.skp n 1.0x desk_wordpress.skp n 1.0x tabl_vnexpress.skp n 1.0x desk_br337.skp n 1.0x tabl_engadget.skp n 1.0x tabl_theverge.skp n 1.0x desk_amazon.skp n 1.0x desk_ebay.skp n 1.0x tabl_hsfi.skp n 1.0x tabl_sahadan.skp n 1.0x desk_weather.skp n 1.0x tabl_digg.skp n 1.0x desk_youtubetvbrowse.skp n 1.0x tabl_culturalsolutions.skp n 1.0x tabl_ukwsj.skp n 1.0x desk_youtube.skp n 1.0x tabl_googlecalendar.skp y 1.0x desk_yahooanswers.skp n 1.0x desk_blogger.skp n 1.0x desk_yahoonews.skp y 1.0x desk_yahoosports.skp y 1.0x tabl_mercurynews.skp n 1.0x desk_youtubetvvideo.skp y 1.0x tabl_gspro.skp y 1.1x tabl_googleblog.skp y 1.1x tabl_cnet.skp y 1.1x tabl_mlb.skp y 1.1x tabl_cuteoverload.skp y 1.1x desk_booking.skp y 1.1x tabl_deviantart.skp y 1.1x desk_twitter.skp y 1.1x tabl_cnn.skp y 1.1x tabl_gamedeksiam.skp y 1.1x tabl_gmail.skp y 1.1x tabl_nofolo.skp y 1.1x tabl_mozilla.skp y 1.1x desk_pinterest.skp Overall relative speed: 1.0x (I'd take this to mean that the microbenches are probably drifting away from relevance.) BUG= R=reed@google.com Review URL: https://codereview.chromium.org/21564008 git-svn-id: http://skia.googlecode.com/svn/trunk@10825 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPictureRecord.cpp')
-rw-r--r--src/core/SkPictureRecord.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 7a853816ae..0ec9eaf74d 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -401,16 +401,13 @@ static bool merge_savelayer_paint_into_drawbitmp(SkWriter32* writer,
SkColorGetA(saveLayerPaint->getColor()));
dbmPaint->setColor(newColor);
- const SkFlatData* data = paintDict->findAndReturnFlat(*dbmPaint);
- if (NULL == data) {
- return false;
- }
+ const int paintIndex = paintDict->find(*dbmPaint);
// kill the saveLayer and alter the DBMR2R's paint to be the modified one
convert_command_to_noop(writer, saveLayerInfo.fOffset);
uint32_t* ptr = writer->peek32(dbmInfo.fOffset+dbmPaintOffset);
SkASSERT(dbmPaintId == *ptr);
- *ptr = data->index();
+ *ptr = paintIndex;
return true;
}