aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-05-11 20:23:32 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-05-13 12:20:30 +0000
commita4dab4faf279845d3c9734260fa766ece81781b9 (patch)
treee37f9c4551ea62b8b831fded49c78229af78f3b5
parentd8def1aa919302ff775bd27248d46ef8eba19470 (diff)
Remove needless indirection via QPlatformNativeInterface
Task-number: QTBUG-83251 Change-Id: Id51c35d25ef7863d895ddac02b2906fd37e479d5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/macextras/qmacfunctions.mm14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/macextras/qmacfunctions.mm b/src/macextras/qmacfunctions.mm
index 9d0b75c..5250971 100644
--- a/src/macextras/qmacfunctions.mm
+++ b/src/macextras/qmacfunctions.mm
@@ -52,6 +52,8 @@
#import <CoreGraphics/CoreGraphics.h>
#endif
+#include <QtGui/private/qcoregraphics_p.h>
+
QT_BEGIN_NAMESPACE
/*!
@@ -81,17 +83,7 @@ namespace QtMac
*/
QPixmap fromCGImageRef(CGImageRef image)
{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- QPlatformNativeInterface::NativeResourceForIntegrationFunction function = resolvePlatformFunction("cgimagetoqimage");
- if (function) {
- typedef QImage (*CGImageToQImageFunction)(CGImageRef image);
- return QPixmap::fromImage(reinterpret_cast<CGImageToQImageFunction>(function)(image));
- }
-
- return QPixmap();
-#else
- return QPixmap::fromCGImageRef(image);
-#endif
+ return QPixmap::fromImage(qt_mac_toQImage(image));
}
} // namespace QtMac