aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsgnode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove QSGSimpleMaterialLaszlo Agocs2020-04-071-1/+1
| | | | | | | | | | And port the graph example to QSGMaterial and the RHI. We will not anymore add a direct OpenGL path (that would mean using QSGMaterialShader) for the example because the upcoming purge renders that useless anyway. Task-number: QTBUG-82988 Change-Id: I137575ed5df45b6bfc34a11d73dc5100945081c5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-121-3/+0
|\ | | | | | | | | | | | | Conflicts: src/qml/types/qqmlbind.cpp Change-Id: Ib992d1a7ac6c1a96d39819be6f23955dc31b44b2
| * Avoid initializing QFlags with 0 or nullptrAllan Sandfeld Jensen2019-11-221-3/+0
| | | | | | | | | | | | | | | | | | It is being deprecated. Change-Id: I844bd92af85bc53a8fc0371408d05277bd49f511 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix Qt6 build in preparation of qt5 submodule updateAlexandru Croitor2019-07-081-9/+9
|/ | | | | | | | Fixes the QTextStream usages. Change-Id: I0c009a82fb644a9f3c3d42ec410d18b680977f23 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-1/+1
| | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-261-14/+1
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-41/+41
| | | | | | | | | | | | | 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>
* doc: Add documentation for undocumented thingsMartin Smith2018-02-141-0/+8
| | | | | | | | | | There were several undocumented elements in the API that clang-qdoc warned about. These are now documented, although original authors might want to contribute better descriptions. A few uses of a macro "qdoc" were corrected to Q_CLANG_QDOC. Change-Id: I4e1d4c5f3266a334d7286e55ed1b113319de2273 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix uninitialized member QSGClipNode::m_is_rectangularJüri Valdmann2017-09-201-0/+3
| | | | | | | Task-number: QTBUG-62112 Change-Id: I8943baf6bd5261b91d8960bb227992b56b720554 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add QDebugStateSaver to operator<<(QDebug, const QSGRootNode)Jesus Fernandez2017-07-271-0/+1
| | | | | | | | | CID 54558 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE) 4. end_of_path: Changing format state of stream d for category basefield without later restoring it. Coverity-Id: 54558 Change-Id: Iad6e6103684c57d3ab98e78e7c91e23731632913 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: fix some typos in qsgnode.cppJüri Valdmann2017-05-041-6/+6
| | | | | Change-Id: I9ce8f7e9dffbf7fd5280841bbe46d07eaaf9e235 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: add new enumeration descriptionsNico Vertriest2017-03-301-0/+2
| | | | | | | | | | | qsgmaterial.cpp:416: warning: Undocumented enum item 'DirtyCachedMaterialData' in QSGMaterialShader::RenderState::DirtyState qsgmaterial.cpp:416: warning: Undocumented enum item 'DirtyAll' in QSGMaterialShader::RenderState::DirtyState qsgnode.cpp:104: warning: Undocumented enum item 'DirtySubtreeBlocked' in QSGNode::DirtyStateBit qsgnode.cpp:139: warning: Undocumented enum item 'RenderNodeType' in QSGNode::NodeType qsgengine.cpp:75: warning: Undocumented enum item 'TextureIsOpaque' in QSGEngine::CreateTextureOption Change-Id: Ia51d414151e42eddc5fa1198d3bad3ecbc20e30a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove documentation references to internal functionsKavindra Palaraja2017-01-131-7/+0
| | | | | | | | | | QSGOpacityNode::combinedOpacity() and QSGTransformNode::combinedMatrix() are intended to be internal. Task-number: QTBUG-53897 Change-Id: Icc73476eb8af5cdc673f7ce9bacd25ecc75202b5 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* Fix enums in QSGGeometryLaszlo Agocs2016-10-121-1/+1
| | | | | | | | | | | | | | | | Minor fixes based on comments from the 5.8 API changes review: Revert to using Qt-style enum values (POSITION -> PositionAttribute). Use ByteType, FloatType, etc. instead of TypeByte, TypeFloat, ... Add comments about magic GL values. Add missing docs for Attribute::createWithAttributeType(). Change-Id: I1b8242efd3936f000ce8df6c11ff9ab7affb5713 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Quick: use const (and const APIs) moreAnton Kudryavtsev2016-08-121-1/+1
| | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I270cdc6eb8c5946f5c20b379bbb7c60f0ba518eb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add cross-backend simple rect, texture, and ninepatch nodesLaszlo Agocs2016-06-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QSGSimpleRectNode is deprecated -> use QSGRectangleNode via QQuickWindow::createRectangleNode() instead. QSGSimpleTextureNode is deprecated -> use QSGImageNode via QQuickWindow::createImageNode() instead. The OpenGL version of the simple rectangle node is switched over to the vertex color material instead of flat, to allow for better batching. Use the same concept for nine patch nodes. The "style" node from Quick Controls 1 is now QSGNinePatchNode in order to provide a proper cross-backend solution which is already necessary due to the software backend, but now generalize it to apply to the accelerated backends with proper materials as well. QC can now simply call createNinePatchNode() without further ado. Also fixes a bug with the D3D12 texture material not enabling blending when needed. When it comes to the internal class names, QSGRectangleNode and QSGImageNode get the Internal prefix in the adaptation layer in order to differentiate from the public API. This involves quite a lot of renaming, but results in a nice and clean public API. Change-Id: Iddf9f9412377843ea6d652bcf25e68d1d74659ea Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-3/+3
|\ | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp Change-Id: I26d6435a29cac3840bb567ade5149c2562a94bf9
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-101-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of 0e053528 was reverted in the merge, about lastTimestamp. It will be applied later in separate commit. qmltest::shadersource-dynamic-sourceobject::test_endresult() was blacklisted on linux. Conflicts: .qmake.conf tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp tests/auto/qmltest/BLACKLIST tests/auto/qmltest/qmltest.pro Task-number: QTBUG-53590 Task-number: QTBUG-53971 Change-Id: I48af90b49a3c7b29de16f4178a04807f8bc05130
| | * Fix spelling error in QSGNode docsMitch Curtis2016-06-081-3/+3
| | | | | | | | | | | | | | | Change-Id: I9ece132b87a8de06924e71b6f5fc552a14dea336 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Make matrix and clipList setters' appearance more internalLaszlo Agocs2016-05-311-0/+12
| | | | | | | | | | | | | | | | | | | | | And start using them from the batch renderer as well. Change-Id: I20adc3962b06ac712267dc2be95e9e28cea82e21 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Enable building Qt Quick module with QT_NO_OPENGL definedAndy Nichols2016-03-221-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the Qt Quick module depends on either the OpenGL or OpenGLES headers being available at build time. Since we are adding support for adaptations that do not depend on OpenGL, it should be possible to build Qt Quick in environments that do not have OpenGL development headers. This does present many challenges though because in some cases GL types, and classes that require OpenGL are part of the public APIs. However since these classes were never available when QT_NO_OPENGL was defined, it should be possible to redefine the function signatures under this scenario, since it's not possible to break binary compatibility if there never were any binaries to break compatibility with. One of the bigger changes that was necessary to facilitate this change is creating interfaces out of QSGContext and QSGRenderContext. Here the default behavior was usage of OpenGL directly, even though subclasses could override all OpenGL usage. Making them interfaces should bring QSGContext and QSGRenderContext more in line with the other classes present in the adaptation layer. Change-Id: Iaa54dc0f6cfd18d2da1d059548abf509bd71f200 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* / 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>
* 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>