| Index: ui/gfx/image/image_skia_util_mac.mm
|
| diff --git a/ui/gfx/image/image_skia_util_mac.mm b/ui/gfx/image/image_skia_util_mac.mm
|
| index 7fc9053ab1c6713a2c936d2edb53be1eeed43ddb..3b36325e40a4845e4783a6e6bc9d09f3e7bb471c 100644
|
| --- a/ui/gfx/image/image_skia_util_mac.mm
|
| +++ b/ui/gfx/image/image_skia_util_mac.mm
|
| @@ -102,4 +102,24 @@ NSImage* NSImageFromImageSkia(const gfx::ImageSkia& image_skia) {
|
| return [image.release() autorelease];
|
| }
|
|
|
| +NSImage* NSImageFromImageSkiaWithColorSpace(const gfx::ImageSkia& image_skia,
|
| + CGColorSpaceRef color_space) {
|
| + if (image_skia.empty())
|
| + return nil;
|
| +
|
| + scoped_nsobject<NSImage> image([[NSImage alloc] init]);
|
| +
|
| + const std::vector<gfx::ImageSkiaRep>& image_reps =
|
| + image_skia.GetRepresentations();
|
| + for (std::vector<gfx::ImageSkiaRep>::const_iterator it = image_reps.begin();
|
| + it != image_reps.end(); ++it) {
|
| + [image addRepresentation:
|
| + gfx::SkBitmapToNSBitmapImageRepWithColorSpace(it->sk_bitmap(),
|
| + color_space)];
|
| + }
|
| +
|
| + [image setSize:NSMakeSize(image_skia.width(), image_skia.height())];
|
| + return [image.release() autorelease];
|
| +}
|
| +
|
| } // namespace gfx
|
|
|