From 05f2b1c912e09be9cb9f1128494d315c53698d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 4 Apr 2011 12:19:57 +0200 Subject: Lighthouse: Add drawable bit to the glx config selection rutine So that we can use the same thing when creating glx pixmaps --- src/plugins/platforms/glxconvenience/qglxconvenience.cpp | 8 ++++---- src/plugins/platforms/glxconvenience/qglxconvenience.h | 4 ++-- .../gl_integration/xpixmap_glx/qwaylandxpixmapglxcontext.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/glxconvenience/qglxconvenience.cpp b/src/plugins/platforms/glxconvenience/qglxconvenience.cpp index 08972f7..f548ad9 100644 --- a/src/plugins/platforms/glxconvenience/qglxconvenience.cpp +++ b/src/plugins/platforms/glxconvenience/qglxconvenience.cpp @@ -25,14 +25,14 @@ enum { #undef FontChange #endif -QVector qglx_buildSpec(const QPlatformWindowFormat &format) +QVector qglx_buildSpec(const QPlatformWindowFormat &format, int drawableBit) { QVector spec(48); int i = 0; spec[i++] = GLX_LEVEL; spec[i++] = 0; - spec[i++] = GLX_DRAWABLE_TYPE; spec[i++] = GLX_WINDOW_BIT; + spec[i++] = GLX_DRAWABLE_TYPE; spec[i++] = drawableBit; if (format.rgba()) { spec[i++] = GLX_RENDER_TYPE; spec[i++] = GLX_RGBA_BIT; @@ -77,13 +77,13 @@ QVector qglx_buildSpec(const QPlatformWindowFormat &format) return spec; } -GLXFBConfig qglx_findConfig(Display *display, int screen , const QPlatformWindowFormat &format) +GLXFBConfig qglx_findConfig(Display *display, int screen , const QPlatformWindowFormat &format, int drawableBit) { bool reduced = true; GLXFBConfig chosenConfig = 0; QPlatformWindowFormat reducedFormat = format; while (!chosenConfig && reduced) { - QVector spec = qglx_buildSpec(reducedFormat); + QVector spec = qglx_buildSpec(reducedFormat, drawableBit); int confcount = 0; GLXFBConfig *configs; configs = glXChooseFBConfig(display, screen,spec.constData(),&confcount); diff --git a/src/plugins/platforms/glxconvenience/qglxconvenience.h b/src/plugins/platforms/glxconvenience/qglxconvenience.h index a3cfd9a..6b65e08 100644 --- a/src/plugins/platforms/glxconvenience/qglxconvenience.h +++ b/src/plugins/platforms/glxconvenience/qglxconvenience.h @@ -7,9 +7,9 @@ #include XVisualInfo *qglx_findVisualInfo(Display *display, int screen, const QPlatformWindowFormat &format); -GLXFBConfig qglx_findConfig(Display *display, int screen, const QPlatformWindowFormat &format); +GLXFBConfig qglx_findConfig(Display *display, int screen, const QPlatformWindowFormat &format, int drawableBit = GLX_WINDOW_BIT); QPlatformWindowFormat qglx_platformWindowFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext context); -QVector qglx_buildSpec(const QPlatformWindowFormat &format); +QVector qglx_buildSpec(const QPlatformWindowFormat &format, int drawableBit = GLX_WINDOW_BIT); QPlatformWindowFormat qglx_reducePlatformWindowFormat(const QPlatformWindowFormat &format, bool *reduced); #endif // QGLXCONVENIENCE_H diff --git a/src/plugins/platforms/wayland/gl_integration/xpixmap_glx/qwaylandxpixmapglxcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xpixmap_glx/qwaylandxpixmapglxcontext.cpp index d5806bb..f98e026 100644 --- a/src/plugins/platforms/wayland/gl_integration/xpixmap_glx/qwaylandxpixmapglxcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xpixmap_glx/qwaylandxpixmapglxcontext.cpp @@ -33,7 +33,7 @@ QWaylandXPixmapGLXContext::QWaylandXPixmapGLXContext(QWaylandXPixmapGLXIntegrati , mWindow(window) , mBuffer(0) , mPixmap(0) - , mConfig(qglx_findConfig(glxIntegration->xDisplay(),glxIntegration->screen(),window->widget()->platformWindowFormat())) + , mConfig(qglx_findConfig(glxIntegration->xDisplay(),glxIntegration->screen(),window->widget()->platformWindowFormat(),GLX_PIXMAP_BIT)) , mGlxPixmap(0) { XVisualInfo *visualInfo = glXGetVisualFromFBConfig(glxIntegration->xDisplay(),mConfig); -- cgit v0.12