summaryrefslogtreecommitdiffstats
path: root/src/core/qchangearbiter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '5.8' into 5.9Sean Harmer2017-04-021-9/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+10
| | | | | | | | | | | | | | | | 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-2/+4
|/ | | | | | | | | | | * 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>
* QChangeArbiter: check delivery flag of changesPaul Lemire2016-07-041-1/+2
| | | | | Change-Id: I4137825343e8d63a8b81027653755cffc83a3dfe Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Change arbiter checks DeliveryFlagsSean Harmer2016-05-101-1/+1
| | | | | | | | | For now we keep the existing behaviour. Backend nodes are always notified and frontend nodes iff Nodes flag is set. Task-number: QTBUG-51494 Change-Id: I3bd1cc30a8d0ad928470dfe6df20681589693364 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename ObserverType to SenderType in QSceneChangeSean Harmer2016-05-061-1/+1
| | | | | | | | Uses the more common BackendNode naming to make it clearer. Also updated corresponding function and member variable names. Change-Id: Idcdd034d3cabb761e6b6152eb1397d2c3fc5ef46 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Remove NodeAboutToBeDeleted change type enum valueSean Harmer2016-05-051-2/+1
| | | | | | | | This is not needed and was not used anywhere in any meaningful way. Task-number: QTBUG-51494 Change-Id: I6b09fb248f48ec844bfebcf2c0013f0bf8478f18 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Q_NULLPTR -> nullptrSean Harmer2016-05-011-7/+7
| | | | | | Task-number: QTBUG-52736 Change-Id: I58f9cbcdf018e7b672d33dd865067485412b79fe Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QChangeArbiter: eradicate remaining Q_FOREACH loopsMarc Mutz2016-03-011-4/+4
| | | | | | | | | | | ... by replacing them with C++11 range-for loops. Saves 0.8KiB in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I9dd8374fbd827b7bc2babf483f6df565967e68a7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove code duplication in QChangeArbiter::distributeQueueChanges()Marc Mutz2016-02-291-25/+9
| | | | | | | | | | | | | | | | | | The switch cases were identical except for one additional statement in one of them. Merge them, wrapping said additional statement into an if instead. Since the switch is then trivial, remove it. Also port from contains()/op[], which looks up twice and detaches, to constFind(), and from Q_FOREACH to C++11 range-for. Saves 1.7KiB (0.6%) in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I45344e81efbf7c29a578e8657fcb288fcf6b5d73 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* const QNodeId & -> QNodeIdPaul Lemire2016-02-221-2/+2
| | | | | Change-Id: Ia672918cbae3b950e20e68bfbfd6982676a5981e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/doc/src/qt3dcollision-module.qdoc src/render/frontend/qcamera.cpp src/render/frontend/qcameralens.cpp Change-Id: I8a0ae250a6b8e065a1ef3c817968ebb7ef23b20d
| * Doc: Mark the rest of the private classes \internalTopi Reinio2016-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | Private headers are no longer part of the documentation build, so the documentation for these classes triggers a lot of QDoc warnings. Avoid this by replacing the QDoc comment blocks '/*!' with standard C comments. Change-Id: Id7aac9354e12ba2b7a62f84b947a5f6f38702c6d 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>
* Make QSceneObserverInterface privateKevin Ottens2015-12-171-1/+1
| | | | | Change-Id: I98454ea6ed5bd5bbfed550317fedbf8ee47a1f8f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move Qt3DCore into Qt3DCore namespaceSean Harmer2015-10-131-3/+3
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.5' into devAndy Nichols2015-08-171-5/+13
|\ | | | | | | Change-Id: Id0a3559e001631a077bc1c3a17c30a48599eecb9
| * QChangeArbiter/QPostMan: batch frontend changesPaul Lemire2015-07-121-2/+3
| | | | | | | | | | | | | | | | | | - 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-3/+3
| | | | | | | | | | | | | | 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/+7
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-291-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/render/defaults/qforwardrenderer.cpp src/render/doc/qt3drender.qdocconf Change-Id: I1c4a15d2b57980dca82fa420ab6ef8c48c049a2c
| * Make QAspectJobManager and base class privateSean Harmer2015-06-101-1/+1
| | | | | | | | | | | | | | | | Prevents leaking of private headers and allows use of QT3DCORE_PRIVATE_EXPORT for use with the job manager unit test. Change-Id: I7f0c2b2e27e88eee6cb686f5ae55c78b73ea27d3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-03-171-8/+7
|\| | | | | | | | | | | | | Conflicts: src/core/doc/qt3dcore.qdocconf Change-Id: I3e0b4288daf6be5cd0d274ab34223e7a9ea2ec18
| * Doc: Review doc Qt3DNico Vertriest2015-03-161-2/+2
| | | | | | | | | | | | Task-number: QTBUG-44180 Change-Id: Ia5ce031397f9b03c5ba692aa30b6097dc60e59e3 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
| * Fix MSVC warnings.Friedemann Kleint2015-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | aspects\qabstractaspect.cpp(50) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data resources\qframeallocator.cpp(276) : warning C4267: 'argument' : conversion from 'size_t' to 'uint', possible loss of data resources\qframeallocator.cpp(284) : warning C4267: 'argument' : conversion from 'size_t' to 'uint', possible loss of data qchangearbiter.cpp(108) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data qt3d/src/render/backend/jobs/renderviewjobutils_p.h(64) : warning C4099: 'Qt3D::Render::ShaderUniform' : type name first seen using 'struct' now seen using 'class' Change-Id: I055f2021cbecf0765a811aedd87eb2cee97e6431 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * ChangeArbiter/SceneChange: use id as change subjectPaul Lemire2015-02-281-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | Instead of having a QNode* or QObservable as the subject of a change, we use it's unique NodeId instead. That will prevent the ChangeArbiter from trying to distribute changes by looking at a QNode/QObservable id when the QNode/QObservable might have been destroyed in the meantime. Change-Id: Ia419d5b841434fd65522c8c65de552089cfe97cf Task-number: QTBUG-44628 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Doc: link and qdoc errors Qt3DNico Vertriest2015-03-111-1/+1
|/ | | | | | | Task-number: QTBUG-44180 Change-Id: Ic798dee5d33dbf18dbc9d978a0f07217895a30ee Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.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>
* Rename ChangeQueue -> QChangeQueueSean Harmer2014-12-311-13/+13
| | | | | Change-Id: I2f53dfb314e3e4b12bf763dc4b7c43608374bc1c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add \inmodule for QChangeArbiter and add namespaceSean Harmer2014-12-221-17/+16
| | | | | | | Also make comment format more consistent by removing leading asterisks. Change-Id: Iacd355add1faf8756a2d95701239363969d18d23 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Change uuid -> id as it really isn't universally unique any longerSean Harmer2014-12-191-2/+2
| | | | | Change-Id: If25d1f71dfff62009db1cd4f72a1b0725b4c6d14 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Rename QNodeUuid to QNodeIdSean Harmer2014-11-191-3/+3
| | | | | Change-Id: I0450a4d4708af1ccd3d4c8f2ddc5c9a5c9deca27 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* corelogging.h -> corelogging_p.hSean Harmer2014-11-181-1/+1
| | | | | Change-Id: I694d3d044293c321cbede2cbe82d401239b26a30 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-3/+16
| | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | 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-6/+6
| | | | | | | Should allow to easily replace QUuid by a custom quint64 based struct Change-Id: Ib4ba57efd2e070317aa3417b37ce091f2b4779a0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Optimize QChangeArbiter::distributeQueueChanges.Milian Wolff2014-10-291-2/+3
| | | | | | | | | | | Instead of popping the QVector from the start, we just iterate efficiently over it and then clear the whole queue in one go. This removes the number one hotspot in the upcoming bigscene-cpp example for me. Change-Id: I93d1254fd5d3f3a3b211aa308ab9b26828d30858 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QJobManagerInterface renamed to QAspectJobManagerInterfacePaul Lemire2014-10-181-2/+2
| | | | | Change-Id: I87b75ed9702240e1db46cf1c5ee8cfe3bb2ea91e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Further refactoring of QAbstractAspectPaul Lemire2014-10-171-4/+0
| | | | | | | | | | | It now inherits of QSceneObserverInterface directly, this will allow to ease the backend node creation process It provides create/get/destoy methods to create a backend element from a frontend one using registered functors. Change-Id: I7ff392288264df077d99c5ede4a55b871a67d494 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter and Observers/Observables made privatePaul Lemire2014-10-171-75/+43
| | | | | | | | | 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>
* Clean up the TLS in the QChangeArbiterSean Harmer2014-10-121-0/+13
| | | | | Change-Id: I38f19f17eb88d725752fe71979b9a220bb8de9be Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QChangeArbiter/QScene refactoringPaul Lemire2014-09-301-3/+4
| | | | | | | | | | | | | | | 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>
* Getters for QPostman and QScene in QChangeArbiterPaul Lemire2014-09-301-0/+12
| | | | | Change-Id: I789b82171357d2a07b4da63c740eb368935aeb0d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter overhauledPaul Lemire2014-09-291-60/+32
| | | | | Change-Id: I46e81f4f428171db5304d11985ddbbb78ab09030 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed QFrontendSceneObserver to QPostmanPaul Lemire2014-09-281-0/+11
| | | | | | | | 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>
* Allow observers + scene observers to monitor NodeCreated/NodeDeletedPaul Lemire2014-08-141-33/+22
| | | | | Change-Id: Ie8e2d662d7b2bd7ef4335bdb7fcc3eb54572448a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter can register/unregister observers from a node QUuidPaul Lemire2014-08-131-5/+22
| | | | | Change-Id: Ie608e5be3a3c26bb59cd741ab9e3d3cf9fb3d94e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter: SceneObservers notified of NodeCreated/DeletePaul Lemire2014-07-251-22/+42
| | | | | Change-Id: Ia82ba24a631bc136b3fa843783d26e5c4cb42f15 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QSceneObserverInterface registered to QChangeArbiterPaul Lemire2014-07-251-0/+20
| | | | | | | | | 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>