Revert "macOS: disable threaded OpenGL (unconditionally)"

This reverts commit fc3e851414.

The patch introduces a crash in Qt Quick in the test
tst_QQuickWindow::multipleWindows() on macOS 10.12.

Reverting this will cause dead locks on older macOS versions
for users who opt in to using layer backed mode, so we
should bring this back as soon as a fix can be found for
the crash. But in order to proceed with qt5.git integration,
we revert it for now.

Task-number: QTBUG-75782
Change-Id: I57f6b2918c3fc4b4e58a8c39b24a19e2d796a4f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2019-05-14 14:02:32 +02:00 committed by Jani Heikkinen
parent 1c7b5c20a5
commit 3803b41eae

View File

@ -347,13 +347,11 @@ bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) cons
switch (cap) {
#ifndef QT_NO_OPENGL
case ThreadedOpenGL:
// 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;
// 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);
case OpenGL:
case BufferQueueingOpenGL:
#endif