Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
4.8.0
-
None
-
Windows 7, ATI
Description
Font not created properly on QGLWidget when using drawText because it creates a cache that comes from a QImage upload and the QImage is padded to the DWORD but the GL Texture doesn't take the padding into account.
See:
void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition)
if (ctx->d_ptr->workaround_brokenAlphaTexSubImage)
else
{ glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_ALPHA, GL_UNSIGNED_BYTE, mask.bits()); }In my case, a character '0' was padded to 12 bytes per line, for a total of 8 lines, but only took up the first 10 bytes per line. When calling glTexSubImage2D, the maskWidth was therefore inconsistent with the data sent. Since Windows puts 0xCD on uninitialized memory, I was seeing some gray pixels and each line was offset by 2 pixels.
Forcing the ctx->d_ptr->workaround_brokenAlphaTexSubImage flag to TRUE to enable the workaround fixes the issue.