summaryrefslogtreecommitdiffstats
path: root/chrome/browser/themes
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-25 08:59:18 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-25 08:59:18 +0000
commit8fd6f348dd53f9cfdf84dfad1a46252a30bca0fb (patch)
treeb58b63783e0fc0ba0bf996dd3dd2048859073c36 /chrome/browser/themes
parent68764f11c914c41cfdc6d11ce0d66fe547077347 (diff)
downloadchromium_src-8fd6f348dd53f9cfdf84dfad1a46252a30bca0fb.zip
chromium_src-8fd6f348dd53f9cfdf84dfad1a46252a30bca0fb.tar.gz
chromium_src-8fd6f348dd53f9cfdf84dfad1a46252a30bca0fb.tar.bz2
Temporary change to test perf regression (full)
This change tests which part of this review: http://codereview.chromium.org/6897013/ is causing a performance regression. This change will be reverted later tonight. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/themes')
-rw-r--r--chrome/browser/themes/theme_service_mac.mm16
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/themes/theme_service_mac.mm b/chrome/browser/themes/theme_service_mac.mm
index 30d359e..73fd814 100644
--- a/chrome/browser/themes/theme_service_mac.mm
+++ b/chrome/browser/themes/theme_service_mac.mm
@@ -10,7 +10,9 @@
#include "chrome/browser/themes/browser_theme_pack.h"
#include "skia/ext/skia_utils_mac.h"
#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_utils.h"
+#include "ui/gfx/image.h"
NSString* const kBrowserThemeDidChangeNotification =
@"BrowserThemeDidChangeNotification";
@@ -44,8 +46,18 @@ NSImage* ThemeService::GetNSImageNamed(int id, bool allow_default) const {
// SkBitmap > native conversion?
// - For consistency with other platforms.
// - To get the generated tinted images.
- SkBitmap* bitmap = GetBitmapNamed(id);
- NSImage* nsimage = gfx::SkBitmapToNSImage(*bitmap);
+ NSImage* nsimage = nil;
+ if (theme_pack_.get()) {
+ SkBitmap* bitmap = theme_pack_->GetBitmapNamed(id);
+ if (bitmap)
+ nsimage = gfx::SkBitmapToNSImage(*bitmap);
+ }
+
+ // If the theme didn't override this image then load it from the resource
+ // bundle.
+ if (!nsimage) {
+ nsimage = rb_.GetNativeImageNamed(id);
+ }
// We loaded successfully. Cache the image.
if (nsimage) {