aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2014-11-06 12:10:00 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2014-11-11 14:30:26 +0100
commitb5403efcb103423f44c707db4b07df0ff5c2203b (patch)
treeebcea41b78200a052dde9d606f74ef29a85b782a /src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
parent868def84fe800aaba937159814388249ebbaf914 (diff)
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 <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h')
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h3
1 files changed, 2 insertions, 1 deletions
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)
{ }
};