diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index 8ea2a6dc80..1d8bb4f1b0 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -24,6 +24,7 @@ along with this program. If not, see . #include #include #include +#include #include #include diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index d0f2626d5e..902e4adffb 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -181,10 +181,8 @@ static QString formatGLError(GLenum err) case GL_INVALID_ENUM: return QStringLiteral("GL_INVALID_ENUM"); case GL_INVALID_VALUE: return QStringLiteral("GL_INVALID_VALUE"); case GL_INVALID_OPERATION: return QStringLiteral("GL_INVALID_OPERATION"); -#ifndef KWIN_HAVE_OPENGLES case GL_STACK_OVERFLOW: return QStringLiteral("GL_STACK_OVERFLOW"); case GL_STACK_UNDERFLOW: return QStringLiteral("GL_STACK_UNDERFLOW"); -#endif case GL_OUT_OF_MEMORY: return QStringLiteral("GL_OUT_OF_MEMORY"); default: return QStringLiteral("0x") + QString::number(err, 16); } @@ -391,13 +389,8 @@ void GLShader::bindAttributeLocation(const char *name, int index) void GLShader::bindFragDataLocation(const char *name, int index) { -#ifndef KWIN_HAVE_OPENGLES - if (hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_EXT_gpu_shader4"))) + if (!GLPlatform::instance()->isGLES() && (hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_EXT_gpu_shader4")))) glBindFragDataLocation(mProgram, index, name); -#else - Q_UNUSED(name) - Q_UNUSED(index) -#endif } void GLShader::bind() @@ -1397,7 +1390,6 @@ static QString formatFramebufferStatus(GLenum status) case GL_FRAMEBUFFER_UNSUPPORTED: // A format or the combination of formats of the attachments is unsupported return QStringLiteral("GL_FRAMEBUFFER_UNSUPPORTED"); -#ifndef KWIN_HAVE_OPENGLES case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: // Not all attached images have the same width and height return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT"); @@ -1413,7 +1405,6 @@ static QString formatFramebufferStatus(GLenum status) case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: // The read buffer is missing return QStringLiteral("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER"); -#endif default: return QStringLiteral("Unknown (0x") + QString::number(status, 16) + QStringLiteral(")"); } diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index ad141d5d01..9cdc9d3983 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -84,19 +84,12 @@ void eglResolveFunctions() void glResolveFunctions(OpenGLPlatformInterface platformInterface) { -#ifndef KWIN_HAVE_OPENGLES if (hasGLExtension(QByteArrayLiteral("GL_ARB_robustness"))) { // See http://www.opengl.org/registry/specs/ARB/robustness.txt GL_RESOLVE_WITH_EXT(glGetGraphicsResetStatus, glGetGraphicsResetStatusARB); GL_RESOLVE_WITH_EXT(glReadnPixels, glReadnPixelsARB); GL_RESOLVE_WITH_EXT(glGetnUniformfv, glGetnUniformfvARB); - } else { - glGetGraphicsResetStatus = KWin::GetGraphicsResetStatus; - glReadnPixels = KWin::ReadnPixels; - glGetnUniformfv = KWin::GetnUniformfv; - } -#else - if (hasGLExtension(QByteArrayLiteral("GL_EXT_robustness"))) { + } else if (hasGLExtension(QByteArrayLiteral("GL_EXT_robustness"))) { // See http://www.khronos.org/registry/gles/extensions/EXT/EXT_robustness.txt glGetGraphicsResetStatus = (glGetGraphicsResetStatus_func) eglGetProcAddress("glGetGraphicsResetStatusEXT"); glReadnPixels = (glReadnPixels_func) eglGetProcAddress("glReadnPixelsEXT"); @@ -106,7 +99,6 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface) glReadnPixels = KWin::ReadnPixels; glGetnUniformfv = KWin::GetnUniformfv; } -#endif // KWIN_HAVE_OPENGLES } static GLenum GetGraphicsResetStatus()