Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
4.8.0
-
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.