aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-6/+6
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove QSGDistanceFieldGlyphCacheManagerRobin Burchell2017-03-211-1/+0
| | | | | | | | | After the previous cleanups, it became clear that this didn't serve much of a purpose, so let's remove it and simplify the implementation as a result. Change-Id: Iae2ff9c46762f0c7bdf4225a2c4df93bc8253902 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* QSGDistanceFieldGlyphNode: Remove per-node QLinkedList of nodes to deleteRobin Burchell2017-03-151-11/+4
| | | | | | | | | | | | | | We avoided deleting these nodes directly due to preprocess, but this is a bit of a hack. QSGRenderer::preprocess already contains some work to allow for modification of nodes at preprocess time, but it didn't allow for detecting dead nodes. By marking a pointer as not to be touched if it is removed during preprocess, we can remove the per-node QLinkedList and delete directly, while at the same time, still not touching deleted nodes later on in preprocess. Change-Id: I99a1ea65d3fe0b73db73e4a1d10d999d56edcdc4 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QSGDistanceFieldGlyphNode: Use QVarLengthArray to avoid frequent allocation.Robin Burchell2015-06-061-2/+4
| | | | | | | | | This adds a few more text items/frame on my macbook, and more or less halves the amount of transient 608 byte allocations (42mb -> 25mb). Change-Id: Ib1a67c8203f777a2f3b790ff3597d1af34eed2dd Done-with: Gunnar Sletta Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Handle glyph runs with >65536 glyphsRobin Burchell2013-11-041-1/+6
| | | | | | Done-with: Aaron Kennedy <aaron.kennedy@jollamobile.com> Change-Id: Ica3a1dccc798186414b92f900b858966ac8dc8c9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-1/+1
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Support opt-in QSGNode descriptions without breaking binary compat.Gunnar Sletta2013-08-121-2/+2
| | | | | | | | | | This define is quite useful for debugging scene graph internals, but it is disabled by default to conserve memory. For clarity, I renamed the define to QSG_RUNTIME_DESCRIPTION. Change-Id: Ie5ff44d67af38adc65d0d09255d8533dc7a33bff Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fixed distance field text getting clipped at small sizes.Yoann Lopes2013-08-011-1/+1
| | | | | | Task-number: QTBUG-32750 Change-Id: I6bdf63d3cbcaaeb54c7c1ae25dfc55fc7e964075 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* doc: fix some typos in .cpp filesSergio Ahumada2012-09-071-1/+1
| | | | | Change-Id: Ica7685aefde84ec80d8af7a67541af454de4adce Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Fixed glyph margin in QSGDistanceFieldGlyphNode.Yoann Lopes2012-06-081-10/+17
| | | | | | | | | The margin was too big in some cases, causing visual artifacts. The margin should never be bigger than the margin used in the glyph cache. Change-Id: Ia6bd3a9d4a98a2a3484d0e5e803de95ca14fffbb Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Don't register sub distance field glyph nodes with the glyph cache.Yoann Lopes2012-03-201-30/+31
| | | | | | | | | | | The original distance field glyph node takes care of the glyphs reference counting. The potential sub glyph nodes created when the glyphs are in another texture are note registered anymore with the cache and don't reference count their glyphs. Also got rid of unnecessary data members. Change-Id: I1544792d5d896c6de26e0838e4f80397759ea012 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Decouple QSGDistanceFieldGlyphNode from it's cache manager.Andrew den Exter2012-03-201-6/+5
| | | | | | | | | | | | | To implement a custom distance field glyph node currently it's necessary to also provide a duplicate implementation of QSGContext::createDistanceFieldGlyphCache() as the default implemention references the cache manager created by createGlyphNode(). By isolating references to the cache manager to just createDistanceFieldGlyph() cache it becomes possible to just overwrite createGlyphNode() and still use the default cache. Change-Id: I7261bdbf247966b55512d2671e2ee85239bcca05 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Use a single distance-field cache instance for all sizes of a given font.Yoann Lopes2012-03-191-3/+5
| | | | | | | | | | | Previously we had a different cache instance for each font size, but they all shared the same textures and positions. Only the glyph metrics were specific to each font size. The metrics for each font sizes are now calculated by scaling the metrics of the distance-field size (54px). Change-Id: I0d9016990dedd93318893506afb1dba7a5249e2e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Don't store duplicate glyph data in a distance field node.Andrew den Exter2012-03-141-37/+29
| | | | | | | | This saves at least 16 bytes per character and removes the need to copy data between representations. Change-Id: Ia8236207bdc4ed8292f7b4c72093ee02d13c0463 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Fix memory leak with the shared distance field glyph cache.Andrew den Exter2012-03-141-0/+1
| | | | | | | | | | | | | | | | | A new glyph node instance registers its owner element with its glyph cache which in the case of the shared distance field glyph cache connects a signal from the cache to a slot on the owner, changing the text creates a new node but destroying the old node didn't remove the connection causing them to accumulate over time. In the glyph node; unregister the owner element from the cache on destruction, and in the cache only connect an owner element the first time it is registered and keep a reference count so the items can be disconnected when registrations from all nodes have been cancelled. Change-Id: Ibf32a146e146dbbf4e0556d1bd756465bd8e45ba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-1/+1
| | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add support for shared glyph cacheEskil Abrahamsen Blomfeldt2012-01-241-4/+10
| | | | | | | | Use a shared graphics cache to back the distance fields if it is available. Change-Id: Id5e6e7a28e38e349d787e66016b2d0faebc791d7 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update copyright year in Nokia copyright headers.Jason McDonald2012-01-171-1/+1
| | | | | | | | Update copyright headers from before 2011, and a couple of new ones that were merged after the previous change to copyright headers. Change-Id: Ia76e08e2734afa4ef3f1207dbcda5ff3bc81b366 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Reference count glyphs in QSGDistanceFieldGlyphCache.Yoann Lopes2011-12-211-1/+4
| | | | | | | | | | | | | This was previously done only in the default cache implementation. It has been moved to the base class. releaseGlyphs() is called when a glyph is not referenced anymore by any node. Added a virtual function referenceGlyphs() that is called everytime glyphs are being used in a node. This function is called just before requestGlyphs(). Change-Id: If90f86c328c18ae2a5977847a6adf50b99ea1241 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Support for multiple textures in the distance field glyph node.Yoann Lopes2011-12-141-34/+114
| | | | | | | | Distance field glyph nodes can now have their glyphs in different textures. Change-Id: Ia4cdf12f8791246779c890e4ff224927bdfa1156 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* More distance-field cache refactoring.Yoann Lopes2011-12-141-91/+57
| | | | | | | | | | | | | | | | The distance field glyph node now uses preprocess(). The glyph cache is updated at that time, then when all the glyphs are ready the node's geometry is updated. addGlyphPositions and addGlyphTextures in QSGDistanceFieldGlyphCache have been renamed to setGlyphsPosition and setGlyphsTexture to reflect the fact that they can be used to update existing glyphs. For example when a glyph has moved to a different texture. When an existing glyph is updated, all nodes containing that glyph are invalidated and their geometries are reconstructed with the new values. Change-Id: I7758313155f48811e6027434e6c9a1c3df5dfab7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+316
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>