From 476adac337757da4af027de1869f5296f28ff39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 3 Oct 2012 10:28:43 +0200 Subject: [PATCH] Do not resolve glx functions specified in GLX 1.3 According to the OpenGL ABI for Linux GLX 1.3 is a minimum requirement. Therefore we do not need to resolve the symbols which are present in that version. KWin did always require at least 1.3, for all the resolved functions there were checks in the Scene, but they might have been incorrect. Instead now the GLX version is checked and OpenGL compositing is blocked if there is not at least GLX 1.3. REVIEW: 106704 --- glxbackend.cpp | 10 ++++------ libkwineffects/kwinglutils_funcs.cpp | 17 ----------------- libkwineffects/kwinglutils_funcs.h | 18 ------------------ 3 files changed, 4 insertions(+), 41 deletions(-) diff --git a/glxbackend.cpp b/glxbackend.cpp index a9228f73ee..8b2360a8b0 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -68,12 +68,10 @@ GlxBackend::~GlxBackend() void GlxBackend::init() { initGLX(); - // check for FBConfig support - if (!hasGLExtension("GLX_SGIX_fbconfig") || !glXGetFBConfigAttrib || !glXGetFBConfigs || - !glXGetVisualFromFBConfig || !glXCreatePixmap || !glXDestroyPixmap || - !glXCreateWindow || !glXDestroyWindow) { - setFailed("GLX_SGIX_fbconfig or required GLX functions missing"); - return; // error + // require at least GLX 1.3 + if (!hasGLXVersion(1, 3)) { + setFailed("Requires at least GLX 1.3"); + return; } if (!initDrawableConfigs()) { setFailed("Could not initialize the drawable configs"); diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index 71fd25c7d2..4482328664 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -66,14 +66,6 @@ glXCopySubBuffer_func glXCopySubBuffer; glXGetVideoSync_func glXGetVideoSync; glXWaitVideoSync_func glXWaitVideoSync; glXSwapInterval_func glXSwapInterval; -// GLX_SGIX_fbconfig -glXGetFBConfigAttrib_func glXGetFBConfigAttrib; -glXGetVisualFromFBConfig_func glXGetVisualFromFBConfig; -glXCreateWindow_func glXCreateWindow; -glXDestroyWindow_func glXDestroyWindow; -glXCreatePixmap_func glXCreatePixmap; -glXDestroyPixmap_func glXDestroyPixmap; -glXGetFBConfigs_func glXGetFBConfigs; // glActiveTexture glActiveTexture_func glActiveTexture; @@ -189,15 +181,6 @@ void glxResolveFunctions() } else { glXSwapInterval = NULL; } - - OpenGLPlatformInterface platformInterface = GlxPlatformInterface; - GL_RESOLVE_WITH_EXT(glXGetFBConfigAttrib, glXGetFBConfigAttribSGIX); - GL_RESOLVE_WITH_EXT(glXGetVisualFromFBConfig, glXGetVisualFromFBConfigSGIX); - GL_RESOLVE(glXGetFBConfigs); - GL_RESOLVE(glXCreateWindow); - GL_RESOLVE(glXDestroyWindow); - GL_RESOLVE(glXCreatePixmap); - GL_RESOLVE(glXDestroyPixmap); } #endif diff --git a/libkwineffects/kwinglutils_funcs.h b/libkwineffects/kwinglutils_funcs.h index f7dc50921e..675088beca 100644 --- a/libkwineffects/kwinglutils_funcs.h +++ b/libkwineffects/kwinglutils_funcs.h @@ -203,24 +203,6 @@ typedef int (*glXSwapInterval_func)(int ratio); extern KWIN_EXPORT glXGetVideoSync_func glXGetVideoSync; extern KWIN_EXPORT glXWaitVideoSync_func glXWaitVideoSync; extern KWIN_EXPORT glXSwapInterval_func glXSwapInterval; -// GLX_SGIX_fbconfig and misc GLX 1.3 stuff -typedef int (*glXGetFBConfigAttrib_func)(Display *dpy, GLXFBConfig config, - int attribute, int *value); -typedef XVisualInfo*(*glXGetVisualFromFBConfig_func)(Display *dpy, GLXFBConfig config); -extern KWIN_EXPORT glXGetFBConfigAttrib_func glXGetFBConfigAttrib; -extern KWIN_EXPORT glXGetVisualFromFBConfig_func glXGetVisualFromFBConfig; -typedef GLXWindow(*glXCreateWindow_func)(Display *dpy, GLXFBConfig config, - Window win, const int *attribList); -typedef void (*glXDestroyWindow_func)(Display *dpy, GLXWindow window); -typedef GLXPixmap(*glXCreatePixmap_func)(Display *dpy, GLXFBConfig config, - Pixmap pixmap, const int *attribList); -typedef void (*glXDestroyPixmap_func)(Display *dpy, GLXPixmap pixmap); -typedef GLXFBConfig*(*glXGetFBConfigs_func)(Display *dpy, int screen, int *nelements); -extern KWIN_EXPORT glXCreateWindow_func glXCreateWindow; -extern KWIN_EXPORT glXDestroyWindow_func glXDestroyWindow; -extern KWIN_EXPORT glXCreatePixmap_func glXCreatePixmap; -extern KWIN_EXPORT glXDestroyPixmap_func glXDestroyPixmap; -extern KWIN_EXPORT glXGetFBConfigs_func glXGetFBConfigs; // glActiveTexture typedef void (*glActiveTexture_func)(GLenum);