macOS: Respect Qt::AA_UseSoftwareOpenGL

Change-Id: Ia83e8e9e571e4f46d2a8d810c376015552755457
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Tor Arne Vestbø 2019-10-23 13:15:07 +02:00
parent f39230fcac
commit 312793f28e

View File

@ -223,6 +223,12 @@ NSOpenGLPixelFormat *QCocoaGLContext::pixelFormatForSurfaceFormat(const QSurface
attrs << NSOpenGLPFAAllowOfflineRenderers;
}
if (qGuiApp->testAttribute(Qt::AA_UseSoftwareOpenGL)) {
// kCGLRendererGenericFloatID is the modern software renderer on macOS,
// as opposed to kCGLRendererGenericID, which is deprecated.
attrs << NSOpenGLPFARendererID << kCGLRendererGenericFloatID;
}
// FIXME: Pull this information out of the NSView
QByteArray useLayer = qgetenv("QT_MAC_WANTS_LAYER");
if (!useLayer.isEmpty() && useLayer.toInt() > 0) {