diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 20:35:44 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 20:35:44 +0000 |
commit | 89d03e277a46afa96c83d3168b5b952a5970cf1a (patch) | |
tree | 7bcf2121999b03e2dbaa526fb9ff482000ea050f /ui/base | |
parent | d19ea34f835815a4768bb03a6863eb3dba3613c1 (diff) | |
download | chromium_src-89d03e277a46afa96c83d3168b5b952a5970cf1a.zip chromium_src-89d03e277a46afa96c83d3168b5b952a5970cf1a.tar.gz chromium_src-89d03e277a46afa96c83d3168b5b952a5970cf1a.tar.bz2 |
Revert high res icon changes
The new high res icon change may have caused a perf regression. To verify I'm reverting the following chnages:
commit 3a360c6b3d2fc174cb7597d6365cfc5418d1442b
r82326 Disable loading high res icons on Mac
commit 3c39226937a39d0042b8a794f13505c7a25ca58b
r82247 Fix reload button unit test
commit f87ab117fc159566868e71e4df5672852bebd718
r82245 Unregister toolbar view from window notifications
commit 0b287ba4a4ad5c19d901f973eb9af594dcf3dba1
r82239 Fix failing Mac unit tests
commit 8b681c46a139d12151323952c58122f6805d7597
r82236 Mac: Remove custom drawn buttons
commit 6ae8a2fe40485731b86267e362936db16b4c0706
r82209 Fix clang build break
commit e8a19d1e0c76f204c834318566e4206320583449
r82185 Add support for multi resolution icons
BUG=None
TEST=Compling
Review URL: http://codereview.chromium.org/6878077
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82352 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/resource/resource_bundle.cc | 12 | ||||
-rw-r--r-- | ui/base/resource/resource_bundle.h | 3 | ||||
-rw-r--r-- | ui/base/resource/resource_bundle_linux.cc | 6 | ||||
-rw-r--r-- | ui/base/resource/resource_bundle_mac.mm | 20 | ||||
-rw-r--r-- | ui/base/resource/resource_bundle_posix.cc | 8 |
5 files changed, 1 insertions, 48 deletions
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc index 306a61e..1b6fd11 100644 --- a/ui/base/resource/resource_bundle.cc +++ b/ui/base/resource/resource_bundle.cc @@ -119,11 +119,6 @@ gfx::Image& ResourceBundle::GetImageNamed(int resource_id) { scoped_ptr<SkBitmap> bitmap(LoadBitmap(resources_data_, resource_id)); if (bitmap.get()) { - // Check if there's a large version of the image as well. - scoped_ptr<SkBitmap> large_bitmap; - if (large_icon_resources_data_) - large_bitmap.reset(LoadBitmap(large_icon_resources_data_, resource_id)); - // The load was successful, so cache the image. base::AutoLock lock_scope(*lock_); @@ -131,11 +126,7 @@ gfx::Image& ResourceBundle::GetImageNamed(int resource_id) { if (images_.count(resource_id)) return *images_[resource_id]; - std::vector<const SkBitmap*> bitmaps; - bitmaps.push_back(bitmap.release()); - if (large_bitmap.get()) - bitmaps.push_back(large_bitmap.release()); - gfx::Image* image = new gfx::Image(bitmaps); + gfx::Image* image = new gfx::Image(bitmap.release()); images_[resource_id] = image; return *image; } @@ -199,7 +190,6 @@ void ResourceBundle::ReloadFonts() { ResourceBundle::ResourceBundle() : lock_(new base::Lock), resources_data_(NULL), - large_icon_resources_data_(NULL), locale_resources_data_(NULL) { } diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h index cdd9383..2598662 100644 --- a/ui/base/resource/resource_bundle.h +++ b/ui/base/resource/resource_bundle.h @@ -235,8 +235,6 @@ class ResourceBundle { // Returns the full pathname of the main resources file to load. May return // an empty string if no main resources data files are found. static FilePath GetResourcesFilePath(); - - static FilePath GetLargeIconResourcesFilePath(); #endif // Returns the full pathname of the locale file to load. May return an empty @@ -265,7 +263,6 @@ class ResourceBundle { // Handles for data sources. DataHandle resources_data_; - DataHandle large_icon_resources_data_; DataHandle locale_resources_data_; // References to extra data packs loaded via AddDataPackToSharedInstance. diff --git a/ui/base/resource/resource_bundle_linux.cc b/ui/base/resource/resource_bundle_linux.cc index 5806fb0..437f725 100644 --- a/ui/base/resource/resource_bundle_linux.cc +++ b/ui/base/resource/resource_bundle_linux.cc @@ -66,12 +66,6 @@ FilePath ResourceBundle::GetResourcesFilePath() { } // static -FilePath ResourceBundle::GetLargeIconResourcesFilePath() { - // Not supported. - return FilePath(); -} - -// static FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) { FilePath locale_file_path; PathService::Get(ui::DIR_LOCALES, &locale_file_path); diff --git a/ui/base/resource/resource_bundle_mac.mm b/ui/base/resource/resource_bundle_mac.mm index 886a377..1a238a7 100644 --- a/ui/base/resource/resource_bundle_mac.mm +++ b/ui/base/resource/resource_bundle_mac.mm @@ -46,11 +46,6 @@ FilePath ResourceBundle::GetResourcesFilePath() { } // static -FilePath ResourceBundle::GetLargeIconResourcesFilePath() { - return FilePath(); -} - -// static FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) { NSString* mac_locale = base::SysUTF8ToNSString(app_locale); @@ -94,21 +89,6 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) { // Cache the converted image. if (ns_image.get()) { - // Load a high resolution version of the icon if available. - if (large_icon_resources_data_) { - scoped_refptr<RefCountedStaticMemory> large_data( - LoadResourceBytes(large_icon_resources_data_, resource_id)); - if (large_data.get()) { - scoped_nsobject<NSData> ns_large_data( - [[NSData alloc] initWithBytes:large_data->front() - length:large_data->size()]); - NSImageRep* image_rep = - [NSBitmapImageRep imageRepWithData:ns_large_data]; - if (image_rep) - [ns_image addRepresentation:image_rep]; - } - } - base::AutoLock lock(*lock_); // Another thread raced the load and has already cached the image. diff --git a/ui/base/resource/resource_bundle_posix.cc b/ui/base/resource/resource_bundle_posix.cc index d2fe55b..97747e0 100644 --- a/ui/base/resource/resource_bundle_posix.cc +++ b/ui/base/resource/resource_bundle_posix.cc @@ -98,14 +98,6 @@ void ResourceBundle::LoadCommonResources() { CHECK(!resources_file_path.empty()) << "chrome.pak not found"; resources_data_ = LoadResourcesDataPak(resources_file_path); CHECK(resources_data_) << "failed to load chrome.pak"; - - FilePath large_icon_resources_file_path = GetLargeIconResourcesFilePath(); - if (!large_icon_resources_file_path.empty()) { - large_icon_resources_data_ = - LoadResourcesDataPak(large_icon_resources_file_path); - CHECK(large_icon_resources_data_) << - "failed to load theme_resources_large.pak"; - } } std::string ResourceBundle::LoadLocaleResources( |