summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 066b2d9cc1..1b3db9f63a 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -124,16 +124,7 @@ CGImageRef qt_mac_image_to_cgimage(const QImage &img)
NSImage *qt_mac_cgimage_to_nsimage(CGImageRef image)
{
- QCocoaAutoReleasePool pool;
- NSImage *newImage = 0;
- NSRect imageRect = NSMakeRect(0.0, 0.0, CGImageGetWidth(image), CGImageGetHeight(image));
- newImage = [[NSImage alloc] initWithSize:imageRect.size];
- [newImage lockFocus];
- {
- CGContextRef imageContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
- CGContextDrawImage(imageContext, *(CGRect*)&imageRect, image);
- }
- [newImage unlockFocus];
+ NSImage *newImage = [[NSImage alloc] initWithCGImage:image size:NSZeroSize];
return newImage;
}