From fc3e8514144535db22c431251bc0feea99cf72e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 11 Apr 2019 11:44:36 +0200 Subject: macOS: disable threaded OpenGL (unconditionally) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/cocoa/qcocoaintegration.mm | 12 +++++++----- 1 file 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 -- cgit v1.2.3