diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-25 15:19:28 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-28 13:32:51 +0000 |
commit | 05e2690009553d3faaf04ef8927fc072c652dd52 (patch) | |
tree | 824b3829bf87e75babf0587cbea476cccee2558a /src/plugins/platforms/windows/qwindowsintegration.cpp | |
parent | 47bbc6d6f6bd7587e88b5b8bda79f848bb988b32 (diff) |
Windows QPA: Don't test for Desktop GL if Qt::AA_UseDesktopOpenGL is set
Pass the requested render to detectSupportedRenderers(), replacing
the bool glesOnly parameters. This allows for simplifying the code.
Fixes: QTBUG-70733
Change-Id: Iab65f62d24bf750019180e3b00e2d23c105e5997
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsintegration.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 7d621126b9..9e03d09607 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -393,7 +393,7 @@ QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate() switch (requestedRenderer) { case QWindowsOpenGLTester::DesktopGl: if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) { - if ((QWindowsOpenGLTester::supportedRenderers() & QWindowsOpenGLTester::DisableRotationFlag) + if ((QWindowsOpenGLTester::supportedRenderers(requestedRenderer) & QWindowsOpenGLTester::DisableRotationFlag) && !QWindowsScreen::setOrientationPreference(Qt::LandscapeOrientation)) { qCWarning(lcQpaGl, "Unable to disable rotation."); } @@ -407,19 +407,19 @@ QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate() case QWindowsOpenGLTester::AngleRendererD3d11Warp: return QWindowsEGLStaticContext::create(requestedRenderer); case QWindowsOpenGLTester::Gles: - return QWindowsEGLStaticContext::create(QWindowsOpenGLTester::supportedGlesRenderers()); + return QWindowsEGLStaticContext::create(requestedRenderer); case QWindowsOpenGLTester::SoftwareRasterizer: if (QWindowsStaticOpenGLContext *swCtx = QOpenGLStaticContext::create(true)) return swCtx; qCWarning(lcQpaGl, "Software OpenGL failed. Falling back to system OpenGL."); - if (QWindowsOpenGLTester::supportedRenderers() & QWindowsOpenGLTester::DesktopGl) + if (QWindowsOpenGLTester::supportedRenderers(requestedRenderer) & QWindowsOpenGLTester::DesktopGl) return QOpenGLStaticContext::create(); return nullptr; default: break; } - const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers(); + const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers(requestedRenderer); if (supportedRenderers.testFlag(QWindowsOpenGLTester::DisableProgramCacheFlag) && !QCoreApplication::testAttribute(Qt::AA_DisableShaderDiskCache)) { QCoreApplication::setAttribute(Qt::AA_DisableShaderDiskCache); @@ -441,7 +441,7 @@ QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate() #elif defined(QT_OPENGL_ES_2) QWindowsOpenGLTester::Renderers glesRenderers = QWindowsOpenGLTester::requestedGlesRenderer(); if (glesRenderers == QWindowsOpenGLTester::InvalidRenderer) - glesRenderers = QWindowsOpenGLTester::supportedGlesRenderers(); + glesRenderers = QWindowsOpenGLTester::supportedRenderers(QWindowsOpenGLTester::AngleRendererD3d11); return QWindowsEGLStaticContext::create(glesRenderers); #elif !defined(QT_NO_OPENGL) return QOpenGLStaticContext::create(); |