summaryrefslogtreecommitdiffstats
path: root/base/mac
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 01:55:26 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 01:55:26 +0000
commitbf42472a2de6f6272141111aaf7ec76c1072bec3 (patch)
tree8321b8ac219f2e995bae2ec8f5941c3e2f71d49c /base/mac
parente1848157f1024d4c01f1dcbb009dcbc3913f230d (diff)
downloadchromium_src-bf42472a2de6f6272141111aaf7ec76c1072bec3.zip
chromium_src-bf42472a2de6f6272141111aaf7ec76c1072bec3.tar.gz
chromium_src-bf42472a2de6f6272141111aaf7ec76c1072bec3.tar.bz2
This CL fixes two bugs:
1) Makes the favicons (tab, bookmarks) look the same in the browser UI as they do in the renderer). This fixes a regression (probably by one of my CLs) since https://codereview.chromium.org/6117006 2) Make the favicons in the tab strip look the same after refreshing. The difference is due to the conversions PNG -> NSImage and PNG -> SkBitmap -> NSImage producing visually different NSImages. In particular, the result is different when the input PNG data has no colorspace information specified. Cocoa defaults to the device colorspace when decoding PNG data with no colorspace information. The generic RGB colorspace is used for converting from SkBitmap to NSImage. BUG=242877 TEST=Manual, see bug Review URL: https://chromiumcodereview.appspot.com/16370006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac')
-rw-r--r--base/mac/mac_util.h4
-rw-r--r--base/mac/mac_util.mm9
2 files changed, 13 insertions, 0 deletions
diff --git a/base/mac/mac_util.h b/base/mac/mac_util.h
index 2190b24..23b57ed 100644
--- a/base/mac/mac_util.h
+++ b/base/mac/mac_util.h
@@ -47,6 +47,10 @@ BASE_EXPORT bool FSRefFromPath(const std::string& path, FSRef* ref);
// release it!
BASE_EXPORT CGColorSpaceRef GetSRGBColorSpace();
+// Returns the generic RGB color space. The return value is a static value; do
+// not release it!
+BASE_EXPORT CGColorSpaceRef GetGenericRGBColorSpace();
+
// Returns the color space being used by the main display. The return value
// is a static value; do not release it!
BASE_EXPORT CGColorSpaceRef GetSystemColorSpace();
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 32dc735..e924f90 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -144,6 +144,15 @@ bool FSRefFromPath(const std::string& path, FSRef* ref) {
return status == noErr;
}
+CGColorSpaceRef GetGenericRGBColorSpace() {
+ // Leaked. That's OK, it's scoped to the lifetime of the application.
+ static CGColorSpaceRef g_color_space_generic_rgb(
+ CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB));
+ DLOG_IF(ERROR, !g_color_space_generic_rgb) <<
+ "Couldn't get the generic RGB color space";
+ return g_color_space_generic_rgb;
+}
+
CGColorSpaceRef GetSRGBColorSpace() {
// Leaked. That's OK, it's scoped to the lifetime of the application.
static CGColorSpaceRef g_color_space_sRGB =