From ebfad73b4e44fe6db8059200da105b4b87888718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 22 Oct 2018 16:29:29 +0200 Subject: macOS: Fix NSOpenGLContext view association check The expression "m_context.view = view" always evaluates to the view, so the check was flawed. Change-Id: Icef4ba5244975ccd78a151c7d40c53b2364c6148 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm') diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 1e1b3907ed..1cd77a22e4 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -414,7 +414,8 @@ bool QCocoaGLContext::setDrawable(QPlatformSurface *surface) // have the same effect as an update. // Now we are ready to associate the view with the context - if ((m_context.view = view) != view) { + m_context.view = view; + if (m_context.view != view) { qCInfo(lcQpaOpenGLContext) << "Failed to set" << view << "as drawable for" << m_context; m_updateObservers.clear(); return false; -- cgit v1.2.3 From 72bedd49bfb02ba7c7abf2a1a4c6cd165ebcd447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Tue, 16 Oct 2018 18:17:56 +0200 Subject: [cocoa] Disable offline renderers for dual AMD FirePro GPU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AMD FirePro dual gpus on the Mac Pro have a problem with offline renderers in Chromium. Therefore, Chromium and thus Qt WebEngine disable this option via the pixel format attributes. The Qt Cocoa plugin on the other hand enables it in the recent versions, causing context creation in Qt WebEngine to fail when run on a Mac Pro with dual AMD FirePro gpus due to incompatible context options. This patch uses the environment variable QT_MAC_PRO_WEBENGINE_WORKAROUND which is set by Qt WebEngine upon application startup if the application is running on a late 2013 Mac Pro. It should typically not be set from anywhere else. [ChangeLog] Offline renderers will be disabled when the application is using Qt WebEngine and running on one of the late 2013 Mac Pro models. Fixes: QTBUG-70062 Change-Id: I0b0831efb6f4073ebd37672040aaed6370853fc0 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm') diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 7ffe0003d3..76f8a7bb02 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -456,7 +456,13 @@ NSOpenGLPixelFormat *QCocoaGLContext::createNSOpenGLPixelFormat(const QSurfaceFo if (format.stereo()) attrs << NSOpenGLPFAStereo; - attrs << NSOpenGLPFAAllowOfflineRenderers; + //Workaround for problems with Chromium and offline renderers on the lat 2013 MacPros. + //FIXME: Think if this could be solved via QSurfaceFormat in the future. + static bool offlineRenderersAllowed = qEnvironmentVariableIsEmpty("QT_MAC_PRO_WEBENGINE_WORKAROUND"); + if (offlineRenderersAllowed) { + // Allow rendering on GPUs without a connected display + attrs << NSOpenGLPFAAllowOfflineRenderers; + } QByteArray useLayer = qgetenv("QT_MAC_WANTS_LAYER"); if (!useLayer.isEmpty() && useLayer.toInt() > 0) { -- cgit v1.2.3 From 85b0ce8ca36d52db71b519ee8d2a1ce369c53a81 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 25 Feb 2019 13:54:26 +0100 Subject: Fix can not -> cannot Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking --- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm') diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 93d95b38ea..fe1fc31553 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -86,7 +86,7 @@ QCocoaGLContext::QCocoaGLContext(QOpenGLContext *context) } m_context = nativeHandle.value().context(); if (!m_context) { - qCWarning(lcQpaOpenGLContext, "QCocoaNativeContext's NSOpenGLContext can not be null"); + qCWarning(lcQpaOpenGLContext, "QCocoaNativeContext's NSOpenGLContext cannot be null"); return; } -- cgit v1.2.3