summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-08 21:12:32 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-08 21:12:32 +0000
commit3e9d30eea530bb866325f2c94ebcc353e1c5ed39 (patch)
treea5b78e83a704a8fc7ee9571e9109723220d9be54
parentf0e6b93b7d7c615a9b19cf79283b49dd3303b87e (diff)
downloadchromium_src-3e9d30eea530bb866325f2c94ebcc353e1c5ed39.zip
chromium_src-3e9d30eea530bb866325f2c94ebcc353e1c5ed39.tar.gz
chromium_src-3e9d30eea530bb866325f2c94ebcc353e1c5ed39.tar.bz2
mac: Let task manager use IDR_PRODUCT_LOGO_16 instead of NSApplicationIcon.
According to `purge; sample -wait Chromium` and launching out/Release/Chromium.app/Contents/MacOS with 30 wikipedia tabs, this reduces time spent creating the TaskManagerModel (which happens on the IO thread, in response to raw bytes arriving from the network) from ~100 samples to ~1 sample. The icon looks slightly different from the icon that Activity Monitor displays, but a) it looks arguably nicer now (sharp) and b) most people never open the task manager. BUG=none NOTRY=true Review URL: https://codereview.chromium.org/190533009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255797 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/task_manager/browser_process_resource_provider.cc10
-rw-r--r--ui/gfx/image/image_skia_util_mac.h4
-rw-r--r--ui/gfx/image/image_skia_util_mac.mm6
3 files changed, 1 insertions, 19 deletions
diff --git a/chrome/browser/task_manager/browser_process_resource_provider.cc b/chrome/browser/task_manager/browser_process_resource_provider.cc
index 3cc7bce..a4bfa4e 100644
--- a/chrome/browser/task_manager/browser_process_resource_provider.cc
+++ b/chrome/browser/task_manager/browser_process_resource_provider.cc
@@ -43,19 +43,11 @@ BrowserProcessResource::BrowserProcessResource()
default_icon_ = new gfx::ImageSkia(gfx::ImageSkiaRep(*bitmap, 1.0f));
}
}
-#elif defined(OS_POSIX) && !defined(OS_MACOSX)
+#elif defined(OS_POSIX)
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
default_icon_ = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16);
}
-#elif defined(OS_MACOSX)
- if (!default_icon_) {
- // IDR_PRODUCT_LOGO_16 doesn't quite look like chrome/mac's icns icon. Load
- // the real app icon (requires a nsimage->image_skia->nsimage
- // conversion :-().
- default_icon_ = new gfx::ImageSkia(gfx::ApplicationIconAtSize(16));
- }
-#else
// TODO(port): Port icon code.
NOTIMPLEMENTED();
#endif // defined(OS_WIN)
diff --git a/ui/gfx/image/image_skia_util_mac.h b/ui/gfx/image/image_skia_util_mac.h
index 553c3f8..fc6a65f 100644
--- a/ui/gfx/image/image_skia_util_mac.h
+++ b/ui/gfx/image/image_skia_util_mac.h
@@ -31,10 +31,6 @@ GFX_EXPORT gfx::ImageSkia ImageSkiaFromNSImage(NSImage* image);
GFX_EXPORT gfx::ImageSkia ImageSkiaFromResizedNSImage(NSImage* image,
NSSize size);
-// Resizes |[NSImage imageNamed:@NSApplicationIcon]| to have edge width of
-// |size| DIP and returns result as ImageSkia.
-GFX_EXPORT gfx::ImageSkia ApplicationIconAtSize(int size);
-
// Converts to NSImage from ImageSkia.
GFX_EXPORT NSImage* NSImageFromImageSkia(const gfx::ImageSkia& image_skia);
diff --git a/ui/gfx/image/image_skia_util_mac.mm b/ui/gfx/image/image_skia_util_mac.mm
index 281badc..26c0673 100644
--- a/ui/gfx/image/image_skia_util_mac.mm
+++ b/ui/gfx/image/image_skia_util_mac.mm
@@ -78,12 +78,6 @@ gfx::ImageSkia ImageSkiaFromResizedNSImage(NSImage* image,
return image_skia;
}
-gfx::ImageSkia ApplicationIconAtSize(int desired_size) {
- NSImage* image = [NSImage imageNamed:@"NSApplicationIcon"];
- return ImageSkiaFromResizedNSImage(image,
- NSMakeSize(desired_size, desired_size));
-}
-
NSImage* NSImageFromImageSkia(const gfx::ImageSkia& image_skia) {
if (image_skia.isNull())
return nil;