Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-24553

Textrendering on QGLWidget contains garbage pixels when ClearType is turned off

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 4.8.0
    • GUI: OpenGL
    • None
    • Windows 7, Visual Studio 2005 X64, NVidia GeForce GTX 460/PCI/SSE2, ClearType turned of in display settings

    Description

      When QPainter renders text on a QGLWidget or QGLFramebufferObject as it's paint device/engine, the glyph rendering contains some garbage pixels.
      This only happens if the QGLWidget has an alpha channel or if ClearType is disabled.

      I tracked the problem down to the GL glyph uploading in QGLTextureGlyphCache. Only the alpha8 version is affected, which is why the problem is only visible when ClearType is turned off or alpha is requested (which causes the glyph renderer to fall back to RENDER_A8).

      QGLTextureGlyphCache already seems to have a fix for NVidia boards in place already, but it did not get executed on my machine.
      The problem is that the check for "NVIDIA" in the GL_VERSION
      is wrong. The correct string to check is GL_VENDOR, since that contains the "NVIDIA" string.

      GL_VERSION = 4.1.0
      GL_VENDOR = NVIDIA Corporation

      (on my machine)

      Looking deeper into the issue, I tested a better fix, which does not require checking for the card vendor.

      Attached you find a screenshot of the problem and a patch to fix the problem (including comments on the fix).

      Alternatively to applying my patch, you could as well change the GL_VERSION check to GL_VENDOR, but since it is a huge performance
      overhead to send the image line by line, I would prefer if you integrate my full patch.

      By the way, I think this is the same bug as https://bugreports.qt-project.org/browse/QTBUG-19568, which got closed because it could not be reproduced,
      since the screenshots show the same wrong pixels below the glyphs.

      Attachments

        1. gl_alpha8_glyph.patch
          4 kB
          Florian Link
        2. opengl_alpha8_bad_glyphs.jpg
          3 kB
          Florian Link
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            florianlink Florian Link
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes