summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2019-03-06 13:37:15 +0200
committerKaj Grönholm <kaj.gronholm@qt.io>2019-03-07 11:41:23 +0000
commitf621c33d5e7f440e3bada49183f3217e89bb5b30 (patch)
tree35b1ce37d51959ef84b54f8da93ad1ba4663d3bc /src
parentaa20d8e313a21759df0304f2411216d71a749e83 (diff)
Dragon: Fix dirty marking
When "markDirty(DirtyTreeInfo{})" was called to mark rendering tree dirty and then some place called plain "markDirty()", the latter replaced former and tree didn't get updated. Instead only add default dirty entry if it doesn't already exist. This fixes stereoscopic mode switching with dragon, but also some other cases where render tree changes. Task-number: QT3DS-2933 Change-Id: I8494fa03059b214e8fe703681f911aa438f95fcf Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/dragon/dragontrackingchangescontainer_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/dragon/dragontrackingchangescontainer_p.h b/src/runtime/dragon/dragontrackingchangescontainer_p.h
index 8a76b1b..bba173c 100644
--- a/src/runtime/dragon/dragontrackingchangescontainer_p.h
+++ b/src/runtime/dragon/dragontrackingchangescontainer_p.h
@@ -79,6 +79,11 @@ public:
void markDirty(const Key &id) override
{
+ // If m_dirty already contains id, don't replace it. Otherwise there
+ // is a risk to override DirtyTreeInfo{} with DirtyInfo{}
+ if (m_dirty.contains(id))
+ return;
+
m_dirty.insert(id, DirtyInfo{});
}