diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-06-26 13:20:00 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-07-04 11:09:47 +0200 |
commit | 46d72a117df642135718b38995346267312c4808 (patch) | |
tree | fde0f1a5528460b95f640cad6216c059b5770494 /src | |
parent | c5578b16d6454e708c8ce12661a85d41eeaaa758 (diff) |
Fix possible crash when distance field cache spans multiple textures
The allocated area for each texture has to have its origin at (0,0)
otherwise the actual required height of the cache is too low. When
using the texture upload workaround, this would crash, and when not
it would lead to missing glyphs.
Note that this is because the texture may contain a bit of empty
space at the top, since the area allocator may allocate this area
to a glyph which actually belongs to the previous texture (we use
a single area allocator for the entire cache and some glyphs may
overlap the limit between two textures).
[ChangeLog][Text] Fixed missing glyphs and in some cases crashes
when large character sets were being used on system with a low
maximum texture size.
Task-number: QTBUG-76528
Change-Id: I710ebbdd2feba4567505393fb12f89b5dd8501f1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h index c64adddd91..fb07191e59 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h @@ -97,7 +97,7 @@ private: QDistanceField image; int padding = -1; - TextureInfo(const QRect &preallocRect = QRect()) : texture(0), allocatedArea(preallocRect) { } + TextureInfo(const QRect &preallocRect = QRect(0, 0, 1, 1)) : texture(0), allocatedArea(preallocRect) { } }; void createTexture(TextureInfo * texInfo, int width, int height, const void *pixels); |