summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2015-07-31 13:47:16 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-08-05 10:07:03 +0000
commit09da4cc0362974b68b377d4dcd6a0871d8e651ef (patch)
treea480b81abf07f3e63229bb6dcc877438653d09cf /src/core
parent4426c09ee4948e4d743248a0a053035d2f318a89 (diff)
Handle jobs from multiple aspects of the same type
This stuff will need to be made more configurable in the future. Possibly in a data driven manner analogous to the framegraph but with a simpler set of primitives. This would allow combining aspects in custom ways and when to sync etc. Change-Id: I6a36d1c32f2268d61af6928d0e63afe7377de2c0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/qscheduler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/qscheduler.cpp b/src/core/qscheduler.cpp
index 92c601153..70e38479f 100644
--- a/src/core/qscheduler.cpp
+++ b/src/core/qscheduler.cpp
@@ -63,7 +63,7 @@ void QScheduler::update(qint64 time)
{
// Get tasks for this frame from each aspect
const QList<QAbstractAspect *> &aspects = m_aspectManager->aspects();
- QHash<QAbstractAspect::AspectType, QVector<QAspectJobPtr> > jobs;
+ QMultiHash<QAbstractAspect::AspectType, QVector<QAspectJobPtr> > jobs;
Q_FOREACH (QAbstractAspect *aspect, aspects) {
QVector<QAspectJobPtr> aspectJobs = aspect->jobsToExecute(time);
jobs.insert(aspect->aspectType(), aspectJobs);
@@ -74,8 +74,9 @@ void QScheduler::update(qint64 time)
QVector<QAspectJobPtr> jobQueue;
for (int i = QAbstractAspect::AspectRenderer; i <= QAbstractAspect::AspectOther; ++i) {
QAbstractAspect::AspectType aspectType = static_cast<QAbstractAspect::AspectType>(i);
- if (jobs.contains(aspectType))
- jobQueue += jobs.value(aspectType);
+ QList<QVector<QAspectJobPtr> > jobsForAspectType = jobs.values(aspectType);
+ Q_FOREACH (const QVector<QAspectJobPtr> &v, jobsForAspectType)
+ jobQueue += v;
}
m_aspectManager->jobManager()->enqueueJobs(jobQueue);