summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/skia_utils_mac.mm10
1 files changed, 2 insertions, 8 deletions
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm
index e95635b..c0db013 100644
--- a/skia/ext/skia_utils_mac.mm
+++ b/skia/ext/skia_utils_mac.mm
@@ -235,15 +235,9 @@ NSImage* SkBitmapToNSImageWithColorSpace(const SkBitmap& skiaBitmap,
if (skiaBitmap.isNull())
return nil;
- // First convert SkBitmap to CGImageRef.
- base::mac::ScopedCFTypeRef<CGImageRef> cgimage(
- SkCreateCGImageRefWithColorspace(skiaBitmap, colorSpace));
-
- // Now convert to NSImage.
- scoped_nsobject<NSBitmapImageRep> bitmap(
- [[NSBitmapImageRep alloc] initWithCGImage:cgimage]);
scoped_nsobject<NSImage> image([[NSImage alloc] init]);
- [image addRepresentation:bitmap];
+ [image addRepresentation:
+ SkBitmapToNSBitmapImageRepWithColorSpace(skiaBitmap, colorSpace)];
[image setSize:NSMakeSize(skiaBitmap.width(), skiaBitmap.height())];
return [image.release() autorelease];
}