summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-04-29 05:47:36 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-04-29 05:47:36 (GMT)
commit1de8a46d1e11a5fe0eec80ada7592b0f16c17d06 (patch)
tree6697ed1425ee5b374dce2006b54fdc43fb1f323d /src/opengl/gl2paintengineex
parentc9c54682bcd23598ac7a8db3b10e9f18c978e268 (diff)
downloadQt-1de8a46d1e11a5fe0eec80ada7592b0f16c17d06.zip
Qt-1de8a46d1e11a5fe0eec80ada7592b0f16c17d06.tar.gz
Qt-1de8a46d1e11a5fe0eec80ada7592b0f16c17d06.tar.bz2
Fix missing glyphs for large fonts with QStaticText/GL/Freetype
When rendering fonts that are so large the Freetype engine will fall back to outline rendering, we would sometimes lose glyphs that were at the edge of the texture, because the width of the image returned by QFontEngine::alphaMapForGlyph() includes a margin (which the other font engines do not) and thus it would sometimes be wider than the available area in the cache's texture. This would in turn cause the GL call to copy the glyph into the cache to fail. The correct fix would probably be to make the algorithm used to calculate the width in QFontEngine::alphaMapForGlyph() the same as the algorithm used by the glyph cache (which would mean to remove the margin there), but to minimize the impact in a patch release, we fix the symptom and move the correct fix to next minor release instead. Task-number: QT-4876 Reviewed-by: Jørgen
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 312d66f..0ffc7af 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -306,7 +306,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
// time.
for (int i = 0; i < maskHeight; ++i)
- glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y + i, maskWidth, 1, GL_ALPHA, GL_UNSIGNED_BYTE, mask.scanLine(i));
+ glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y + i, qMin(c.w, maskWidth), 1, GL_ALPHA, GL_UNSIGNED_BYTE, mask.scanLine(i));
}
}