diff --git a/backends/virtual/egl_gbm_backend.cpp b/backends/virtual/egl_gbm_backend.cpp index e1fcbab13d..fe9b9639ff 100644 --- a/backends/virtual/egl_gbm_backend.cpp +++ b/backends/virtual/egl_gbm_backend.cpp @@ -238,7 +238,7 @@ void EglGbmBackend::endRenderingFrame(const QRegion &renderedRegion, const QRegi glFlush(); if (m_backend->saveFrames()) { QImage img = QImage(QSize(m_backBuffer->width(), m_backBuffer->height()), QImage::Format_ARGB32); - glReadnPixels(0, 0, m_backBuffer->width(), m_backBuffer->height(), GL_RGBA, GL_UNSIGNED_BYTE, img.byteCount(), (GLvoid*)img.bits()); + kwinGlReadnPixels(0, 0, m_backBuffer->width(), m_backBuffer->height(), GL_RGBA, GL_UNSIGNED_BYTE, img.byteCount(), (GLvoid*)img.bits()); convertFromGLImage(img, m_backBuffer->width(), m_backBuffer->height()); img.save(QStringLiteral("%1/%2.png").arg(m_backend->saveFrames()).arg(QString::number(m_frameCounter++))); } diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index 5a0c52eec3..f256e4c0d4 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -138,7 +138,7 @@ void ScreenShotEffect::postPaintScreen() // copy content from framebuffer into image img = QImage(QSize(width, height), QImage::Format_ARGB32); - glReadnPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, img.byteCount(), (GLvoid*)img.bits()); + kwinGlReadnPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, img.byteCount(), (GLvoid*)img.bits()); GLRenderTarget::popRenderTarget(); ScreenShotEffect::convertFromGLImage(img, width, height); } diff --git a/libkwineffects/CMakeLists.txt b/libkwineffects/CMakeLists.txt index 6e25f103eb..0ba6a0d3fd 100644 --- a/libkwineffects/CMakeLists.txt +++ b/libkwineffects/CMakeLists.txt @@ -5,7 +5,7 @@ ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX KWINEFFECTS VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kwineffects_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KWinEffectsConfigVersion.cmake" - SOVERSION 7 + SOVERSION 8 ) ### xrenderutils lib ### diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index 8918b72010..ac1ceb6263 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -602,7 +602,7 @@ QMatrix4x4 GLShader::getUniformMatrix4x4(const char* name) int location = uniformLocation(name); if (location >= 0) { GLfloat m[16]; - glGetnUniformfv(mProgram, location, sizeof(m), m); + kwinGlGetnUniformfv(mProgram, location, sizeof(m), m); QMatrix4x4 matrix(m[0], m[4], m[8], m[12], m[1], m[5], m[9], m[13], m[2], m[6], m[10], m[14], @@ -672,7 +672,7 @@ static bool fuzzyCompare(const QVector4D &lhs, const QVector4D &rhs) static bool checkPixel(int x, int y, const QVector4D &expected, const char *file, int line) { uint8_t data[4]; - glReadnPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 4, data); + kwinGlReadnPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 4, data); const QVector4D pixel{data[0] / 255.f, data[1] / 255.f, data[2] / 255.f, data[3] / 255.f}; diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index 9cdc9d3983..74f1c4f62b 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -53,9 +53,9 @@ static void GetnUniformfv(GLuint program, GLint location, GLsizei bufSize, GLflo glXSwapIntervalMESA_func glXSwapIntervalMESA; // GL_ARB_robustness / GL_EXT_robustness -glGetGraphicsResetStatus_func glGetGraphicsResetStatus; -glReadnPixels_func glReadnPixels; -glGetnUniformfv_func glGetnUniformfv; +kwinGlGetGraphicsResetStatus_func kwinGlGetGraphicsResetStatus; +kwinGlReadnPixels_func kwinGlReadnPixels; +kwinGlGetnUniformfv_func kwinGlGetnUniformfv; typedef void (*glXFuncPtr)(); @@ -86,18 +86,18 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface) { 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); + GL_RESOLVE_WITH_EXT(kwinGlGetGraphicsResetStatus, glGetGraphicsResetStatusARB); + GL_RESOLVE_WITH_EXT(kwinGlReadnPixels, glReadnPixelsARB); + GL_RESOLVE_WITH_EXT(kwinGlGetnUniformfv, glGetnUniformfvARB); } 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"); - glGetnUniformfv = (glGetnUniformfv_func) eglGetProcAddress("glGetnUniformfvEXT"); + kwinGlGetGraphicsResetStatus = (kwinGlGetGraphicsResetStatus_func) eglGetProcAddress("glGetGraphicsResetStatusEXT"); + kwinGlReadnPixels = (kwinGlReadnPixels_func) eglGetProcAddress("glReadnPixelsEXT"); + kwinGlGetnUniformfv = (kwinGlGetnUniformfv_func) eglGetProcAddress("glGetnUniformfvEXT"); } else { - glGetGraphicsResetStatus = KWin::GetGraphicsResetStatus; - glReadnPixels = KWin::ReadnPixels; - glGetnUniformfv = KWin::GetnUniformfv; + kwinGlGetGraphicsResetStatus = KWin::GetGraphicsResetStatus; + kwinGlReadnPixels = KWin::ReadnPixels; + kwinGlGetnUniformfv = KWin::GetnUniformfv; } } diff --git a/libkwineffects/kwinglutils_funcs.h b/libkwineffects/kwinglutils_funcs.h index 4b60a46abf..ba8e799b1b 100644 --- a/libkwineffects/kwinglutils_funcs.h +++ b/libkwineffects/kwinglutils_funcs.h @@ -58,14 +58,14 @@ using glXSwapIntervalMESA_func = int (*)(unsigned int interval); extern KWINGLUTILS_EXPORT glXSwapIntervalMESA_func glXSwapIntervalMESA; // GL_ARB_robustness / GL_EXT_robustness -using glGetGraphicsResetStatus_func = GLenum (*)(); -using glReadnPixels_func = void (*)(GLint x, GLint y, GLsizei width, GLsizei height, +using kwinGlGetGraphicsResetStatus_func = GLenum (*)(); +using kwinGlReadnPixels_func = void (*)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); -using glGetnUniformfv_func = void (*)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +using kwinGlGetnUniformfv_func = void (*)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -extern KWINGLUTILS_EXPORT glGetGraphicsResetStatus_func glGetGraphicsResetStatus; -extern KWINGLUTILS_EXPORT glReadnPixels_func glReadnPixels; -extern KWINGLUTILS_EXPORT glGetnUniformfv_func glGetnUniformfv; +extern KWINGLUTILS_EXPORT kwinGlGetGraphicsResetStatus_func kwinGlGetGraphicsResetStatus; +extern KWINGLUTILS_EXPORT kwinGlReadnPixels_func kwinGlReadnPixels; +extern KWINGLUTILS_EXPORT kwinGlGetnUniformfv_func kwinGlGetnUniformfv; } // namespace diff --git a/scene_opengl.cpp b/scene_opengl.cpp index e0f9a7780d..dbe33539ed 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -653,7 +653,7 @@ void SceneOpenGL::handleGraphicsReset(GLenum status) timer.start(); // Wait until the reset is completed or max 10 seconds - while (timer.elapsed() < 10000 && glGetGraphicsResetStatus() != GL_NO_ERROR) + while (timer.elapsed() < 10000 && kwinGlGetGraphicsResetStatus() != GL_NO_ERROR) usleep(50); qCDebug(KWIN_CORE) << "Attempting to reset compositing."; @@ -699,7 +699,7 @@ qint64 SceneOpenGL::paint(QRegion damage, ToplevelList toplevels) // prepare rendering makes context current on the output QRegion repaint = m_backend->prepareRenderingForScreen(i); - const GLenum status = glGetGraphicsResetStatus(); + const GLenum status = kwinGlGetGraphicsResetStatus(); if (status != GL_NO_ERROR) { handleGraphicsReset(status); return 0; @@ -718,7 +718,7 @@ qint64 SceneOpenGL::paint(QRegion damage, ToplevelList toplevels) m_backend->makeCurrent(); QRegion repaint = m_backend->prepareRenderingFrame(); - const GLenum status = glGetGraphicsResetStatus(); + const GLenum status = kwinGlGetGraphicsResetStatus(); if (status != GL_NO_ERROR) { handleGraphicsReset(status); return 0;