Skip to content

Commit

Permalink
macOS: Respect Qt::AA_UseSoftwareOpenGL
Browse files Browse the repository at this point in the history
Change-Id: Ia83e8e9e571e4f46d2a8d810c376015552755457
Reviewed-by: Morten Johan Sørvig <[email protected]>
  • Loading branch information
torarnv committed Oct 24, 2019
1 parent f39230f commit 312793f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/platforms/cocoa/qcocoaglcontext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ static inline QByteArray getGlString(GLenum param)
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) {
Expand Down

0 comments on commit 312793f

Please sign in to comment.