summaryrefslogtreecommitdiffstats
path: root/src/core/qchangearbiter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Ground work to have a proper shutdownPaul Lemire2014-07-201-2/+11
| | | | | | | | | | | | | | | QAspectEngine shutdown invokes QAspectManager quit which will stop the QAspectThread. Prior to exiting, the QAspectThread calls QAspectManager shutdown which cleans up all aspects and deletes them. Renderer stops the RenderThread when cleanup is called and properly deletes the QGraphicContext and the RenderThread. Note: Everything is called as it should. However it always ends up in a segfault caused by the QFont::cleanup when the QThreadStorage of the main thread GuiApplication is destroyed. I've not been able to find the cause of that. Change-Id: I3b7baa843af4d0418b5d04e6d1cda88b962ded7f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter sceneChangeEvent / WithLock fixPaul Lemire2014-07-181-7/+8
| | | | | | | Note: won't compile by itself Change-Id: Ia0d6137ed2b20e2a9e67d3dbe890d0ee12a8e0ab Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QSceneChange cleaned and d-pointeredPaul Lemire2014-07-091-7/+7
| | | | | Change-Id: If1c2044c047e5ce3c1fd10d1445514bd89620d38 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QChangeArbiter d-pointeredPaul Lemire2014-07-091-34/+75
| | | | | Change-Id: Ic33650363629860ff23dfb048fa831dccf47b516 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed Component to QComponentPaul Lemire2014-07-051-1/+1
| | | | | Change-Id: Ifd585f5883e446d0569c38219d26ba581455e857 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed Node to QNodePaul Lemire2014-07-051-3/+3
| | | | | Change-Id: I0a0ebde1c107db8831b596eab1e512a2062979f7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QChangeArbiter::m_componentObservations -> m_nodeObservationsSean Harmer2014-06-081-5/+5
| | | | | Change-Id: I9ad961d7c354514d2b59b3b1650302980863f9bc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unify observer<->observable registrationSean Harmer2014-06-081-19/+18
| | | | | | | | | | | Now that Node inherits from QObservableInterface the only difference between register observables owned by an aspect compared with those owned by the main thread is which QObserverList to use. Introduce a helper function that does the common work. Change-Id: I4a129c11f30dda8ecb9e453c3199259f5ebc8f17 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make Node inherit from QObservableInterfaceSean Harmer2014-06-081-1/+1
| | | | | | | | Note we are not using QObservable as we only care about a single observer, the QChangeArbiter. Change-Id: I7541d1160dcc4d067d11c8157ba3c1f7fa485bae Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* All Node subclasses now use same route to talk to QChangeArbiterSean Harmer2014-06-081-7/+7
| | | | | | | | | | | | | Node no longer inherits from QObservable as QObservable is meant for use only by aspects. Node stores a QChangeArbiter pointer directly so that we can call the dedicated locking functions on it. The locking is needed for Node subclasses as these live in the main thread which is not managed by the QAspectmanager to work in sync with the QChangeArbiter. Change-Id: I1151ca107b4cb29dd303371c0095c022c43bc008 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename QChangeArbiter::m_observations -> m_aspectObservationsSean Harmer2014-06-081-5/+5
| | | | | Change-Id: I71ec74ea2cfa93feb294cf765efcc63aa7b037bc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Separate QObserverInterface, QObservableInterface and QObserverSean Harmer2014-06-081-28/+0
| | | | | | | | This just refactors the above classes into their own files and adusts the #includes throughout the project. Change-Id: Ie53b8d19f2c9f7119940d27137c4bb90cd7df805 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Check and comments in QChangeArbiterPaul Lemire2014-05-311-0/+3
| | | | | Change-Id: Iff7e93e6160ef8ec2a69affbb40aa70da6ab2074 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QLoggingCategories added to CorePaul Lemire2014-05-301-7/+7
| | | | | Change-Id: I1ebdbe809f19e9a158b9a2e4ec351e8842c0c845 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Handling of property reference changesPaul Lemire2014-05-211-25/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a QML property that is part of the Components list of an Entity changes reference, this triggers a QQmlListProperty clear followed by a QQmlListProperty append of each Component. In turn, foreach Component added, a notification ComponentAdded is submitted to the QChangeArbiter. The Arbiter notifies the RenderNode observing the frontend Entity so that the backend can be rebuilt. RenderNode handles the ComponentAdded, ComponentRemoved notification as it is the only backend element linked to the corresponding frontend Entity. That means that when such an event occurs, it has to check for the type of Component being added or removed and update the corresponding backend classes (RenderMesh, RenderCamera, RenderMaterial ...). This is a design choice so as to avoid having all backend render classes have a reference to the frontend Entity. Also reference property changes should be fairly rare and handling all of those in RenderNode reduces notification traffic. On the other hand, ComponentUpdate notifications are handled directly by the backend classes (RenderCamera, RenderMesh ..). Note : Please make sure that the property whose reference is changed is actually part of the components list of the Qml Entity so as to avoid losing time not understanding why updates have no effect. Also, the QChangeArbiter takes a binary flag QChangeFlag when registering an observer. The flags can be a combination of common events. It is then up to the observer to check upon reception of a notification, the subject, property name and the value contained in the QSceneChangePropertyEvent. Change-Id: I0bff49d753c439999d6745af03d14d4ae36a118a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Handle Component property reference changesPaul Lemire2014-04-301-10/+12
| | | | | | | | A follow up patch with a reworked Entity / Component composition will follow. Change-Id: I7d89fc660f933b43345755529041a9909d1f83a5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>