summaryrefslogtreecommitdiffstats
path: root/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash when expanding glyph cache beyond one textureEskil Abrahamsen Blomfeldt2022-06-161-19/+29
| | | | | | | | | | | | | | | | | | | | | | | | | The textureInfo() function was returning pointers to the m_textures array, which would then be stored in the m_glyphTextures map and other places in the renderer. Then the function then later resized it, the renderer would be riddled with dangling pointers and crash pretty quickly. There is a preset maximum texture count, so we just make sure the array is the correct size to begin with and never resize it. In addition, this contains a port of 46d72a117df642135718b38995346267312c4808 and 9a53834f1e7fce2fc3b1ecc2a311faedbc371d37 from Qt Quick. Note: Glyph recycling does not seem to work, so you may end up running out of cache space. However, it will no longer crash, but glyphs will be missing instead. Fixes: QT3DS-4235 Change-Id: I7d9707ff95ac0838e7e6574714a06ac1c23986fa Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Fix loading pregenerated distance field cachev2.5.0-rcEskil Abrahamsen Blomfeldt2019-10-151-1/+2
| | | | | | | | | | | | | | | We can't assume the stride of the internal QImage data matches the width, since this is likely to be aligned to four bytes. Therefore we copy one scan line at the time instead. [ChangeLog][Text] Pregenerating distance field caches would sometimes lead to corrupted rendering. Fixes: QT3DS-3908 Change-Id: I3c30c6c707d6f220d852d6c067301ab4d468884c Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Adapt distance field cache to 5.14Laszlo Agocs2019-08-141-0/+8
| | | | | | | | | | | | There is a new pure virtual in the base class in 5.14. It is not very relevant here since this glyph cache is not used in combination with the df text materials of Qt Quick. We can nonetheless implement the virtual and return the correct value. Task-number: QT3DS-3856 Change-Id: I97b807ec73a664488b63c8888bc8cd90a9c53589 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Long live the slayer!Pasi Keränen2019-06-071-0/+518
Initial commit of OpenGL Runtime to repository. Based on SHA1 61823aaccc6510699a54b34a2fe3f7523dab3b4e of qt3dstudio repository. Task-number: QT3DS-3600 Change-Id: Iaeb80237399f0e5656a19ebec9d1ab3a681d8832 Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>