From 9442b3a1c3655ffc2fe0b80541259ff72b6192c9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 20 Apr 2016 09:09:29 +0200 Subject: Windows QPA/GL: Avoid crash in GL driver. QWindowsStaticOpenGLContext::doCreate(): Invoke QWindowsOpenGLTester::supportedRenderers() only when needed; specifically, do not unnecessarily call it when GLES/SW renderer is specified. Amends change b4c8e1517455becb138876c08b3bdd880a80770d. Task-number: QTBUG-49541 Task-number: QTBUG-52693 Change-Id: I58d1c584d194f8e7fee35ee16b77575f86d3c22e Reviewed-by: Laszlo Agocs --- src/plugins/platforms/windows/qwindowsintegration.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsintegration.cpp') diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index bf238c3e77..3966a4cd77 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -345,13 +345,11 @@ QWindowsWindow *QWindowsIntegration::createPlatformWindowHelper(QWindow *window, QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate() { #if defined(QT_OPENGL_DYNAMIC) - const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers(); - QWindowsOpenGLTester::Renderer requestedRenderer = QWindowsOpenGLTester::requestedRenderer(); switch (requestedRenderer) { case QWindowsOpenGLTester::DesktopGl: if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) { - if ((supportedRenderers & QWindowsOpenGLTester::DisableRotationFlag) + if ((QWindowsOpenGLTester::supportedRenderers() & QWindowsOpenGLTester::DisableRotationFlag) && !QWindowsScreen::setOrientationPreference(Qt::LandscapeOrientation)) { qCWarning(lcQpaGl, "Unable to disable rotation."); } @@ -377,6 +375,7 @@ QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate() break; } + const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers(); if (supportedRenderers & QWindowsOpenGLTester::DesktopGl) { if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) { if ((supportedRenderers & QWindowsOpenGLTester::DisableRotationFlag) -- cgit v1.2.3