aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsgnode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Quick: Sanitize reading environment variables.Friedemann Kleint2015-10-261-1/+1
| | | | | | | | | | | | | | Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Move QSGAtlasTexture::qsg_envInt() to qsgrenderer.cpp for reuse as qt_sg_envInt() and add qt_sg_envFloat(). Change-Id: I4c93f16c228d4f537154f389a0fa1427654485f7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix typo in QSGGeometryNode documentation.Mitch Curtis2015-07-281-1/+1
| | | | | Change-Id: I0138aa116abdf890060e868fb95e866db1c7a398 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* QtQuick: Fix const correctness in old style castsThiago Macieira2015-05-131-7/+7
| | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c9589afabc7ade Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* 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>
* Avoid crashes when resetting the same material or geometry.Gunnar Sletta2015-01-261-3/+3
| | | | | | | | | We still need to call markDirty() though, to avoid changing behavior. Change-Id: I9df00e8d1cbe95bfae96b9ba9162bd6f226b5bdc Reviewed-by: Florian Hänel <florian.haenel@basyskom.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Remove bogus assert.Gunnar Sletta2015-01-051-2/+0
| | | | | | | | | | It is perfectly valid to reparent nodes to a parent that is part of an existing hierarchy. Change-Id: Icf2dbe6030d399047e7ebe735e3096d1a8cd8c0e Task-number: QTBUG-43278 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Traverse children correctly when reparenting.Gunnar Sletta2015-01-051-1/+1
| | | | | | | | | | | Since the children are being removed from the parent, using nextSibling on the child won't work. We need to extract the first child from the parent until there are no more children left. Change-Id: Ifca5f2760e2b1c7ba56c198623c5dc9d82c7560f Task-number: QTBUG-42530 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Fix typo in Q_ASSERT_X warning.Gunnar Sletta2014-11-011-1/+1
| | | | | Change-Id: I1415de93af35177fd643c21bcae2492a79187e50 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Remove the "groupNode"Gunnar Sletta2014-10-171-0/+15
| | | | | | | | | | | | | | | | | | We originally had the groupnode to simplify adding and removing clip / effect / opacity nodes to the item tree at a time when the renderer was a bit more trivial and only did a single pass over the tree during rendering. The runtime cost at the time was negligible. The QSGBatchRenderer has a bit more logic, so the extra node now costs a bit more. In addition to extra memory, we need to allocate shadow nodes for it and put those into the renderer's internal shadownode hash. This removal increases the performance of adding / removal of simple items by ~10% in addition to reducing the number of nodes in the scene graph by up to 1/3. Change-Id: I8cd64984f868d75820e25d33dfdbebd4d20651fe Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* 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>
* Improve support for node iteration in the internal APISimon Hausmann2014-08-081-0/+1
| | | | | | | | Added a new node visitor that allows easier traversal of the specialized node types such as the image or rectangle nodes. Change-Id: I45a7d3e1513b4a4db9d07998a6bcee9eba34044e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup: Remove remainders of dirty state usageSimon Hausmann2014-08-081-9/+3
| | | | | Change-Id: I4c379562af27a7eb2a47aee21090eff84fe84c55 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Enable QSG_RUNTIME_DESCRIPTION by default for debug builds.Gunnar Sletta2014-07-031-2/+5
| | | | | | | | | This can be quite helpful when doing scene graph debugging with QSG_RENDERER_DEBUG=dump or using qDebug() on nodes in general. Change-Id: I6328d3f2a0fad87161c386bed14408598c986dcb Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Clearly point out the distinction between GUI and Render threads.Gunnar Sletta2014-03-201-2/+17
| | | | | | | | This is something it is easy to get wrong, so try to make it as visible as possible. Change-Id: I2253ae63214cef0fb91c8b9423d7918ffc20e888 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update scenegraph docs to be in line with Qt 5.2 behavior changes.Michael Brasser2014-02-151-4/+1
| | | | | Change-Id: Id21386e6dc85bb7e109d9bd03e80f306c0a99733 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Mark DirtySubtreeBlocked correctly from OpacityNodeGunnar Sletta2013-10-031-2/+2
| | | | | | | | | In the edgecase where the opacity was exactly the OPACITY_THRESHOLD we would fail to mark the tree as dirty. This led to a crash in the renderer. Change-Id: I618910d0c792a215133598b6a87217be1f8729bc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add Q_UNUSED for reserved fields.Alan Alpert2013-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Prevents the following compiler errors with Clang src/quick/scenegraph/coreapi/qsggeometry.h:183:10: error: private field 'm_reserved_bits' is not used [-Werror,-Wunused-private-field] uint m_reserved_bits : 25; ^ src/quick/scenegraph/util/qsgsimplerectnode.h:66:11: error: private field 'reserved' is not used [-Werror,-Wunused-private-field] void *reserved; ^ src/quick/items/qquickclipnode_p.h:66:10: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field] uint m_reserved : 31; ^ src/quick/scenegraph/coreapi/qsgmaterial.h:143:11: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field] void *m_reserved; ^ src/quick/scenegraph/coreapi/qsgnode.h:267:10: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field] uint m_reserved : 31; Change-Id: I0ea00fbd4b45156dedabfd16a3cb3e5f6170f2ff Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* New scenegraph renderer and atlas textures.Gunnar Sletta2013-09-021-9/+20
| | | | | | | | | | | | | The renderer tries to batch primitives together where possible, isolate non-changing subparts of the scene from changing subparts and retain vertexdata on the GPU as much as possible. Atlas textures are crucial in enabling batching. The renderer and atlas texture are described in detail in the doc page "Qt Quick Scene Graph Renderer". Change-Id: Ia476c7f0f42e1fc57a2cef528e93ee88cf8f7055 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Support opt-in QSGNode descriptions without breaking binary compat.Gunnar Sletta2013-08-121-41/+50
| | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-05-281-3/+3
|\ | | | | | | | | | | | | | | Conflicts: src/quick/doc/src/appdevguide/porting.qdoc sync.profile Change-Id: Iec5516c596c3eca60a3e6ceb1d45f2a7a1595c12
| * Doc: corrections, spelling, and ListView requirements commentsDavid Fries2013-05-151-3/+3
| | | | | | | | | | | | | | | | | | | | From the ListView comment I thought the model had to be derived from QAbstractListModel, but that's not the case, QAbstractListModel will work just fine, it just doesn't support specific cases such as trees. Change-Id: I59305006540ddc049e276cf412571373cbfa6c67 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Make QSGNode and friends extensible via a d-pointerSean Harmer2013-04-161-0/+46
|/ | | | | | | | | | | | | Convert the private void *m_reserved to a d_ptr so as to make QSGNode inherited classes extensible without breaking binary compatibility. QSGNode and subclasses do not create a private instance by default. This is required by a follow-up commit where a new member needs to be added to QSGSimpleTextureNode. Protected ctors have been added to the superclasses of QSGSimpleTextureNode in the usual fashion. Change-Id: I30c5f5d057654145d87f18c34c5d13a6ff5f7b11 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Don't print leak warnings on exit by defaultGunnar Sletta2013-02-201-8/+13
| | | | | | Task-number: QTBUG-29780 Change-Id: I6f35253dbec6346af239c0ab341caad9f4f9b862 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Greatly improved Scene Graph Overview documentationGunnar Sletta2013-01-161-0/+13
| | | | | Change-Id: I86b6bb9007d268ec039614a1693ecd839901e6d9 Reviewed-by: Jerome Pasion <jerome.pasion@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>
* Improve on scenegraph documentation.Gunnar Sletta2012-06-081-21/+233
| | | | | | | Change-Id: Ib584a45454f6fd2a3c0bfb32a76b19839e4a2a09 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Remove unused performance flags.Michael Brasser2012-06-061-7/+2
| | | | | | Change-Id: I9a9111703e2480af02b1af7033ea6bb12e7a75a5 Reviewed-by: Glenn Watson <glenn.watson@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QtQuick: Fix string related warnings, single character strings.Friedemann Kleint2012-05-141-6/+6
| | | | | | | | | - Fix warnings about truncation from size_t to int (MSVC 2010, 64bit). - Remove single character strings. Change-Id: Iaf4406e4e04d55d2d8b762f3433269868842a6f9 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Added some documentatio notes on QSGNode::markDirty()Gunnar Sletta2012-05-051-2/+28
| | | | | | Change-Id: I631d85596113c38c9f19da9e65e9cae90c3bfebf Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Improved scene graph docsGunnar Sletta2012-04-301-0/+20
| | | | | Change-Id: I013e8eba2c13bd7abb01d2116af2e72c99ea5921 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-3/+3
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Small doc fixes.Michael Brasser2012-02-231-3/+3
| | | | | | | | | | Change-Id: I54ed2d0387b85ac853d94cfe716a1f6016986e2a Reviewed-by: Glenn Watson <glenn.watson@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>
* Added QSGRenderNode class.Kim Motoyoshi Kalland2012-02-201-7/+7
| | | | | Change-Id: I8c903cae490158b864af60f53c10c10f2faea7c0 Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* 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>
* Made QSGNode flags togglable and added StaticSubtreeGeometry.Kim Motoyoshi Kalland2011-12-141-22/+35
| | | | | | | | | | | | The UsePreprocess and ChildrenDoNotOverlap flags could previously only be set during node initialization. They can now be toggled. This change also introduces the StaticSubtreeGeometry flag which is meant to be used to indicate that all the nodes in the sub-tree have static matrices and vertex data. Change-Id: I3b182b81f7010aea636f8f654ef22dab19bc6b29 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+1264
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>