Index: skia/ext/skia_utils_mac.mm |
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm |
index f52709be31b675de962661d1c59af046e34f8425..61d870d6e8711c4f39e52130920d707cefd30a81 100644 |
--- a/skia/ext/skia_utils_mac.mm |
+++ b/skia/ext/skia_utils_mac.mm |
@@ -167,12 +167,14 @@ SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque) { |
return bitmap; |
} |
-NSImage* SkBitmapToNSImage(const SkBitmap& skiaBitmap) { |
+NSImage* SkBitmapToNSImageWithColorSpace(const SkBitmap& skiaBitmap, |
+ CGColorSpaceRef colorSpace) { |
if (skiaBitmap.isNull()) |
return nil; |
// First convert SkBitmap to CGImageRef. |
- CGImageRef cgimage = SkCreateCGImageRef(skiaBitmap); |
+ CGImageRef cgimage = SkCreateCGImageRefWithColorspace( |
+ skiaBitmap, colorSpace); |
viettrungluu
2011/01/12 19:02:11
I believe you can format this more nicely.
|
// Now convert to NSImage. |
NSBitmapImageRep* bitmap = [[[NSBitmapImageRep alloc] |
@@ -184,6 +186,12 @@ NSImage* SkBitmapToNSImage(const SkBitmap& skiaBitmap) { |
return image; |
} |
+NSImage* SkBitmapToNSImage(const SkBitmap& skiaBitmap) { |
viettrungluu
2011/01/12 19:02:11
Do you put implementations in random order just to
|
+ base::mac::ScopedCFTypeRef<CGColorSpaceRef> colorSpace( |
+ CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB)); |
+ return SkBitmapToNSImageWithColorSpace(skiaBitmap, colorSpace.get()); |
+} |
+ |
SkBitmap AppplicationIconAtSize(int size) { |
NSImage* image = [NSImage imageNamed:@"NSApplicationIcon"]; |
return NSImageToSkBitmap(image, NSMakeSize(size, size), /* is_opaque=*/true); |