Allow glyph cache textures to be created at full size.
authorMichael Brasser <michael.brasser@live.com>
Tue, 24 Feb 2015 15:29:15 +0000 (09:29 -0600)
committerMichael Brasser <michael.brasser@live.com>
Wed, 25 Feb 2015 14:36:25 +0000 (14:36 +0000)
commitdd58743eafaff2e55cc49d9d6b9f8a027b6f646e
tree20e656cb5515d613e2f1ddb55e283b68aee1a0f4
parentad67ec26d0cbc98e3440dd38bb20eef4da2ee96d
Allow glyph cache textures to be created at full size.

On embedded hardware, texture resizes can be quite slow. The glyph
cache currently often needs to resize when new glyphs are added, and
glyph additions are very frequent when using a language with a large
set of glyphs (such as Chinese).

The current glyph cache design minimizes the amount of memory used.
When QSG_PREFER_FULLSIZE_GLYPHCACHE_TEXTURES is set, and we are using
a font with a large number of glyphs, we can instead allocate max-sized
textures. This leads to significantly less time when inserting glyphs
into the cache (often incurred over a span of time), at the cost of
higher initial memory and creation times (often incurred at
application startup).

Change-Id: Id1021b9d213e5f8635c4197b624474f28c6f44ff
Task-number: QTBUG-29264
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h