diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-08-06 15:30:01 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2019-08-28 06:30:29 +0200 |
commit | f3268fcb2a4e73d99dbd66aa5e262a118b5a5480 (patch) | |
tree | 374bd9ace2fccaa33534f338950185368ab5598b /src/core/nodes/qcomponent.cpp | |
parent | 91dc1e1a61651a82a0ee5ce6ad3b24e82f526be6 (diff) |
Do direct notification of backend nodeswip/refactor
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>
Diffstat (limited to 'src/core/nodes/qcomponent.cpp')
-rw-r--r-- | src/core/nodes/qcomponent.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/nodes/qcomponent.cpp b/src/core/nodes/qcomponent.cpp index f67989b1e..2fe3c8094 100644 --- a/src/core/nodes/qcomponent.cpp +++ b/src/core/nodes/qcomponent.cpp @@ -73,7 +73,7 @@ void QComponentPrivate::addEntity(QEntity *entity) m_scene->addEntityForComponent(m_id, entity->id()); } - const auto componentAddedChange = QComponentAddedChangePtr::create(q, entity); + const auto componentAddedChange = QComponentAddedChangePtr::create(q, entity); // TODOSYNC notify backend directly notifyObservers(componentAddedChange); Q_EMIT q->addedToEntity(entity); } @@ -86,7 +86,7 @@ void QComponentPrivate::removeEntity(QEntity *entity) m_entities.removeAll(entity); - const auto componentRemovedChange = QComponentRemovedChangePtr::create(q, entity); + const auto componentRemovedChange = QComponentRemovedChangePtr::create(q, entity); // TODOSYNC notify backend directly notifyObservers(componentRemovedChange); Q_EMIT q->removedFromEntity(entity); } |