diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 17:36:17 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 17:36:17 +0000 |
commit | 52d70a7c296f2eeef7343ed94375a7abad4a65dc (patch) | |
tree | 83f282358ee747ae897c440d781ade9d6a0730bc /chrome/browser/fav_icon_helper.cc | |
parent | 52bf465e9d660330d267d5b29c36fe3e9ce1d905 (diff) | |
download | chromium_src-52d70a7c296f2eeef7343ed94375a7abad4a65dc.zip chromium_src-52d70a7c296f2eeef7343ed94375a7abad4a65dc.tar.gz chromium_src-52d70a7c296f2eeef7343ed94375a7abad4a65dc.tar.bz2 |
Make PNGCodec::Decode(...) not make an intermediary copy of the decoded data;
instead have it write directly to the returned SkBitmap.
BUG=http://crbug.com/24493
TEST=Perf should get better. On the perf trybot, tab_complex_theme_cold got an average of ~40ms better.
Review URL: http://codereview.chromium.org/305001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/fav_icon_helper.cc')
-rw-r--r-- | chrome/browser/fav_icon_helper.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/fav_icon_helper.cc b/chrome/browser/fav_icon_helper.cc index f0d7d64..3563406 100644 --- a/chrome/browser/fav_icon_helper.cc +++ b/chrome/browser/fav_icon_helper.cc @@ -87,7 +87,7 @@ void FavIconHelper::FavIconDownloadFailed(int download_id) { void FavIconHelper::UpdateFavIcon(NavigationEntry* entry, const std::vector<unsigned char>& data) { SkBitmap image; - gfx::PNGCodec::Decode(&data, &image); + gfx::PNGCodec::Decode(&data.front(), data.size(), &image); UpdateFavIcon(entry, image); } @@ -187,12 +187,13 @@ void FavIconHelper::OnFavIconDataForInitialURL( // favicon or its expired. Continue on to DownloadFavIconOrAskHistory to // either download or check history again. DownloadFavIconOrAskHistory(entry); - } // else we haven't got the icon url. When we get it we'll ask the - // renderer to download the icon. + } + // else we haven't got the icon url. When we get it we'll ask the + // renderer to download the icon. } void FavIconHelper::DownloadFavIconOrAskHistory(NavigationEntry* entry) { - DCHECK(entry); // We should only get here if entry is valid. + DCHECK(entry); // We should only get here if entry is valid. if (fav_icon_expired_) { // We have the mapping, but the favicon is out of date. Download it now. ScheduleDownload(entry); |