summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/gl_integrations/xcb_glx
diff options
context:
space:
mode:
authorJiDe Zhang <zhangjide@uniontech.com>2021-03-25 12:07:23 +0800
committerJiDe Zhang <zhangjide@uniontech.com>2021-03-26 11:20:36 +0800
commit3e65d0408b830518ca2f18c8d0d583cbb665d1f3 (patch)
tree612bc2e2902a8cddd83d179390e804a84fca580f /src/plugins/platforms/xcb/gl_integrations/xcb_glx
parent9c28080f4955135434125bf09c4425c7787fac03 (diff)
Use QOpenGLContext::openGLModuleType() instead of QT_CONFIG(opengles2)
In the QOpenGLContext::openGLModuleType(), it will correctly judge QT_CONFIG(opengles2), there is no need to use QT_CONFIG(opengles2) alone in QGLXContext. Change-Id: I012703b6a81b88fa4b8aa53cc1077c8b42d34ed5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index b6cb54370a..81ece71f02 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -226,11 +226,8 @@ QGLXContext::QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFor
, m_ownsContext(true)
{
if (m_format.renderableType() == QSurfaceFormat::DefaultRenderableType)
-#if QT_CONFIG(opengles2)
- m_format.setRenderableType(QSurfaceFormat::OpenGLES);
-#else
- m_format.setRenderableType(QSurfaceFormat::OpenGL);
-#endif
+ m_format.setRenderableType(QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL
+ ? QSurfaceFormat::OpenGL : QSurfaceFormat::OpenGLES);
if (m_format.renderableType() != QSurfaceFormat::OpenGL && m_format.renderableType() != QSurfaceFormat::OpenGLES)
return;