Remove useless branching on EGL/GLX in GLPlatform

Summary:
The code for EGL and GLX platform did the same checks, just with the
difference that the EGL check has another check for isGLES.

So let's just do the branching on whether isGLES or GL.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3446
This commit is contained in:
Martin Gräßlin 2016-11-22 07:44:37 +01:00
parent 451bbb54dd
commit b1e258d1e9

View file

@ -631,18 +631,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
m_mesaVersion = parseVersionString(version);
}
if (platformInterface == EglPlatformInterface) {
if (isGLES()) {
m_supportsGLSL = true;
m_textureNPOT = true;
} else {
m_supportsGLSL = m_extensions.contains("GL_ARB_shader_objects") &&
m_extensions.contains("GL_ARB_fragment_shader") &&
m_extensions.contains("GL_ARB_vertex_shader");
m_textureNPOT = m_extensions.contains("GL_ARB_texture_non_power_of_two");
}
} else if (platformInterface == GlxPlatformInterface) {
if (isGLES()) {
m_supportsGLSL = true;
m_textureNPOT = true;
} else {
m_supportsGLSL = m_extensions.contains("GL_ARB_shader_objects") &&
m_extensions.contains("GL_ARB_fragment_shader") &&
m_extensions.contains("GL_ARB_vertex_shader");