Refactor the fbconfig code

Review Request #119463 - Created July 25, 2014 and submitted

Information
Fredrik Höglund
kwin
master
Reviewers
kwin

This series removes the table that maps depths to fbconfigs, and replaces it with a hash table that maps visual ID's to fbconfigs. The hash table is populated on demand instead of being initialized on startup.

The main point of this is to disambiguate formats that have the same depth, such as GL_RGBA8 and GL_RGB10_A2. I think this should fix the problems kwin has with depth 30 support.

The restriction that the server must support an ARGB 8888 visual is also removed. If that visual is not supported there won't be any windows that use it, but that doesn't seem like a good reason to not allow compositing.

This series is also available in the visuals branch in my kwin clone, but the combined diff should actually be quite easy to review.

commit 64d5ef22a4f6f6f45ae495259c3430673946161a
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:54:50 2014 +0200

    glx: Remove initDrawableConfigs()

    The table that maps pixmap depths to FBConfigs is no longer used.

commit 0a5ce293b5eff20198461c40d5afc1a06cd232ff
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:53:10 2014 +0200

    Remove SceneOpenGL::Texture::findTarget()

    It is no longer used.

commit e08f2126346691cf8e9055371944a294fab7e9ea
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:52:31 2014 +0200

    Remove SceneOpenGL::Texture::load(..., int depth)

    The scene always uses the version that takes an xcb_visualid_t.

commit cd4b22f9725b4fcb44a37c04c9a52d6da8f58417
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:47:58 2014 +0200

    glx: Use the X visual when choosing an FBConfig

    This adds a SceneOpenGL::Texture::load(..., xcb_visualid_t) overload,
    and uses it to bind window pixmaps to textures.

    By taking the RGBA masks in the visual into account when choosing an
    FBConfig for the GLXPixmap, we are able to disambiguate formats that
    have the same depth, such as GL_RGB10_A2 and GL_RGBA8.

commit fb2ad10cc34118dc63c623e5c3f2d4fed3a42a06
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:44:20 2014 +0200

    Add a bitCount() util function

    This function returns the number of bits set in an unsigned integer.

commit 7eea11b19b3d2a3da8fd5b8500f2e16cea377e77
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:43:21 2014 +0200

    Remove SceneOpenGL::Texture::update()

    The default implementation is a no-op, and none of the current
    backends reimplement it.

commit 0f3448015f6bf49842b116c4a171f983eacdf46e
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:42:47 2014 +0200

    Remove SceneOpenGL::Texture::load(QPixmap)

    Fold it into the constructor, since that's the only place
    where it's called.

commit ad42c72d20290d211e456770fe06c777a1f663fb
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:41:51 2014 +0200

    Remove SceneOpenGL::Texture::load(QImage)

    It's never called.

commit 1ac3304aabedaad42ee17ee3ada91e11ab7a6fb5
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:41:07 2014 +0200

    Remove the region parameter from Texture::load()

    It's never used.

commit 58fd317931162b72db4bde14398ccb55bcab25c3
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Sun Apr 13 20:40:19 2014 +0200

    Don't pass pixmap handles as const references

    But do pass the region in SceneOpenGL::Texture::load() as a const
    reference.

    This patch also replaces the Xlib types with their xcb equivalents.

  

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Martin Flöser
Fredrik Höglund
Martin Flöser
Fredrik Höglund
Martin Flöser
Fredrik Höglund
Review request changed

Status: Closed (submitted)

Loading...