summaryrefslogtreecommitdiffstats
path: root/src/core/qchangearbiter_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Do direct notification of backend nodeswip/refactorMike Krus2019-08-281-1/+9
| | | | | | | | | | | | | | | | | 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>
* Remove the Aspect ThreadPaul Lemire2019-08-071-2/+2
| | | | | | | | | | | | | | | | | | This now makes the Qt3D simulation loop run in the Main Thread. In theory having the Aspect Thread allowed Qt3D to continue rendering even if the main thread got locked. In practice however this leads to a large amount of complexities in the Qt3D implementations and provides little value as in most cases blocking the main thread would block animations driven by frontend nodes. Removing the Aspect Thread will allow to remove the backend tree copies each aspect had to make which will allow to reduce memory. In addition, getting direct access to frontend nodes, will now be possible without introducing races which should allow to make more optimizations and reduce latencies on some operations. Change-Id: I80e4cd6427de06ddedfa1bb50d40710b91867b24 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Port from QMutex::Recursive to QRecursiveMutexMarc Mutz2019-07-311-1/+1
| | | | | | | | Also port from QMutexLocker to std::lock_guard, as the former will not support QRecursiveMutex going forward. Change-Id: I65e14492fc0583e5d0018aef64e18db8a6023dc8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Scene3D: Revise render loop and synchronizationAnton Kreuzkamp2019-05-281-1/+4
| | | | | | | | | | | | | | | | | | Before, the Scene3DRenderer marked the sg-node dirty in render, which would then already mark it dirty for the next frame. This only works as long as we always render, which is undesireble in some cases. fa12f14b2 changed rendering to not always happen anymore. Thus, that commit broke rendering under certain circumstances. Now, Scene3DRenderer listens on a signal from the QChangeArbiter about new pending changes. In reaction to this signal, we set an internal dirty-flag in Scene3DRenderer. Only if this flag is set, synchronization and rendering will happen on the Qt3D side. Change-Id: I3b33faa5d60c270bd9b903b0e34c8fa24e2e29fd Task-number: QTBUG-69985 Task-number: QTBUG-72923 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Switch export macros to standard formKai Koehne2019-04-021-2/+2
| | | | | | | | | | | | Qt expects the export macros to have Q_ prefixes, otherwise the symbol versioning script won't find them and mark them. Also remove non-exising QT3DLOGIC_PRIVATE_EXPORT macro from src/doc/qt3d.qdocconf Task-number: QTBUG-74752 Change-Id: I71b9e85ff09c002fb283824aa51a5a8f50e937f4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Replace Q_DECL_FINAL with finalKevin Funk2017-09-251-2/+2
| | | | | Change-Id: Ia80d1cb9cc96d76f8b367caa725c59a70ae0a4d5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-3/+3
| | | | | Change-Id: I92c955068e233c50043ad7d06a32300dd386c24d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch '5.8' into 5.9Sean Harmer2017-04-021-8/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/jobs/qthreadpooler.cpp src/core/nodes/qcomponent.cpp src/core/qpostman.cpp src/core/qscene_p.h src/core/services/qservicelocator_p.h src/input/frontend/qinputaspect.cpp src/plugins/sceneparsers/assimp/assimpimporter.cpp src/plugins/sceneparsers/assimp/assimpimporter.h src/plugins/sceneparsers/gltf/gltfimporter.h src/plugins/sceneparsers/gltf/gltfio.cpp src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp src/quick3d/imports/render/qt3dquick3drenderplugin.cpp src/quick3d/quick3dextras/qt3dquickwindow.cpp Change-Id: I3566708c6f74a34959e7bb64b64e93647ca3f699
| * Fixes includes to comply with coding conventions for Src/CoreRobert Brock2017-03-311-8/+9
| | | | | | | | | | | | | | | | Reordering the header includes to comply with Qt coding conventions Task-number: QTBUG-56185 Change-Id: I3943678c183c4ef46d403e0fff878c3cad964dfa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Allow to filter change events based on a track propertyPaul Lemire2017-01-251-7/+1
|/ | | | | | | | | | | * QNode now has a PropertyTrackMode property * QScene contains a table of PropertyTrakcMode data * QPostman checks if a QNode is supposed to receive a change based on the information available in the QScene property track mode table * Unit tests updated and added for QPostman Change-Id: I3b88037a949020a917c81817f1451ef532065982 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* const QNodeId & -> QNodeIdPaul Lemire2016-02-221-2/+2
| | | | | Change-Id: Ia672918cbae3b950e20e68bfbfd6982676a5981e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unify license header usageAntti Kokko2016-01-261-11/+14
| | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I8eac0cd6bbc276a56df487249cc459c0d4fab165 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Move Qt3DCore into Qt3DCore namespaceSean Harmer2015-10-131-8/+8
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add "We mean it" warnings to private headersSean Harmer2015-10-131-0/+11
| | | | | Change-Id: Ic4a69123255c33990765ea3601e01914c2d8cb70 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QChangeArbiter/QPostMan: batch frontend changesPaul Lemire2015-07-121-6/+14
| | | | | | | | | - Updated unit tests - Added QAbstractPostman and QAbstractArbiter as they are more than QObserverInterfaces but still need to be easily testable. Change-Id: I0fc2ce48031eecc9bf893798650ef68e9d7d8bb7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QScene is now privatePaul Lemire2015-07-061-4/+4
| | | | | | | QSceneInterface was removed as it didn't make sense anymore Change-Id: I1110d1dcef72bd7654d773370ab304ac06515037 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter/QLockableObserverInterface: sceneChangeEventWithLock overloadPaul Lemire2015-07-041-0/+1
| | | | | | | | | | takes an std::vector<QSceneChangePtr> to soon allow efficient submission of change batches. Note: there's no real need for a similar overload of sceneChangeEvent yet. Change-Id: Id76eb77a0b6b2f1308a72d85d65948a3fb411951 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Copyright header change.Mika Salmela2015-02-091-19/+14
| | | | | | | | As for preparation for Qt5.5 release the copyright header is updated to correspond the current license requirements. Change-Id: I36632918b66f455539453b42c369689fb11298ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Introduce QLockableObserverInterfaceKevin Ottens2015-02-081-4/+4
| | | | | | | | | We introduce QLockableObserverInterface as an intermediate interface before the QChangeArbiter and depend on that interface whenever possible. Change-Id: Ic92efec8d68c88344bb43f8fc7dc10b1212180af Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename ChangeQueue -> QChangeQueueSean Harmer2014-12-311-10/+10
| | | | | Change-Id: I2f53dfb314e3e4b12bf763dc4b7c43608374bc1c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove some redundant typedefsSean Harmer2014-12-311-4/+0
| | | | | Change-Id: Id7674e90935073dd4a6756c71545f7fde93bbfde Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Optimize: Prefer QVector over QList for QObserverList.Milian Wolff2014-12-091-1/+1
| | | | | | | | | | | | | | This list stores QObserverPair, i.e. a pair of a QFlags and pointer, which by definition is larger than a pointer. Thus QList allocates each node on the heap, whereas a QVector can use a single block of memory. This reduces allocations and improves iteration speed, as this reduces the cache misses incurred with QList and pointer chasing. Change-Id: Ib3a9fbaa099cb41785086857e856072b74211605 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QNodeUuid to QNodeIdSean Harmer2014-11-191-4/+4
| | | | | Change-Id: I0450a4d4708af1ccd3d4c8f2ddc5c9a5c9deca27 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Optimize: use std::vector instead of QVector for the change queues.Milian Wolff2014-11-051-1/+1
| | | | | | | | | | | Note that QVector::clear() frees memory, as does resize(0) now apparently. This triggers repeated allocations after we distributed the changes. Using std::vector instead, we can reuse the memory leading to a noticeable performance improvement. Change-Id: Ib08795a7ba3f893c13dad29f50641e4e2dc924e4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Release the TLS for the main thread's change queue in the arbiterSean Harmer2014-11-031-0/+1
| | | | | | | | | This solves the QFontCache shutdown bug. Now I think all that is left it to shutdown the render submission thread cleanly. Task-number: QTBUG-42353 Change-Id: If17c62680302cffa266782261400ae44bfbac612 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* More work towards a clean shutdownSean Harmer2014-11-031-3/+3
| | | | | | | | | | | | | | | | | | | The QAspectJobManager doesn't really need to be public now I think but as it still is let's make the base class have it's own private class that inherits from QObjectPrivate. The ThreadWeaver threads all get cleaned up cleanly upon shutdown. When trying with cylinder-cpp with all the rendering stuff in main() commented out, we consistently get the crash in QFontCache. With the rendering stuff enabled there is also an assert inside the swapbuffers() call. This is because the render thread is not cleanly shutdown yet. The QFontCache crash is something to do with freeing thread-local storage. I will continue to investigate. Change-Id: Ib3ad3ea04ae4859d27f0dd4604b00bc5a38859a1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNodeUuid: typedef for QUuidPaul Lemire2014-11-021-4/+4
| | | | | | | Should allow to easily replace QUuid by a custom quint64 based struct Change-Id: Ib4ba57efd2e070317aa3417b37ce091f2b4779a0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QJobManagerInterface renamed to QAspectJobManagerInterfacePaul Lemire2014-10-181-3/+3
| | | | | Change-Id: I87b75ed9702240e1db46cf1c5ee8cfe3bb2ea91e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter and Observers/Observables made privatePaul Lemire2014-10-171-8/+57
| | | | | | | | | Note: the Renderer aspect uses all those private headers, when we introduce the QBackendNode class that will be a wrapper around those, we will be able to remove those private includes. Change-Id: I6240f754e6da251da158cafcf76029ae59000e05 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter/QScene refactoringPaul Lemire2014-09-301-8/+2
| | | | | | | | | | | | | | | Added nodeIfFromObservable method in QSceneInterface/QScene. Needed when the QChangeArbiter needs to find the QNode target from an Observable. QChangeArbiter/QPostman is passed a QObserverInterface, makes it easier to unit test. QPostMan sends change to QNode::sceneChangeEvent. This method should be overloaded by subclasses of QNode. Change-Id: If85fcb034b3fcdace82e63149ca7684d9d888d1c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter overhauledPaul Lemire2014-09-291-2/+8
| | | | | Change-Id: I46e81f4f428171db5304d11985ddbbb78ab09030 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed QFrontendSceneObserver to QPostmanPaul Lemire2014-09-281-0/+2
| | | | | | | | It is a QObserverInterface, created in the main thread and set in the QChangeArbiter directly without passing by the QAspectManager. Change-Id: Icc6065c26d6b1c7557d07cb057469a0309eed18b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter can register/unregister observers from a node QUuidPaul Lemire2014-08-131-1/+2
| | | | | Change-Id: Ie608e5be3a3c26bb59cd741ab9e3d3cf9fb3d94e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QSceneObserverInterface registered to QChangeArbiterPaul Lemire2014-07-251-0/+2
| | | | | | | | | Registration occurs in QAspectManager::registerObserver just after the aspect is initialized. QSceneObserverInterface instances are unregistered at shutdown of the QAspectManager. Change-Id: I8cbe575454b13c262885d9965f35665ab0ff17a3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter d-pointeredPaul Lemire2014-07-091-0/+97
Change-Id: Ic33650363629860ff23dfb048fa831dccf47b516 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>