summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/qmaterial
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated classes and functionsPaul Lemire2020-02-111-90/+30
| | | | | | | Mostly old messaging API Change-Id: I17eb2206b2ede56d2f7d36375d5e711d6149019f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up includesMike Krus2019-10-011-3/+0
| | | | | | | | | Remove include statements for classes that are no longer used. Makes it easier to find remaining use cases that need addressed before complete removal in Qt 6. Change-Id: I60529ba1929ad64b162d3847d5df47cde2a60dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QTechnique to use direct syncPaul Lemire2019-09-191-6/+6
| | | | | Change-Id: I9e64880df50f10f7a1eebabe35c7c131044e1ab4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update QRenderPass to use direct syncMike Krus2019-09-191-7/+2
| | | | | Change-Id: Ie64d8cd74c8b28c43644f63993f0419ecb511d0e Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update QMaterial to use direct syncMike Krus2019-09-191-8/+3
| | | | | Change-Id: I3e2a687ab46196728083a91ce114066329e77278 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QEffect to use direct syncMike Krus2019-09-191-7/+2
| | | | | Change-Id: Idb1fcc4b13c310843cb479f7d3f02de7a89a784e Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Do direct notification of backend nodeswip/refactorMike Krus2019-08-281-65/+25
| | | | | | | | | | | | | | | | | Since aspect manager is now on main thread, we can directly update backend nodes safely. Track nodes which have changed properties and notify the backend nodes as part of the frame loop. This avoid allocating and delivering many change messages. To follow: - implement on all nodes - look at backend to frontend syncing - figure out what to do with non property messages (components added/removed, commands, ...) Change-Id: Ia0c442b0528e728c4324d168200bae021bc29266 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Tests: move TestArbiter into core commonPaul Lemire2016-11-181-0/+1
| | | | | | | | As it doesn't make sense to have it in render when mutliple submodules need that for their tests Change-Id: I853ca15a87051e4f63bfd7a24dae5e82014589b8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* tst_QMaterial: add bookkeeping tests for effect and parametersPaul Lemire2016-06-291-0/+68
| | | | | Change-Id: I5b9e8b736dd68fd3a5a81db53171e94d78666f22 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Shared node bookkeepingPaul Lemire2016-05-231-3/+3
| | | | | | | | | | | | Any time a property references a QNode there is a risk that the node gets destroyed and then the property is left pointing to a dangling pointer. To handle such cases, setters of such properties are able to use a helper that internally connect QObject::destroyed signal to a setter removal method. Change-Id: I42428c851d0e3d2d88ab0cf6a5b75605334ec648 Task-number: QTBUG-53456 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid crash in QML app shutdown and actually send events in C++ appSean Harmer2016-05-201-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic was such that in a C++ application the QNode::setParent() function would bail out early in a C++ application when called from the destructor of its parent object. This is because by the time the child is being deleted the parent is in QObjectPrivate::deleteChildren and therefore the QNode part of the object has already been destroyed. This led to the cast in the parentNode() == parent to fail, thereby exiting the functio early and never getting into QNodePrivate::_q_setParentHelper(). In the case of a QML application, the parent has a dynamic metaobject set by the QML engine. This resulted in the cast in QNode::setParent() succeeding and we called into _q_setParentHelper(). The logic in here resulted in a crash when called from a destructor because the child had already been removed from its parent's list of children. Thus when we called QObjectPrivate::setParentHelper(), this function ended up with an index of -1 for the child in its child list (i.e. not found) and it then tried to index into the children list with this index and we then crashed. The solution in this change is to not do the full logic in QNode::setParent() and _q_setParentHelper(). Rather, we simply remove the subtree at this node from the scene and we send node destruction changes to the backend. With this we avoid the crash of QML application shutdowns and we also make sure to correctly send the node destruction changes even in the case of a C++ Qt 3D application. The backend does not yet get an opportunity to process these final changes. This will be addressed in a follow up commit. As a result of these changes many unit tests began crashing. This is because the QNode dtor is now actually doing some work, rather than bailing out of that work early when the parent is no longer a QNode. This work involves mutating the QScene object which in the unit tests did not live longer than the QNode's to which it was associated with. The unit tests have been adjusted to ensure that the arbiter and scene objects remain alive longer than the QNodes they are being used to test. Task-number: QTBUG-42353 Change-Id: I197870f48fca30656bd85c4c51346d93403fba08 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Rename QNodeRemovedPropertyChange -> QPropertyNodeRemovedChangeSean Harmer2016-05-101-1/+1
| | | | | | Task-number: QTBUG-51494 Change-Id: I1c7f1c680bc18c6201b790e96dc4023564837122 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename QNodeAddedPropertyChange -> QPropertyNodeAddedChangeSean Harmer2016-05-101-5/+5
| | | | | | Task-number: QTBUG-51494 Change-Id: I7f59bad66eb086e2249c580be2fd9f4bad159eb3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNodePropertyChange -> QPropertyUpdatedChangeSean Harmer2016-05-101-9/+9
| | | | | | Task-number: QTBUG-51494 Change-Id: Ic326499f80b5a91b2d19c09770de926f220cc805 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename NodeAdded/NodeRemoved ChangeFlagsSean Harmer2016-05-101-4/+4
| | | | | | | | | | | | | | | | These are not just for adding/removing QNodes. They are more general in purpose and are used for adding/removing values to/from collection based properties e.g. QVector<MyValue>. The addition/removal of QNode pointers (which we translate to QNodeIds) is just the most common case. If Q_PROPERTY/QObject gains support for properties of collections and the typical operations on them, then we will be able to catch and handle most uses of these change types in QNodePrivate just like we do for setting a Q_PROPERTY. Task-number: QTBUG-51494 Change-Id: I707de1647554a61accf81dc79bfe58b289dbff7b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename NodeUpdated ChangeFlag to PropertyUpdatedSean Harmer2016-05-101-8/+8
| | | | | | | | This more correctly reflects the semantic meaning. Task-number: QTBUG-51494 Change-Id: I3a230e959ea007f1d19808eae73b5d95b6f06514 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Q_NULLPTR -> nullptrSean Harmer2016-05-011-2/+2
| | | | | | Task-number: QTBUG-52736 Change-Id: I58f9cbcdf018e7b672d33dd865067485412b79fe Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNodeAddedChange: contains a QNodeIdTypePairPaul Lemire2016-05-011-0/+3
| | | | | | | That allows to know what type of node was added Change-Id: I89829794655fac81bdc9840ae83473640b0a384a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QNodeCreation overhaulPaul Lemire2016-04-291-0/+14
| | | | | | | | | | | | | | | | | | When a node has its parent set from NULL to some valid parent it sends a QNodeCreatedChange. The new parent also subsequently receives a QNodeAddedChange telling him that a child was added to its children property. When a node with a valid parent changes parent to another valid parent, it sends a QNodeRemovedChange to the old parent and a QNodeAddedChange to the new parent. When a node with a valid parent has its parent set to NULL, it first sends a QNodeRemovedChange to the old parent followed by a QNodeDestroyed change. When a node is destroyed, prior to destruction it sets its parent to NULL, which sends notifications as explained above. Change-Id: Id99727542367797577c2bbb108580dfca902e776 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Strip out cloning subsystemSean Harmer2016-04-291-16/+26
| | | | | Change-Id: I4def54a11de0f9c676ef6b2d7bd8e723ded25ab9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Material use new added/removed change typesSean Harmer2016-04-271-8/+11
| | | | | Change-Id: I107fe1a4fcb74660454c8917d1a4bda94891bd84 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNode: make cleanup a private slotPaul Lemire2016-04-231-10/+0
| | | | | | | | | | QT3D_CLONEABLE now implements a default dtor that calls _q_ cleanup QT3D_CLONEABLE_CUSTOM_DTOR is used for classes that really need to implement their own dtor but they need to invoke _q_cleanup manually Change-Id: I2937a3b9edeb5a763749f0044360d78ab4461a5e Task-number: QTBUG-51464 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move defaults and geometries out of Qt3DRender and into Qt3DExtrasPaul Lemire2016-04-232-15/+15
| | | | | | | QBoundingVolumeDebug has been disabled for now. Will be re-enabled later on. Change-Id: Id6b0abab2ec2aa697330bd20d782f9d104d25d50 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QScenePropertyChange -> QNodePropertyChangeSean Harmer2016-04-211-12/+12
| | | | | | | Trying to unify naming of change types. Change-Id: I0bfca0b7ba5adeaaa6145f75ddb41731f76adc09 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QVectorize materialsystem classesWieland Hagen2016-04-161-2/+2
| | | | | Change-Id: I262f3ab1136fcb60066d623c44aedb6791fc18af Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QRenderState cleanupPaul Lemire2016-03-201-3/+4
| | | | | | Change-Id: Ie4ae9a2d17c05594dd2bddde85abf73f7ffbd686 Task-number: QTBUG-51430 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QAnnotation changesFranck Arrecot2016-03-171-4/+4
| | | | | | Task-number: QTBUG-51454 Change-Id: Iee08f6b1be39894c40926afb20e003d46bc735f4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QTechnique renamingRobert Brock2016-03-081-1/+1
| | | | | | | | | | annotations -> filterKeys addPass -> addRenderPass removePass -> removeRenderPass Change-Id: Ica1731ee3100b249e4fef04f45c0e6326732d644 Task-number: QTBUG-51458 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove ParameterMappingPaul Lemire2016-02-261-18/+0
| | | | | | | | | | | | | | * Bindings are now entirely deduced from shader introspection * Modified the BackendNodeDirtyFlags to remove the class at this prevents the operator~() to be called * Make the Renderer loop check for the ComputeDirty flag and don't unset it if set Note: uses a hack to reset m_changeSet in performCompute as right know we are sometimes missing the markDirty(ComputeDirty) set by the ComputeJob nodes. Will be sorted out later. Change-Id: Ic4fa71ecf01b625e885a58a66278387bf5b36339 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unify license header usageAntti Kokko2016-01-261-17/+9
| | | | | | | | Updated license headers to use new GPL-EXCEPT header instead of LGPL3 one (in those files which will be under GPL 3 with exceptions) Change-Id: I930c6234bfe720d38c596bbc3d1f39be75a7328b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Rename Renderer -> Render throughoutSean Harmer2015-10-192-14/+14
| | | | | | | | This is for consistency between the C++ namespaces and QML imports and with the other aspects. Change-Id: I73392f138b4e519b12888f52530123e3d0ba445e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QMaterial: remove NodeAdded/Remove notifications on EffectPaul Lemire2015-10-141-9/+9
| | | | | | | | | | Rely on the parent being set for inline declaration and the emit effectChanged to automatically send notifications. Updated unit tests accordingly. Change-Id: I7304309ea248da5e15db3dea4d556162af5e940e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Unit Tests: use the commons TestArbiter/PostmanPaul Lemire2015-10-142-78/+4
| | | | | Change-Id: Ic61ab8b30414297a4f65ee0695e91bfa578af5a6 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Move Qt3DCore into Qt3DCore namespaceSean Harmer2015-10-131-54/+54
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move Render aspect into the Qt3DRender namespaceSean Harmer2015-10-131-44/+44
| | | | | | | Updated examples and tests accordingly. Change-Id: I8848a88472de2302aa072fa11f21ea934672b7e6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QMaterial: unit test notifications on effect changePaul Lemire2015-08-071-0/+51
| | | | | | Change-Id: I35cd64157be69ea50c76c2eab6354708a99448df Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QMaterial units: fix .proPaul Lemire2015-08-071-1/+1
| | | | | Change-Id: I6f3ffaf1deeec5ac048b55bc35eb05880098c6b5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add unit test for QMaterialPaul Lemire2015-07-282-0/+494
Covers also QEffect, QTechnique, QRenderPass, QShaderProgram, QParamater as these are nested elements that may affect a QMaterial Change-Id: Id54e6f2d7455c5c2cbf08c01e3b72a355153b901 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>