aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2016-08-02 11:52:58 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2016-08-05 14:09:36 +0000
commitff645deb25c18eeae3d248a6a60bc2954129ee28 (patch)
tree080835aa89b2e98019d2592e3b17003da3245224 /src/quick
parent837c5d6284eeec8adb9b2caa3a0ce82b0da019a1 (diff)
Remove artifacts in font rendering
The distancefield cache did not clear the textures before using them. Hence, random values could leak through in the edges of the distancefields, leading to random pixels at the edges of the rendered glyphs. This issue was rarely visible before, because of the way the glyphs were stacked on the textures. That stacking was changed as a result of 7190aa26f65ab97b4f54c156a107ed7748a11df5, which made the issue happen more often, so it was detected by lancelot. Change-Id: Ibe7a20dd7ba557ab92966e714c25a100e218ed24 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
index 728d8b6541..31275b304d 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
@@ -253,7 +253,8 @@ void QSGDefaultDistanceFieldGlyphCache::createTexture(TextureInfo *texInfo, int
const GLenum format = GL_ALPHA;
#endif
- m_funcs->glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, 0, format, GL_UNSIGNED_BYTE, 0);
+ QByteArray zeroBuf(width * height, 0);
+ m_funcs->glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, 0, format, GL_UNSIGNED_BYTE, zeroBuf.constData());
texInfo->size = QSize(width, height);