summaryrefslogtreecommitdiffstats
path: root/src/extras/text/distancefieldtextrenderer_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-231-20/+20
| | | | | | | | | | | This reverts commit 03e5f60e585701608c1181365faee484d7a1f14c. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I359e89ed77b1b2750607617d138ebb6c316f0296 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update commercial license headersTarja Sundqvist2021-02-021-20/+20
| | | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qt3d. Examples, documentation files or tests are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4155 Change-Id: I139c8ad72c042b0900239decc36cfed4bc1c4951 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* QDistanceFieldText: QEntity that renders textWieland Hagen2017-01-301-0/+90
A QDistanceFieldText has a text position (within the x/y-plane), a color, a text (QString), a QFont, and a QDistanceGlyphCache that is used to retrieve the glyph textures needed for rendering. To render a given string, we use a QTextLayout to generate GlyphRuns, which are associated with a given QRawFont. Now the following may happen: 1. there may be multiple QRawFonts generated by the QTextLayout. this is because some glyphs may not be available in one font, so another font has to be used for these glyphs. 2. for the same QRawFont, multiple QTextureAtlasses may be needed for all glyphs. This is because the the QDistanceFieldGlyphCache grows lazily by allocating more QTextureAtlasses on demand. So, for any given QDistanceFieldText, we might need to use multiple textures for rendering. Because of this, we might need to create multiple QEntities, each with a separate QDistanceFieldMaterial. These QEntities are the DistanceFieldTextRenderers, which encapsulate all QComponents needed to render the glyphs taken from one texture. When something changes, QDistanceFieldText::update() uses a QTextLayout to generate a number of QGlyphRuns, each associated with a QRawFont. These QGlyphRuns are then given to QDistanceFieldTextPrivate::setCurrentGlyphRuns(). There, for each distinct texture, all glyph positions are gathered, and according vertex and index buffers are built. These index buffers are then given to the DistanceFieldTextRenderer nodes. We make sure to properly ref-count the glyphs within the QDistanceFieldGlyphCache. Change-Id: Icf332b87541a6426abd4fbb12e2968a6d8ec5c4c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>