From b5403efcb103423f44c707db4b07df0ff5c2203b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 6 Nov 2014 12:10:00 +0100 Subject: Add padding to distance field glyph cache Linear filtering can cause pixels outside the glyph's bounding rect to be sampled. On drivers where uninitialized texture data is actually uninitialized, this could cause artifacts in rendering for glyphs at the right edge of the initiliazed area since they would sometimes sample random pixels. To avoid this, we add padding between the glyphs in the cache. [ChangeLog][Qt Quick] Fixed uncommon artifacts in rendering of distance field glyphs. Task-number: QTBUG-42148 Change-Id: I6982b4a150d9459185d50a4362e1ead588d3860f Reviewed-by: Yoann Lopes --- src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h') diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h index f7314776d6..2f9331f6d8 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h @@ -73,8 +73,9 @@ private: QSize size; QRect allocatedArea; QDistanceField image; + int padding; - TextureInfo() : texture(0) + TextureInfo() : texture(0), padding(-1) { } }; -- cgit v1.2.3