diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-10-15 17:54:26 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2020-10-16 09:25:07 +0100 |
commit | 60a9f2f0a4a6e7aa756f3fa8a6961855081a3ed5 (patch) | |
tree | 8b40d8e90f700df42810ef85583d800edc9f00c5 /src/animation | |
parent | 92a8d07e339fa19b7c9344dc8279aeaf7256a06c (diff) |
Avoid multiple animation updates
Check that the handle is not already in the lists. Avoids doing
the same updates several times in the
Pick-to: 5.15
Change-Id: I385b150de23a2ae7f2274c7d7350a065bb0c34f5
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/animation')
-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 1b81f6aa1..ca0a971cc 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; } } |