diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 21:46:47 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 21:46:47 +0000 |
commit | cfd0b58808dcf60b03a2fa434b655f850087c5f4 (patch) | |
tree | 026ad375656d31efedf609a3877af2eb7a8bbd57 /chrome/browser/cocoa/browser_frame_view.mm | |
parent | c2def1c60e5809cf6f6171f980c56f2e4b48109e (diff) | |
download | chromium_src-cfd0b58808dcf60b03a2fa434b655f850087c5f4.zip chromium_src-cfd0b58808dcf60b03a2fa434b655f850087c5f4.tar.gz chromium_src-cfd0b58808dcf60b03a2fa434b655f850087c5f4.tar.bz2 |
Aggressively cache theme image pattern colors.
BUG=http://crbug.com/37106 (I hope)
TEST=no visible change, just faster
Review URL: http://codereview.chromium.org/661396
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_frame_view.mm')
-rw-r--r-- | chrome/browser/cocoa/browser_frame_view.mm | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/browser_frame_view.mm b/chrome/browser/cocoa/browser_frame_view.mm index 38c3501..1a445d3 100644 --- a/chrome/browser/cocoa/browser_frame_view.mm +++ b/chrome/browser/cocoa/browser_frame_view.mm @@ -137,7 +137,7 @@ BOOL incognito = [[view window] themeIsIncognito]; // Find a theme image. - NSImage* themeImage = nil; + NSColor* themeImageColor = nil; int themeImageID; if (active && incognito) themeImageID = IDR_THEME_FRAME_INCOGNITO; @@ -148,19 +148,17 @@ else themeImageID = IDR_THEME_FRAME_INACTIVE; if (themeProvider->HasCustomImage(IDR_THEME_FRAME)) - themeImage = themeProvider->GetNSImageNamed(themeImageID, true); + themeImageColor = themeProvider->GetNSImageColorNamed(themeImageID, true); // If no theme image, use a gradient if incognito. NSGradient* gradient = nil; - if (!themeImage && incognito) + if (!themeImageColor && incognito) gradient = themeProvider->GetNSGradient( active ? BrowserThemeProvider::GRADIENT_FRAME_INCOGNITO : BrowserThemeProvider::GRADIENT_FRAME_INCOGNITO_INACTIVE); BOOL themed = NO; - if (themeImage) { - NSColor* themeImageColor = [NSColor colorWithPatternImage:themeImage]; - + if (themeImageColor) { // The titlebar/tabstrip header on the mac is slightly smaller than on // Windows. To keep the window background lined up with the tab and toolbar // patterns, we have to shift the pattern slightly, rather than simply |