From f2ade01f4c0c33e070d89b473b4c0037aed9e7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 10 Dec 2013 10:02:51 +0100 Subject: Cocoa: QImage -> CGImage conversion cleanup Move to one qt_mac_toCGImage function that has simple semantics and properly retains a copy of the QImage for the lifetime of the CGImage. Remove the old qt_mac_toCGImage function which had two problems: 1) It would not retain the QImage data (this was probably ok for its original use case: creating short-lived CGImages for the paint engine) 2) It had acquired a somewhat odd **datacopy out parameter for the cases where you _do_ want to retain the image data. This makes the exported image conversion function from QtMacExtras work: The CGImages it creates will no longer reference free'd memory once the QImage is deleted. Change-Id: I583040d16aefb17fc3d801d6b047a0b2a76c7f74 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qmacmime.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa/qmacmime.mm') diff --git a/src/plugins/platforms/cocoa/qmacmime.mm b/src/plugins/platforms/cocoa/qmacmime.mm index 89d1b5f681..4274e178f7 100644 --- a/src/plugins/platforms/cocoa/qmacmime.mm +++ b/src/plugins/platforms/cocoa/qmacmime.mm @@ -565,7 +565,7 @@ QList QMacPasteboardMimeTiff::convertFromMime(const QString &mime, Q return ret; QImage img = qvariant_cast(variant); - QCFType cgimage = qt_mac_image_to_cgimage(img); + QCFType cgimage = qt_mac_toCGImage(img); QCFType data = CFDataCreateMutable(0, 0); QCFType imageDestination = CGImageDestinationCreateWithData(data, kUTTypeTIFF, 1, 0); -- cgit v1.2.3