diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2017-02-06 15:12:25 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2017-02-06 14:54:35 +0000 |
commit | 3f649fd039369ec14a348bc424eac75a315e6dd6 (patch) | |
tree | d6fc191be4e9745ed8d589c7bd51e65295caab6d | |
parent | b3c54ed5c61519b479c98b911ddd775b9fdea395 (diff) |
Animations: add type to the jobs for the profiler
Change-Id: Ifa8d2def025608de6731b6391145df9ebb430d9f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/animation/animation.pro | 3 | ||||
-rw-r--r-- | src/animation/backend/buildblendtreesjob.cpp | 3 | ||||
-rw-r--r-- | src/animation/backend/evaluateblendclipanimatorjob.cpp | 3 | ||||
-rw-r--r-- | src/animation/backend/evaluateclipanimatorjob.cpp | 2 | ||||
-rw-r--r-- | src/animation/backend/findrunningclipanimatorsjob.cpp | 2 | ||||
-rw-r--r-- | src/animation/backend/loadanimationclipjob.cpp | 2 | ||||
-rw-r--r-- | src/animation/job_common_p.h | 79 |
7 files changed, 91 insertions, 3 deletions
diff --git a/src/animation/animation.pro b/src/animation/animation.pro index 4443e3193..b7d08416c 100644 --- a/src/animation/animation.pro +++ b/src/animation/animation.pro @@ -15,7 +15,8 @@ include(backend/backend.pri) HEADERS += \ qt3danimation_global.h \ qt3danimation_global_p.h \ - animationlogging_p.h + animationlogging_p.h \ + job_common_p.h SOURCES += \ animationlogging.cpp diff --git a/src/animation/backend/buildblendtreesjob.cpp b/src/animation/backend/buildblendtreesjob.cpp index e1c3dd701..e86aa4978 100644 --- a/src/animation/backend/buildblendtreesjob.cpp +++ b/src/animation/backend/buildblendtreesjob.cpp @@ -40,6 +40,7 @@ #include <Qt3DAnimation/private/clipblendnodevisitor_p.h> #include <Qt3DAnimation/private/clipblendnode_p.h> #include <Qt3DAnimation/private/lerpblend_p.h> +#include <Qt3DAnimation/private/job_common_p.h> QT_BEGIN_NAMESPACE @@ -49,7 +50,7 @@ namespace Animation { BuildBlendTreesJob::BuildBlendTreesJob() : Qt3DCore::QAspectJob() { - // TO DO: Add Profiler ID + SET_JOB_RUN_STAT_TYPE(this, JobTypes::BuildBlendTree, 0); } void BuildBlendTreesJob::setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles) diff --git a/src/animation/backend/evaluateblendclipanimatorjob.cpp b/src/animation/backend/evaluateblendclipanimatorjob.cpp index 0f79edbe6..440943ce4 100644 --- a/src/animation/backend/evaluateblendclipanimatorjob.cpp +++ b/src/animation/backend/evaluateblendclipanimatorjob.cpp @@ -41,6 +41,7 @@ #include <Qt3DAnimation/private/animationutils_p.h> #include <Qt3DAnimation/private/lerpblend_p.h> #include <Qt3DAnimation/private/clipblendnodevisitor_p.h> +#include <Qt3DAnimation/private/job_common_p.h> QT_BEGIN_NAMESPACE @@ -52,7 +53,7 @@ EvaluateBlendClipAnimatorJob::EvaluateBlendClipAnimatorJob() , m_currentLoop(std::numeric_limits<int>::max()) , m_isFinalFrame(true) { - // TO DO: Add Profiler ID + SET_JOB_RUN_STAT_TYPE(this, JobTypes::EvaluateBlendClipAnimator, 0); } namespace { diff --git a/src/animation/backend/evaluateclipanimatorjob.cpp b/src/animation/backend/evaluateclipanimatorjob.cpp index 406a46dcd..f4f919d25 100644 --- a/src/animation/backend/evaluateclipanimatorjob.cpp +++ b/src/animation/backend/evaluateclipanimatorjob.cpp @@ -39,6 +39,7 @@ #include <Qt3DAnimation/private/managers_p.h> #include <Qt3DAnimation/private/animationlogging_p.h> #include <Qt3DAnimation/private/animationutils_p.h> +#include <Qt3DAnimation/private/job_common_p.h> QT_BEGIN_NAMESPACE @@ -48,6 +49,7 @@ namespace Animation { EvaluateClipAnimatorJob::EvaluateClipAnimatorJob() : Qt3DCore::QAspectJob() { + SET_JOB_RUN_STAT_TYPE(this, JobTypes::EvaluateClipAnimator, 0); } void EvaluateClipAnimatorJob::run() diff --git a/src/animation/backend/findrunningclipanimatorsjob.cpp b/src/animation/backend/findrunningclipanimatorsjob.cpp index 3b2d9d4f5..fcffab8cc 100644 --- a/src/animation/backend/findrunningclipanimatorsjob.cpp +++ b/src/animation/backend/findrunningclipanimatorsjob.cpp @@ -39,6 +39,7 @@ #include <Qt3DAnimation/private/managers_p.h> #include <Qt3DAnimation/private/animationlogging_p.h> #include <Qt3DAnimation/private/animationutils_p.h> +#include <Qt3DAnimation/private/job_common_p.h> QT_BEGIN_NAMESPACE @@ -48,6 +49,7 @@ namespace Animation { FindRunningClipAnimatorsJob::FindRunningClipAnimatorsJob() : Qt3DCore::QAspectJob() { + SET_JOB_RUN_STAT_TYPE(this, JobTypes::FindRunningClipAnimator, 0); } void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QVector<HClipAnimator> &clipAnimatorHandles) diff --git a/src/animation/backend/loadanimationclipjob.cpp b/src/animation/backend/loadanimationclipjob.cpp index c94435398..39809f9eb 100644 --- a/src/animation/backend/loadanimationclipjob.cpp +++ b/src/animation/backend/loadanimationclipjob.cpp @@ -39,6 +39,7 @@ #include <Qt3DAnimation/private/animationclip_p.h> #include <Qt3DAnimation/private/handler_p.h> #include <Qt3DAnimation/private/managers_p.h> +#include <Qt3DAnimation/private/job_common_p.h> QT_BEGIN_NAMESPACE @@ -49,6 +50,7 @@ LoadAnimationClipJob::LoadAnimationClipJob() : Qt3DCore::QAspectJob() , m_animationClipHandles() { + SET_JOB_RUN_STAT_TYPE(this, JobTypes::LoadAnimationClip, 0); } void LoadAnimationClipJob::addDirtyAnimationClips(const QVector<HAnimationClip> &animationClipHandles) diff --git a/src/animation/job_common_p.h b/src/animation/job_common_p.h new file mode 100644 index 000000000..882246a42 --- /dev/null +++ b/src/animation/job_common_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QT3DANIMATION_ANIMATION_JOB_COMMON_P_H +#define QT3DANIMATION_ANIMATION_JOB_COMMON_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <Qt3DCore/private/qaspectjob_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DAnimation { + +namespace Animation { + +namespace JobTypes { + +enum JobType { + BuildBlendTree = 8192, + EvaluateBlendClipAnimator, + EvaluateClipAnimator, + LoadAnimationClip, + FindRunningClipAnimator +}; + +} // JobTypes + +} // Animation + +} // Qt3DAnimation + +QT_END_NAMESPACE + +#endif // QT3DANIMATION_ANIMATION_JOB_COMMON_P_H |