diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-10-15 17:54:26 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-10-16 12:22:07 +0000 |
commit | 42abb0c194e87596b8fce70985244cc41c0b4b20 (patch) | |
tree | 40f88e830c5693a72a4ff18149c3e4ec1ddd9fc9 | |
parent | 815fb0e3f11bf0087277b659ef9ed90739e14a0b (diff) |
Avoid multiple animation updates
Check that the handle is not already in the lists. Avoids doing
the same updates several times in the
Change-Id: I385b150de23a2ae7f2274c7d7350a065bb0c34f5
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
(cherry picked from commit 60a9f2f0a4a6e7aa756f3fa8a6961855081a3ed5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/animation/backend/handler.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp index f87e0a2a2..eef03c41a 100644 --- a/src/animation/backend/handler.cpp +++ b/src/animation/backend/handler.cpp @@ -80,7 +80,8 @@ void Handler::setDirty(DirtyFlag flag, Qt3DCore::QNodeId nodeId) case AnimationClipDirty: { QMutexLocker lock(&m_mutex); const auto handle = m_animationClipLoaderManager->lookupHandle(nodeId); - m_dirtyAnimationClips.push_back(handle); + if (!m_dirtyAnimationClips.contains(handle)) + m_dirtyAnimationClips.push_back(handle); break; } @@ -91,14 +92,16 @@ void Handler::setDirty(DirtyFlag flag, Qt3DCore::QNodeId nodeId) case ClipAnimatorDirty: { QMutexLocker lock(&m_mutex); const auto handle = m_clipAnimatorManager->lookupHandle(nodeId); - m_dirtyClipAnimators.push_back(handle); + if (!m_dirtyClipAnimators.contains(handle)) + m_dirtyClipAnimators.push_back(handle); break; } case BlendedClipAnimatorDirty: { QMutexLocker lock(&m_mutex); const HBlendedClipAnimator handle = m_blendedClipAnimatorManager->lookupHandle(nodeId); - m_dirtyBlendedAnimators.push_back(handle); + if (!m_dirtyBlendedAnimators.contains(handle)) + m_dirtyBlendedAnimators.push_back(handle); break; } } |