Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3098)

Unified Diff: chrome/browser/ui/cocoa/tab_strip_controller.mm

Issue 6117006: Mac: Explicitly set the colorspace on SkBitmap -> CGImageRef conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabpose_window.mm » ('j') | skia/ext/skia_utils_mac.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tab_strip_controller.mm
index d9fb6fc5d4841477102ddc0c87f9cdaa9faead4a..3165dcc86ef9b6f2debf717c9df5fa9652366b11 100644
--- a/chrome/browser/ui/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_strip_controller.mm
@@ -12,6 +12,7 @@
#include "app/l10n_util.h"
#include "app/mac/nsimage_cache.h"
#include "app/resource_bundle.h"
+#include "base/mac/mac_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/autocomplete/autocomplete.h"
@@ -1209,12 +1210,16 @@ private:
- (NSImageView*)iconImageViewForContents:(TabContents*)contents {
BOOL isApp = contents->is_app();
NSImage* image = nil;
+ // Favicons come from the renderer, and the renderer draws everything in the
+ // system color space.
+ CGColorSpaceRef colorSpace = base::mac::GetSystemColorSpace();
if (isApp) {
SkBitmap* icon = contents->GetExtensionAppIcon();
if (icon)
- image = gfx::SkBitmapToNSImage(*icon);
+ image = gfx::SkBitmapToNSImageWithColorSpace(*icon, colorSpace);
} else {
- image = gfx::SkBitmapToNSImage(contents->GetFavIcon());
+ image = gfx::SkBitmapToNSImageWithColorSpace(contents->GetFavIcon(),
+ colorSpace);
}
// Either we don't have a valid favicon or there was some issue converting it
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabpose_window.mm » ('j') | skia/ext/skia_utils_mac.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698