diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-04-11 11:44:36 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2019-05-08 08:41:10 +0000 |
commit | fc3e8514144535db22c431251bc0feea99cf72e2 (patch) | |
tree | 3d5dbe09586fb60bff995d18acb7925c2d5fa54e | |
parent | 0b693175e4e70cead730a245cffa66304998196a (diff) |
macOS: disable threaded OpenGL (unconditionally)
We can’t determine when the app will use layer-backed
views without having access to the QWindow and NSView
instance, so make the conservative choice of always
returning false for ThreadedOpenGL.
Task-number: QTBUG-74820
Change-Id: If2779b17eead78ce1929ccebc3bd8fc0eb00c4b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index fb3d05d3e4..855b42657d 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -347,11 +347,13 @@ bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) cons switch (cap) { #ifndef QT_NO_OPENGL case ThreadedOpenGL: - // AppKit expects rendering to happen on the main thread, and we can - // easily end up in situations where rendering on secondary threads - // will result in visual artifacts, bugs, or even deadlocks, when - // building with SDK 10.14 or higher which enbles view layer-backing. - return QMacVersion::buildSDK() < QOperatingSystemVersion(QOperatingSystemVersion::MacOSMojave); + // Qt's threaded OpenGL implementation does not work well for layer-backed + // views, where we can easily end up in situations where rendering on secondary + // threads will result in visual artifacts, bugs, or even deadlocks. It is + // not possible to determine here if the the app will be using layer-backed + // views (it can opt-in using SDK 10.14+ on macOS 10.4+, or by setting + // NSWindow flags such as NSWindowStyleMaskFullSizeContentView). + return false; case OpenGL: case BufferQueueingOpenGL: #endif |