diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2020-06-29 11:57:36 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2020-07-02 13:03:44 +0200 |
commit | b70f7af20550f55e9546ff5a2192f53d6ccb62cb (patch) | |
tree | c16156ad6b57a24e72dbcf491e680f95e73bce14 | |
parent | abb02d0aae5a114b77ad2edc07568fb0bcf4c6e5 (diff) | |
download | qt3d-b70f7af20550f55e9546ff5a2192f53d6ccb62cb.tar.gz |
QAspectJob: switch to using std::vector
Change-Id: I1314bd4d37ad17442ebd6287f571e41bc5d25490
Reviewed-by: Mike Krus <mike.krus@kdab.com>
47 files changed, 207 insertions, 190 deletions
diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp index f87e0a2a2..939e58263 100644 --- a/src/animation/backend/handler.cpp +++ b/src/animation/backend/handler.cpp @@ -173,14 +173,14 @@ void Handler::cleanupHandleList(QVector<HBlendedClipAnimator> *animators) } } -QVector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time) +std::vector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time) { // Store the simulation time so we can mark the start time of // animators which will allow us to calculate the local time of // animation clips. m_simulationTime = time; - QVector<Qt3DCore::QAspectJobPtr> jobs; + std::vector<Qt3DCore::QAspectJobPtr> jobs; QMutexLocker lock(&m_mutex); diff --git a/src/animation/backend/handler_p.h b/src/animation/backend/handler_p.h index e65bc0797..cad1c568d 100644 --- a/src/animation/backend/handler_p.h +++ b/src/animation/backend/handler_p.h @@ -119,7 +119,7 @@ public: ClipBlendNodeManager *clipBlendNodeManager() const Q_DECL_NOTHROW { return m_clipBlendNodeManager.data(); } SkeletonManager *skeletonManager() const Q_DECL_NOTHROW { return m_skeletonManager.data(); } - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time); + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time); void cleanupHandleList(QVector<HAnimationClip> *clips); void cleanupHandleList(QVector<HClipAnimator> *animators); diff --git a/src/animation/frontend/qanimationaspect.cpp b/src/animation/frontend/qanimationaspect.cpp index a25eb533e..ce059f996 100644 --- a/src/animation/frontend/qanimationaspect.cpp +++ b/src/animation/frontend/qanimationaspect.cpp @@ -138,7 +138,7 @@ QAnimationAspect::~QAnimationAspect() /*! \internal */ -QVector<QAspectJobPtr> QAnimationAspect::jobsToExecute(qint64 time) +std::vector<QAspectJobPtr> QAnimationAspect::jobsToExecute(qint64 time) { Q_D(QAnimationAspect); Q_ASSERT(d->m_handler); diff --git a/src/animation/frontend/qanimationaspect.h b/src/animation/frontend/qanimationaspect.h index 280c643e6..5bf2e01ab 100644 --- a/src/animation/frontend/qanimationaspect.h +++ b/src/animation/frontend/qanimationaspect.h @@ -57,7 +57,7 @@ public: ~QAnimationAspect(); private: - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; Q_DECLARE_PRIVATE(QAnimationAspect) explicit QAnimationAspect(QAnimationAspectPrivate &dd, QObject *parent); diff --git a/src/core/aspect/qcoreaspect.cpp b/src/core/aspect/qcoreaspect.cpp index d120bab47..b2924fb72 100644 --- a/src/core/aspect/qcoreaspect.cpp +++ b/src/core/aspect/qcoreaspect.cpp @@ -85,12 +85,12 @@ QAspectJobPtr QCoreAspect::calculateBoundingVolumeJob() const return d->m_calculateBoundingVolumeJob; } -QVector<QAspectJobPtr> QCoreAspect::jobsToExecute(qint64 time) +std::vector<QAspectJobPtr> QCoreAspect::jobsToExecute(qint64 time) { Q_D(QCoreAspect); Q_UNUSED(time); - QVector<QAspectJobPtr> jobs; + std::vector<QAspectJobPtr> jobs; auto scene = d->m_aspectManager->scene(); auto dirtyBits = scene->dirtyBits(); diff --git a/src/core/aspect/qcoreaspect.h b/src/core/aspect/qcoreaspect.h index 071b7387a..3289111d1 100644 --- a/src/core/aspect/qcoreaspect.h +++ b/src/core/aspect/qcoreaspect.h @@ -61,7 +61,7 @@ protected: Q_DECLARE_PRIVATE(QCoreAspect) private: - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; QVariant executeCommand(const QStringList &args) override; void onRegistered() override; void onEngineStartup() override; diff --git a/src/core/aspects/qabstractaspect.cpp b/src/core/aspects/qabstractaspect.cpp index 5eb5b5b1e..6822c938f 100644 --- a/src/core/aspects/qabstractaspect.cpp +++ b/src/core/aspects/qabstractaspect.cpp @@ -189,10 +189,10 @@ QVariant QAbstractAspect::executeCommand(const QStringList &args) return QVariant(); } -QVector<QAspectJobPtr> QAbstractAspect::jobsToExecute(qint64 time) +std::vector<QAspectJobPtr> QAbstractAspect::jobsToExecute(qint64 time) { Q_UNUSED(time); - return QVector<QAspectJobPtr>(); + return {}; } QBackendNodeMapperPtr QAbstractAspectPrivate::mapperForNode(const QMetaObject *metaObj) const @@ -332,14 +332,16 @@ QAbstractAspectJobManager *QAbstractAspectPrivate::jobManager() const return m_jobManager; } -QVector<QAspectJobPtr> QAbstractAspectPrivate::jobsToExecute(qint64 time) +std::vector<QAspectJobPtr> QAbstractAspectPrivate::jobsToExecute(qint64 time) { Q_Q(QAbstractAspect); auto res = q->jobsToExecute(time); { QMutexLocker lock(&m_singleShotMutex); - res << m_singleShotJobs; + res.insert(res.end(), + std::make_move_iterator(m_singleShotJobs.begin()), + std::make_move_iterator(m_singleShotJobs.end())); m_singleShotJobs.clear(); } diff --git a/src/core/aspects/qabstractaspect.h b/src/core/aspects/qabstractaspect.h index 144f267cf..9a03d04dc 100644 --- a/src/core/aspects/qabstractaspect.h +++ b/src/core/aspects/qabstractaspect.h @@ -86,7 +86,7 @@ protected: private: virtual QVariant executeCommand(const QStringList &args); - virtual QVector<QAspectJobPtr> jobsToExecute(qint64 time); + virtual std::vector<QAspectJobPtr> jobsToExecute(qint64 time); virtual void onRegistered(); virtual void onUnregistered(); diff --git a/src/core/aspects/qabstractaspect_p.h b/src/core/aspects/qabstractaspect_p.h index eed85433f..f5e295ba3 100644 --- a/src/core/aspects/qabstractaspect_p.h +++ b/src/core/aspects/qabstractaspect_p.h @@ -124,7 +124,7 @@ public: QServiceLocator *services() const; QAbstractAspectJobManager *jobManager() const; - QVector<QAspectJobPtr> jobsToExecute(qint64 time) override; + std::vector<QAspectJobPtr> jobsToExecute(qint64 time) override; void jobsDone() override; // called when all the jobs are completed void frameDone() override; // called when frame is completed (after the jobs), safe to wait until next frame here @@ -153,7 +153,7 @@ public: QChangeArbiter *m_arbiter; QHash<const QMetaObject*, QBackendNodeMapperPtr> m_backendCreatorFunctors; QMutex m_singleShotMutex; - QVector<QAspectJobPtr> m_singleShotJobs; + std::vector<QAspectJobPtr> m_singleShotJobs; static QAbstractAspectPrivate *get(QAbstractAspect *aspect); }; diff --git a/src/core/jobs/qabstractaspectjobmanager_p.h b/src/core/jobs/qabstractaspectjobmanager_p.h index c7f8cf721..3ddb1c2dc 100644 --- a/src/core/jobs/qabstractaspectjobmanager_p.h +++ b/src/core/jobs/qabstractaspectjobmanager_p.h @@ -65,7 +65,7 @@ public: explicit QAbstractAspectJobManager(QObject *p = nullptr); virtual void initialize() {} - virtual void enqueueJobs(const QVector<QAspectJobPtr> &jobQueue) = 0; + virtual void enqueueJobs(const std::vector<QAspectJobPtr> &jobQueue) = 0; virtual int waitForAllJobs() = 0; // Callback signature for running SynchronizedJobs diff --git a/src/core/jobs/qaspectjob.cpp b/src/core/jobs/qaspectjob.cpp index 22044ebaf..186624aec 100644 --- a/src/core/jobs/qaspectjob.cpp +++ b/src/core/jobs/qaspectjob.cpp @@ -116,7 +116,7 @@ QAspectJob::~QAspectJob() void QAspectJob::addDependency(QWeakPointer<QAspectJob> dependency) { Q_D(QAspectJob); - d->m_dependencies.append(dependency); + d->m_dependencies.push_back(dependency); #ifdef QT3DCORE_ASPECT_JOB_DEBUG static int threshold = qMax(1, qgetenv("QT3DCORE_ASPECT_JOB_DEPENDENCY_THRESHOLD").toInt()); if (d->m_dependencies.count() > threshold) @@ -131,7 +131,10 @@ void QAspectJob::removeDependency(QWeakPointer<QAspectJob> dependency) { Q_D(QAspectJob); if (!dependency.isNull()) { - d->m_dependencies.removeAll(dependency); + d->m_dependencies.erase(std::remove(d->m_dependencies.begin(), + d->m_dependencies.end(), + dependency), + d->m_dependencies.end()); } else { d->m_dependencies.erase(std::remove_if(d->m_dependencies.begin(), d->m_dependencies.end(), @@ -143,7 +146,7 @@ void QAspectJob::removeDependency(QWeakPointer<QAspectJob> dependency) /*! * \return the dependencies of the aspect job. */ -QVector<QWeakPointer<QAspectJob> > QAspectJob::dependencies() const +const std::vector<QWeakPointer<QAspectJob> > &QAspectJob::dependencies() const { Q_D(const QAspectJob); return d->m_dependencies; diff --git a/src/core/jobs/qaspectjob.h b/src/core/jobs/qaspectjob.h index c618c3c19..90070f5b7 100644 --- a/src/core/jobs/qaspectjob.h +++ b/src/core/jobs/qaspectjob.h @@ -60,7 +60,7 @@ public: void addDependency(QWeakPointer<QAspectJob> dependency); void removeDependency(QWeakPointer<QAspectJob> dependency); - QVector<QWeakPointer<QAspectJob> > dependencies() const; + const std::vector<QWeakPointer<QAspectJob>> &dependencies() const; virtual void run() = 0; virtual void postFrame(QAspectEngine *aspectEngine); diff --git a/src/core/jobs/qaspectjob_p.h b/src/core/jobs/qaspectjob_p.h index 0c7802b02..b031bfe57 100644 --- a/src/core/jobs/qaspectjob_p.h +++ b/src/core/jobs/qaspectjob_p.h @@ -77,7 +77,7 @@ public: void clearDependencies() { m_dependencies.clear(); } - QVector<QWeakPointer<QAspectJob> > m_dependencies; + std::vector<QWeakPointer<QAspectJob> > m_dependencies; JobId m_jobId; QString m_jobName; }; diff --git a/src/core/jobs/qaspectjobmanager.cpp b/src/core/jobs/qaspectjobmanager.cpp index 7103f5100..ed8846bb6 100644 --- a/src/core/jobs/qaspectjobmanager.cpp +++ b/src/core/jobs/qaspectjobmanager.cpp @@ -68,7 +68,7 @@ void QAspectJobManager::initialize() } // Adds all Aspect Jobs to be processed for a frame -void QAspectJobManager::enqueueJobs(const QVector<QAspectJobPtr> &jobQueue) +void QAspectJobManager::enqueueJobs(const std::vector<QAspectJobPtr> &jobQueue) { auto systemService = m_aspectManager ? m_aspectManager->serviceLocator()->systemInformation() : nullptr; if (systemService) @@ -87,7 +87,7 @@ void QAspectJobManager::enqueueJobs(const QVector<QAspectJobPtr> &jobQueue) } for (const QAspectJobPtr &job : jobQueue) { - const QVector<QWeakPointer<QAspectJob> > &deps = job->dependencies(); + const std::vector<QWeakPointer<QAspectJob> > &deps = job->dependencies(); AspectTaskRunnable *taskDepender = tasksMap.value(job.data()); int dependerCount = 0; diff --git a/src/core/jobs/qaspectjobmanager_p.h b/src/core/jobs/qaspectjobmanager_p.h index db0075443..0205b7e5a 100644 --- a/src/core/jobs/qaspectjobmanager_p.h +++ b/src/core/jobs/qaspectjobmanager_p.h @@ -74,7 +74,7 @@ public: void initialize() override; - void enqueueJobs(const QVector<QAspectJobPtr> &jobQueue) override; + void enqueueJobs(const std::vector<QAspectJobPtr> &jobQueue) override; int waitForAllJobs() override; diff --git a/src/core/jobs/qaspectjobproviderinterface_p.h b/src/core/jobs/qaspectjobproviderinterface_p.h index bb2c5ed88..4cc7f2047 100644 --- a/src/core/jobs/qaspectjobproviderinterface_p.h +++ b/src/core/jobs/qaspectjobproviderinterface_p.h @@ -68,7 +68,7 @@ public: virtual ~QAspectJobProviderInterface() {} private: - virtual QVector<QAspectJobPtr> jobsToExecute(qint64 time) = 0; + virtual std::vector<QAspectJobPtr> jobsToExecute(qint64 time) = 0; virtual void jobsDone() = 0; virtual void frameDone() = 0; diff --git a/src/core/qscheduler.cpp b/src/core/qscheduler.cpp index 6c63fc1c1..543e9f2ef 100644 --- a/src/core/qscheduler.cpp +++ b/src/core/qscheduler.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE namespace { // Creates a graphviz dot file. To view online: https://dreampuf.github.io/GraphvizOnline/ -void dumpJobs(QVector<Qt3DCore::QAspectJobPtr> jobs) { +void dumpJobs(const std::vector<Qt3DCore::QAspectJobPtr> &jobs) { const QString fileName = QStringLiteral("qt3djobs_") + QCoreApplication::applicationName() + QDateTime::currentDateTime().toString(QStringLiteral("_yyMMdd-hhmmss")) + QStringLiteral(".dot"); @@ -112,7 +112,7 @@ QAspectManager *QScheduler::aspectManager() const int QScheduler::scheduleAndWaitForFrameAspectJobs(qint64 time, bool dumpJobs) { - QVector<QAspectJobPtr> jobQueue; + std::vector<QAspectJobPtr> jobQueue; // TODO: Allow clocks with custom scale factors and independent control // over running / paused / stopped status @@ -122,8 +122,10 @@ int QScheduler::scheduleAndWaitForFrameAspectJobs(qint64 time, bool dumpJobs) // For now just queue them up as they are const QVector<QAbstractAspect *> &aspects = m_aspectManager->aspects(); for (QAbstractAspect *aspect : aspects) { - const QVector<QAspectJobPtr> aspectJobs = QAbstractAspectPrivate::get(aspect)->jobsToExecute(time); - jobQueue << aspectJobs; + const std::vector<QAspectJobPtr> aspectJobs = QAbstractAspectPrivate::get(aspect)->jobsToExecute(time); + jobQueue.insert(jobQueue.end(), + std::make_move_iterator(aspectJobs.begin()), + std::make_move_iterator(aspectJobs.end())); } if (dumpJobs) @@ -134,7 +136,7 @@ int QScheduler::scheduleAndWaitForFrameAspectJobs(qint64 time, bool dumpJobs) // Do any other work here that the aspect thread can usefully be doing // whilst the threadpool works its way through the jobs - int totalJobs = m_aspectManager->jobManager()->waitForAllJobs(); + const int totalJobs = m_aspectManager->jobManager()->waitForAllJobs(); { QTaskLogger logger(m_aspectManager->serviceLocator()->systemInformation(), 4097, 0, QTaskLogger::AspectJob); diff --git a/src/input/backend/keyboardmousegenericdeviceintegration.cpp b/src/input/backend/keyboardmousegenericdeviceintegration.cpp index 27da019af..00699dcb5 100644 --- a/src/input/backend/keyboardmousegenericdeviceintegration.cpp +++ b/src/input/backend/keyboardmousegenericdeviceintegration.cpp @@ -62,10 +62,10 @@ void KeyboardMouseGenericDeviceIntegration::onInitialize() { } -QVector<Qt3DCore::QAspectJobPtr> KeyboardMouseGenericDeviceIntegration::jobsToExecute(qint64 time) +std::vector<Qt3DCore::QAspectJobPtr> KeyboardMouseGenericDeviceIntegration::jobsToExecute(qint64 time) { Q_UNUSED(time); - return QVector<Qt3DCore::QAspectJobPtr>(); + return {}; } QAbstractPhysicalDevice *KeyboardMouseGenericDeviceIntegration::createPhysicalDevice(const QString &name) diff --git a/src/input/backend/keyboardmousegenericdeviceintegration_p.h b/src/input/backend/keyboardmousegenericdeviceintegration_p.h index dd7c5fc12..1b64513bd 100644 --- a/src/input/backend/keyboardmousegenericdeviceintegration_p.h +++ b/src/input/backend/keyboardmousegenericdeviceintegration_p.h @@ -68,7 +68,7 @@ public: explicit KeyboardMouseGenericDeviceIntegration(InputHandler *handleer); ~KeyboardMouseGenericDeviceIntegration(); - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) final; + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) final; QAbstractPhysicalDevice *createPhysicalDevice(const QString &name) final; QVector<Qt3DCore::QNodeId> physicalDevices() const final; QAbstractPhysicalDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId id) const final; diff --git a/src/input/frontend/qinputaspect.cpp b/src/input/frontend/qinputaspect.cpp index 65cd35b14..3d2b6526b 100644 --- a/src/input/frontend/qinputaspect.cpp +++ b/src/input/frontend/qinputaspect.cpp @@ -221,23 +221,26 @@ QStringList QInputAspect::availablePhysicalDevices() const /*! \internal */ -QVector<QAspectJobPtr> QInputAspect::jobsToExecute(qint64 time) +std::vector<QAspectJobPtr> QInputAspect::jobsToExecute(qint64 time) { Q_D(QInputAspect); const qint64 deltaTime = time - d->m_time; const float dt = static_cast<float>(deltaTime) / 1.0e9f; d->m_time = time; - QVector<QAspectJobPtr> jobs; + std::vector<QAspectJobPtr> jobs; d->m_inputHandler->updateEventSource(); // Mouse and keyboard handlers will have seen the events already. // All we need now is to update the axis and the accumulators since // they depend on time, and other bookkeeping. + const auto integrations = d->m_inputHandler->inputDeviceIntegrations(); - for (QInputDeviceIntegration *integration : integrations) - jobs += integration->jobsToExecute(time); + for (QInputDeviceIntegration *integration : integrations) { + const std::vector<QAspectJobPtr> integrationJobs = integration->jobsToExecute(time); + jobs.insert(jobs.end(), std::make_move_iterator(integrationJobs.begin()), std::make_move_iterator(integrationJobs.end())); + } const QVector<Qt3DCore::QNodeId> proxiesToLoad = d->m_inputHandler->physicalDeviceProxyManager()->takePendingProxiesToLoad(); if (!proxiesToLoad.isEmpty()) { @@ -251,11 +254,11 @@ QVector<QAspectJobPtr> QInputAspect::jobsToExecute(qint64 time) // All the jobs added up until this point are independents // but the axis action jobs will be dependent on these - const QVector<QAspectJobPtr> dependsOnJobs = jobs; + const std::vector<QAspectJobPtr> dependsOnJobs = jobs; // Jobs that update Axis/Action (store combined axis/action value) const auto devHandles = d->m_inputHandler->logicalDeviceManager()->activeDevices(); - QVector<QAspectJobPtr> axisActionJobs; + std::vector<QAspectJobPtr> axisActionJobs; axisActionJobs.reserve(devHandles.size()); for (const Input::HLogicalDevice &devHandle : devHandles) { const auto device = d->m_inputHandler->logicalDeviceManager()->data(devHandle); @@ -263,7 +266,7 @@ QVector<QAspectJobPtr> QInputAspect::jobsToExecute(qint64 time) continue; QAspectJobPtr updateAxisActionJob(new Input::UpdateAxisActionJob(time, d->m_inputHandler.data(), devHandle)); - jobs += updateAxisActionJob; + jobs.push_back(updateAxisActionJob); axisActionJobs.push_back(updateAxisActionJob); for (const QAspectJobPtr &job : dependsOnJobs) updateAxisActionJob->addDependency(job); diff --git a/src/input/frontend/qinputaspect.h b/src/input/frontend/qinputaspect.h index eff1b9e53..0ccc0abff 100644 --- a/src/input/frontend/qinputaspect.h +++ b/src/input/frontend/qinputaspect.h @@ -62,7 +62,7 @@ public: QStringList availablePhysicalDevices() const; private: - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; void onRegistered() override; void onUnregistered() override; diff --git a/src/input/frontend/qinputdeviceintegration_p.h b/src/input/frontend/qinputdeviceintegration_p.h index 4522e2654..438e407fb 100644 --- a/src/input/frontend/qinputdeviceintegration_p.h +++ b/src/input/frontend/qinputdeviceintegration_p.h @@ -90,7 +90,7 @@ protected: public: void initialize(Qt3DInput::QInputAspect *aspect); - virtual QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) = 0; + virtual std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) = 0; virtual QAbstractPhysicalDevice *createPhysicalDevice(const QString &name) = 0; virtual QVector<Qt3DCore::QNodeId> physicalDevices() const = 0; virtual QAbstractPhysicalDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId id) const = 0; diff --git a/src/logic/qlogicaspect.cpp b/src/logic/qlogicaspect.cpp index e6fae261e..cd9b3e47a 100644 --- a/src/logic/qlogicaspect.cpp +++ b/src/logic/qlogicaspect.cpp @@ -112,7 +112,7 @@ QLogicAspect::~QLogicAspect() } /*! \internal */ -QVector<QAspectJobPtr> QLogicAspect::jobsToExecute(qint64 time) +std::vector<QAspectJobPtr> QLogicAspect::jobsToExecute(qint64 time) { Q_D(QLogicAspect); const qint64 deltaTime = time - d->m_time; @@ -121,11 +121,10 @@ QVector<QAspectJobPtr> QLogicAspect::jobsToExecute(qint64 time) d->m_time = time; // Create jobs that will get executed by the threadpool - QVector<QAspectJobPtr> jobs; if (d->m_manager->hasFrameActions()) - jobs.append(d->m_callbackJob); + return {d->m_callbackJob}; - return jobs; + return {}; } /*! \internal */ diff --git a/src/logic/qlogicaspect.h b/src/logic/qlogicaspect.h index a44073ed0..a6e418b93 100644 --- a/src/logic/qlogicaspect.h +++ b/src/logic/qlogicaspect.h @@ -57,7 +57,7 @@ public: ~QLogicAspect(); private: - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; void onRegistered() override; void onEngineStartup() override; diff --git a/src/plugins/renderers/opengl/renderer/renderer.cpp b/src/plugins/renderers/opengl/renderer/renderer.cpp index e2fec46d2..f0fcb484f 100644 --- a/src/plugins/renderers/opengl/renderer/renderer.cpp +++ b/src/plugins/renderers/opengl/renderer/renderer.cpp @@ -1815,23 +1815,20 @@ bool Renderer::processKeyEvent(QObject *object, QKeyEvent *event) } // Jobs we may have to run even if no rendering will happen -QVector<QAspectJobPtr> Renderer::preRenderingJobs() +std::vector<QAspectJobPtr> Renderer::preRenderingJobs() { - QVector<QAspectJobPtr> jobs; - if (m_sendBufferCaptureJob->hasRequests()) - jobs.push_back(m_sendBufferCaptureJob); - - return jobs; + return {m_sendBufferCaptureJob}; + return {}; } // Waits to be told to create jobs for the next frame // Called by QRenderAspect jobsToExecute context of QAspectThread // Returns all the jobs (and with proper dependency chain) required // for the rendering of the scene -QVector<Qt3DCore::QAspectJobPtr> Renderer::renderBinJobs() +std::vector<Qt3DCore::QAspectJobPtr> Renderer::renderBinJobs() { - QVector<QAspectJobPtr> renderBinJobs; + std::vector<QAspectJobPtr> renderBinJobs; // Remove previous dependencies m_cleanupJob->removeDependency(QWeakPointer<QAspectJob>()); @@ -1936,7 +1933,10 @@ QVector<Qt3DCore::QAspectJobPtr> Renderer::renderBinJobs() } builder.prepareJobs(); - renderBinJobs.append(builder.buildJobHierachy()); + const std::vector<QAspectJobPtr> builderJobs = builder.buildJobHierachy(); + renderBinJobs.insert(renderBinJobs.end(), + std::make_move_iterator(builderJobs.begin()), + std::make_move_iterator(builderJobs.end())); } // Set target number of RenderViews diff --git a/src/plugins/renderers/opengl/renderer/renderer_p.h b/src/plugins/renderers/opengl/renderer/renderer_p.h index 3e3566950..730ea6da3 100644 --- a/src/plugins/renderers/opengl/renderer/renderer_p.h +++ b/src/plugins/renderers/opengl/renderer/renderer_p.h @@ -214,8 +214,8 @@ public: bool processMouseEvent(QObject *object, QMouseEvent *event) override; bool processKeyEvent(QObject *object, QKeyEvent *event) override; - QVector<Qt3DCore::QAspectJobPtr> preRenderingJobs() override; - QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() override; + std::vector<Qt3DCore::QAspectJobPtr> preRenderingJobs() override; + std::vector<Qt3DCore::QAspectJobPtr> renderBinJobs() override; inline FrameCleanupJobPtr frameCleanupJob() const { return m_cleanupJob; } inline UpdateShaderDataTransformJobPtr updateShaderDataTransformJob() const { return m_updateShaderDataTransformJob; } inline FilterCompatibleTechniqueJobPtr filterCompatibleTechniqueJob() const { return m_filterCompatibleTechniqueJob; } diff --git a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp index 23a09de2b..da9745a91 100644 --- a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp +++ b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp @@ -710,9 +710,9 @@ void RenderViewBuilder::prepareJobs() JobTypes::SyncRenderViewInitialization); } -QVector<Qt3DCore::QAspectJobPtr> RenderViewBuilder::buildJobHierachy() const +std::vector<Qt3DCore::QAspectJobPtr> RenderViewBuilder::buildJobHierachy() const { - QVector<Qt3DCore::QAspectJobPtr> jobs; + std::vector<Qt3DCore::QAspectJobPtr> jobs; auto daspect = QRenderAspectPrivate::get(m_renderer->aspect()); auto expandBVJob = daspect->m_expandBoundingVolumeJob; auto wordTransformJob = daspect->m_worldTransformJob; diff --git a/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h b/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h index ab670665b..16eb79074 100644 --- a/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h +++ b/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h @@ -99,7 +99,7 @@ public: SynchronizerJobPtr syncMaterialGathererJob() const; void prepareJobs(); - QVector<Qt3DCore::QAspectJobPtr> buildJobHierachy() const; + std::vector<Qt3DCore::QAspectJobPtr> buildJobHierachy() const; Renderer *renderer() const; int renderViewIndex() const; diff --git a/src/render/backend/abstractrenderer_p.h b/src/render/backend/abstractrenderer_p.h index c2c634696..8c59468aa 100644 --- a/src/render/backend/abstractrenderer_p.h +++ b/src/render/backend/abstractrenderer_p.h @@ -160,8 +160,8 @@ public: virtual bool processMouseEvent(QObject *object, QMouseEvent *event) = 0; virtual bool processKeyEvent(QObject *object, QKeyEvent *event) = 0; - virtual QVector<Qt3DCore::QAspectJobPtr> preRenderingJobs() = 0; - virtual QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() = 0; + virtual std::vector<Qt3DCore::QAspectJobPtr> preRenderingJobs() = 0; + virtual std::vector<Qt3DCore::QAspectJobPtr> renderBinJobs() = 0; virtual void setSceneRoot(Entity *root) = 0; diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp index c0db60eca..5d421dc01 100644 --- a/src/render/frontend/qrenderaspect.cpp +++ b/src/render/frontend/qrenderaspect.cpp @@ -653,7 +653,7 @@ void QRenderAspectPrivate::renderShutdown() m_renderer->shutdown(); } -QVector<Qt3DCore::QAspectJobPtr> QRenderAspect::jobsToExecute(qint64 time) +std::vector<Qt3DCore::QAspectJobPtr> QRenderAspect::jobsToExecute(qint64 time) { using namespace Render; @@ -665,7 +665,7 @@ QVector<Qt3DCore::QAspectJobPtr> QRenderAspect::jobsToExecute(qint64 time) #endif // Create jobs that will get executed by the threadpool - QVector<QAspectJobPtr> jobs; + std::vector<QAspectJobPtr> jobs; // 1 GeometryJobs, SceneLoaderJobs, LoadTextureJobs // 2 CalculateBoundingVolumeJob (depends on LoadBuffer) @@ -692,24 +692,24 @@ QVector<Qt3DCore::QAspectJobPtr> QRenderAspect::jobsToExecute(qint64 time) auto loadSkeletonJob = Render::LoadSkeletonJobPtr::create(skeletonHandle); loadSkeletonJob->setNodeManagers(manager); d->m_syncLoadingJobs->addDependency(loadSkeletonJob); - jobs.append(loadSkeletonJob); + jobs.push_back(loadSkeletonJob); } // TO DO: Have 2 jobs queue // One for urgent jobs that are mandatory for the rendering of a frame // Another for jobs that can span across multiple frames (Scene/Mesh loading) - const QVector<Render::LoadSceneJobPtr> sceneJobs = manager->sceneManager()->takePendingSceneLoaderJobs(); + const std::vector<Render::LoadSceneJobPtr> sceneJobs = manager->sceneManager()->takePendingSceneLoaderJobs(); for (const Render::LoadSceneJobPtr &job : sceneJobs) { job->setNodeManagers(d->m_nodeManagers); job->setSceneImporters(d->m_sceneImporter); - jobs.append(job); + jobs.push_back(job); } - const QVector<QAspectJobPtr> geometryJobs = d->createGeometryRendererJobs(); - jobs.append(geometryJobs); + const std::vector<QAspectJobPtr> geometryJobs = d->createGeometryRendererJobs(); + jobs.insert(jobs.end(), std::make_move_iterator(geometryJobs.begin()), std::make_move_iterator(geometryJobs.end())); - const QVector<QAspectJobPtr> preRenderingJobs = d->createPreRendererJobs(); - jobs.append(preRenderingJobs); + const std::vector<QAspectJobPtr> preRenderingJobs = d->createPreRendererJobs(); + jobs.insert(jobs.end(), std::make_move_iterator(preRenderingJobs.begin()), std::make_move_iterator(preRenderingJobs.end())); // Don't spawn any rendering jobs, if the renderer decides to skip this frame // Note: this only affects rendering jobs (jobs that load buffers, @@ -758,8 +758,8 @@ QVector<Qt3DCore::QAspectJobPtr> QRenderAspect::jobsToExecute(qint64 time) if (layersDirty) jobs.push_back(d->m_updateEntityLayersJob); - const QVector<QAspectJobPtr> renderBinJobs = d->m_renderer->renderBinJobs(); - jobs.append(renderBinJobs); + const std::vector<QAspectJobPtr> renderBinJobs = d->m_renderer->renderBinJobs(); + jobs.insert(jobs.end(), std::make_move_iterator(renderBinJobs.begin()), std::make_move_iterator(renderBinJobs.end())); } return jobs; @@ -876,11 +876,11 @@ void QRenderAspect::onUnregistered() d->m_offscreenHelper = nullptr; } -QVector<Qt3DCore::QAspectJobPtr> QRenderAspectPrivate::createGeometryRendererJobs() const +std::vector<Qt3DCore::QAspectJobPtr> QRenderAspectPrivate::createGeometryRendererJobs() const { Render::GeometryRendererManager *geomRendererManager = m_nodeManagers->geometryRendererManager(); const QVector<QNodeId> dirtyGeometryRenderers = geomRendererManager->dirtyGeometryRenderers(); - QVector<QAspectJobPtr> dirtyGeometryRendererJobs; + std::vector<QAspectJobPtr> dirtyGeometryRendererJobs; dirtyGeometryRendererJobs.reserve(dirtyGeometryRenderers.size()); for (const QNodeId &geoRendererId : dirtyGeometryRenderers) { @@ -895,7 +895,7 @@ QVector<Qt3DCore::QAspectJobPtr> QRenderAspectPrivate::createGeometryRendererJob return dirtyGeometryRendererJobs; } -QVector<QAspectJobPtr> QRenderAspectPrivate::createPreRendererJobs() const +std::vector<QAspectJobPtr> QRenderAspectPrivate::createPreRendererJobs() const { if (!m_renderer) return {}; @@ -912,8 +912,8 @@ QVector<QAspectJobPtr> QRenderAspectPrivate::createPreRendererJobs() const m_rayCastingJob->setFrameGraphRoot(m_renderer->frameGraphRoot()); } - jobs.append(m_pickBoundingVolumeJob); - jobs.append(m_rayCastingJob); + jobs.push_back(m_pickBoundingVolumeJob); + jobs.push_back(m_rayCastingJob); return jobs; } diff --git a/src/render/frontend/qrenderaspect.h b/src/render/frontend/qrenderaspect.h index f16f6f07f..ab1780c68 100644 --- a/src/render/frontend/qrenderaspect.h +++ b/src/render/frontend/qrenderaspect.h @@ -83,7 +83,7 @@ protected: Q_DECLARE_PRIVATE(QRenderAspect) private: - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override; QVariant executeCommand(const QStringList &args) override; diff --git a/src/render/frontend/qrenderaspect_p.h b/src/render/frontend/qrenderaspect_p.h index f4dcb7234..fbdc0c053 100644 --- a/src/render/frontend/qrenderaspect_p.h +++ b/src/render/frontend/qrenderaspect_p.h @@ -117,9 +117,9 @@ public: void renderSynchronous(bool swapBuffers = true); void renderShutdown(); void registerBackendType(const QMetaObject &, const Qt3DCore::QBackendNodeMapperPtr &functor); - QVector<Qt3DCore::QAspectJobPtr> createGeometryRendererJobs() const; - QVector<Qt3DCore::QAspectJobPtr> createPreRendererJobs() const; - QVector<Qt3DCore::QAspectJobPtr> createRenderBufferJobs() const; + std::vector<Qt3DCore::QAspectJobPtr> createGeometryRendererJobs() const; + std::vector<Qt3DCore::QAspectJobPtr> createPreRendererJobs() const; + std::vector<Qt3DCore::QAspectJobPtr> createRenderBufferJobs() const; Render::AbstractRenderer *loadRendererPlugin(); bool processMouseEvent(QObject *obj, QMouseEvent *event); diff --git a/src/render/io/scenemanager.cpp b/src/render/io/scenemanager.cpp index 464871b48..5e3f4a507 100644 --- a/src/render/io/scenemanager.cpp +++ b/src/render/io/scenemanager.cpp @@ -72,13 +72,13 @@ void SceneManager::addSceneData(const QUrl &source, // We cannot run two jobs that use the same scene loader plugin // in two different threads at the same time - if (!m_pendingJobs.isEmpty()) - newJob->addDependency(m_pendingJobs.last()); + if (!m_pendingJobs.empty()) + newJob->addDependency(m_pendingJobs.back()); m_pendingJobs.push_back(newJob); } -QVector<LoadSceneJobPtr> SceneManager::takePendingSceneLoaderJobs() +std::vector<LoadSceneJobPtr> &&SceneManager::takePendingSceneLoaderJobs() { // Explicitly use std::move to clear the m_pendingJobs vector return std::move(m_pendingJobs); @@ -89,7 +89,7 @@ void SceneManager::startSceneDownload(const QUrl &source, Qt3DCore::QNodeId scen if (!m_service) return; SceneDownloaderPtr request = SceneDownloaderPtr::create(source, sceneUuid, this); - m_pendingDownloads << request; + m_pendingDownloads.push_back(request); m_service->submitRequest(request); } diff --git a/src/render/io/scenemanager_p.h b/src/render/io/scenemanager_p.h index badef2bf9..32c44cb6c 100644 --- a/src/render/io/scenemanager_p.h +++ b/src/render/io/scenemanager_p.h @@ -95,15 +95,15 @@ public: void addSceneData(const QUrl &source, Qt3DCore::QNodeId sceneUuid, const QByteArray &data = QByteArray()); - QVector<LoadSceneJobPtr> takePendingSceneLoaderJobs(); + std::vector<LoadSceneJobPtr> &&takePendingSceneLoaderJobs(); void startSceneDownload(const QUrl &source, Qt3DCore::QNodeId sceneUuid); void clearSceneDownload(SceneDownloader *downloader); private: Qt3DCore::QDownloadHelperService *m_service; - QVector<LoadSceneJobPtr> m_pendingJobs; - QVector<SceneDownloaderPtr> m_pendingDownloads; + std::vector<LoadSceneJobPtr> m_pendingJobs; + std::vector<SceneDownloaderPtr> m_pendingDownloads; }; } // namespace Render diff --git a/tests/auto/core/qaspectengine/tst_qaspectengine.cpp b/tests/auto/core/qaspectengine/tst_qaspectengine.cpp index dd06943f7..61e926352 100644 --- a/tests/auto/core/qaspectengine/tst_qaspectengine.cpp +++ b/tests/auto/core/qaspectengine/tst_qaspectengine.cpp @@ -62,11 +62,11 @@ private: qDebug() << Q_FUNC_INFO; } - QVector<QAspectJobPtr> jobsToExecute(qint64) override \ + std::vector<QAspectJobPtr> jobsToExecute(qint64) override \ { if (m_rootEntityId) qDebug() << Q_FUNC_INFO << m_rootEntityId; - return QVector<QAspectJobPtr>(); + return {}; } QNodeId m_rootEntityId; @@ -85,9 +85,9 @@ private: \ void onEngineStartup() override {} \ void onEngineShutdown() override {} \ \ - QVector<QAspectJobPtr> jobsToExecute(qint64) override \ + std::vector<QAspectJobPtr> jobsToExecute(qint64) override \ { \ - return QVector<QAspectJobPtr>(); \ + return std::vector<QAspectJobPtr>(); \ } \ \ QVariant executeCommand(const QStringList &args) override \ diff --git a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp index 97f9ca4fb..97b46000e 100644 --- a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp +++ b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp @@ -45,9 +45,9 @@ private: \ void onEngineStartup() override {} \ void onEngineShutdown() override {} \ \ - QVector<QAspectJobPtr> jobsToExecute(qint64) override \ + std::vector<QAspectJobPtr> jobsToExecute(qint64) override \ { \ - return QVector<QAspectJobPtr>(); \ + return std::vector<QAspectJobPtr>(); \ } \ }; diff --git a/tests/auto/core/qaspectjob/tst_qaspectjob.cpp b/tests/auto/core/qaspectjob/tst_qaspectjob.cpp index b5750e639..76c8b25f6 100644 --- a/tests/auto/core/qaspectjob/tst_qaspectjob.cpp +++ b/tests/auto/core/qaspectjob/tst_qaspectjob.cpp @@ -49,9 +49,9 @@ private Q_SLOTS: QAspectJobPtr job3(new FakeAspectJob); // THEN - QVERIFY(job1->dependencies().isEmpty()); - QVERIFY(job2->dependencies().isEmpty()); - QVERIFY(job3->dependencies().isEmpty()); + QVERIFY(job1->dependencies().empty()); + QVERIFY(job2->dependencies().empty()); + QVERIFY(job3->dependencies().empty()); // WHEN job1->addDependency(job2); @@ -61,8 +61,8 @@ private Q_SLOTS: QCOMPARE(job1->dependencies().size(), 2); QCOMPARE(job1->dependencies().at(0).lock(), job2); QCOMPARE(job1->dependencies().at(1).lock(), job3); - QVERIFY(job2->dependencies().isEmpty()); - QVERIFY(job3->dependencies().isEmpty()); + QVERIFY(job2->dependencies().empty()); + QVERIFY(job3->dependencies().empty()); } void shouldRemoveDependencies() diff --git a/tests/auto/core/qscheduler/tst_qscheduler.cpp b/tests/auto/core/qscheduler/tst_qscheduler.cpp index 29603c492..b3ef21c17 100644 --- a/tests/auto/core/qscheduler/tst_qscheduler.cpp +++ b/tests/auto/core/qscheduler/tst_qscheduler.cpp @@ -129,7 +129,7 @@ public: private: // QAbstractAspect interface - QVector<QAspectJobPtr> jobsToExecute(qint64) + std::vector<QAspectJobPtr> jobsToExecute(qint64) { return { m_first, m_second }; } diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp index 289f0b103..80ded339c 100644 --- a/tests/auto/core/threadpooler/tst_threadpooler.cpp +++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp @@ -209,7 +209,7 @@ void tst_ThreadPooler::defaultAspectQueue() // GIVEN QAtomicInt callCounter; int value = 0; // Not used in this test - QVector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; + std::vector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; callCounter.storeRelaxed(0); const int jobCount = 5; @@ -217,7 +217,7 @@ void tst_ThreadPooler::defaultAspectQueue() for (int i = 0; i < jobCount; i++) { QSharedPointer<TestAspectJob> job(new TestAspectJob(incrementFunctionCallCounter, &callCounter, &value)); - jobList.append(job); + jobList.push_back(job); } m_jobManager->enqueueJobs(jobList); m_jobManager->waitForAllJobs(); @@ -235,7 +235,7 @@ void tst_ThreadPooler::doubleAspectQueue() // GIVEN QAtomicInt callCounter; int value = 0; // Not used in this test - QVector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; + std::vector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; callCounter.storeRelaxed(0); const int jobCount = 3; @@ -243,15 +243,15 @@ void tst_ThreadPooler::doubleAspectQueue() for (int i = 0; i < jobCount; i++) { QSharedPointer<TestAspectJob> job(new TestAspectJob(incrementFunctionCallCounter, &callCounter, &value)); - jobList.append(job); + jobList.push_back(job); } m_jobManager->enqueueJobs(jobList); - QVector<QSharedPointer<Qt3DCore::QAspectJob> > jobList2; + std::vector<QSharedPointer<Qt3DCore::QAspectJob> > jobList2; for (int i = 0; i < jobCount; i++) { QSharedPointer<TestAspectJob> job(new TestAspectJob(incrementFunctionCallCounter, &callCounter, &value)); - jobList2.append(job); + jobList2.push_back(job); } m_jobManager->enqueueJobs(jobList2); @@ -269,14 +269,14 @@ void tst_ThreadPooler::dependencyAspectQueue() // GIVEN QAtomicInt callCounter; // Not used in this test int value = 2; - QVector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; + std::vector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; // WHEN QSharedPointer<TestAspectJob> job1(new TestAspectJob(add2, &callCounter, &value)); - jobList.append(job1); + jobList.push_back(job1); QSharedPointer<TestAspectJob> job2(new TestAspectJob(multiplyBy2, &callCounter, &value)); job2->addDependency(job1); - jobList.append(job2); + jobList.push_back(job2); m_jobManager->enqueueJobs(jobList); m_jobManager->waitForAllJobs(); @@ -289,7 +289,7 @@ void tst_ThreadPooler::massTest() { // GIVEN const int mass = 600; // 600 - QVector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; + std::vector<QSharedPointer<Qt3DCore::QAspectJob> > jobList; QVector3D data[3 * mass]; // WHEN @@ -298,13 +298,13 @@ void tst_ThreadPooler::massTest() for (int i = 0; i < mass; i++) { QSharedPointer<MassAspectJob> job1(new MassAspectJob(massTestFunction, &(data[i * 3 + 0]))); - jobList.append(job1); + jobList.push_back(job1); QSharedPointer<MassAspectJob> job2(new MassAspectJob(massTestFunction, &(data[i * 3 + 1]))); job2->addDependency(job1); - jobList.append(job2); + jobList.push_back(job2); QSharedPointer<MassAspectJob> job3(new MassAspectJob(massTestFunction, &(data[i * 3 + 2]))); job3->addDependency(job2); - jobList.append(job3); + jobList.push_back(job3); } m_jobManager->enqueueJobs(jobList); diff --git a/tests/auto/input/commons/testdevice.h b/tests/auto/input/commons/testdevice.h index a2ab4c1f8..37d115166 100644 --- a/tests/auto/input/commons/testdevice.h +++ b/tests/auto/input/commons/testdevice.h @@ -103,10 +103,10 @@ public: qDeleteAll(m_deviceBackendNodes); } - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) final + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) final { Q_UNUSED(time); - return QVector<Qt3DCore::QAspectJobPtr>(); + return std::vector<Qt3DCore::QAspectJobPtr>(); } TestDevice *createPhysicalDevice(const QString &name) final diff --git a/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp b/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp index de4875e0e..f1ae313e2 100644 --- a/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp +++ b/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp @@ -46,9 +46,9 @@ public: , m_name(name) {} - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) override + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) override { - return QVector<Qt3DCore::QAspectJobPtr>(); + return std::vector<Qt3DCore::QAspectJobPtr>(); } Qt3DInput::QAbstractPhysicalDevice *createPhysicalDevice(const QString &name) override diff --git a/tests/auto/input/utils/tst_utils.cpp b/tests/auto/input/utils/tst_utils.cpp index daa03efd9..e18e820c8 100644 --- a/tests/auto/input/utils/tst_utils.cpp +++ b/tests/auto/input/utils/tst_utils.cpp @@ -55,7 +55,7 @@ public: , m_device(device) {} - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) override { return QVector<Qt3DCore::QAspectJobPtr>(); } + std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) override { return std::vector<Qt3DCore::QAspectJobPtr>(); } Qt3DInput::QAbstractPhysicalDevice *createPhysicalDevice(const QString &) override { return nullptr; } QVector<Qt3DCore::QNodeId> physicalDevices() const override { return QVector<Qt3DCore::QNodeId>(); } QStringList deviceNames() const override { return QStringList(); } diff --git a/tests/auto/render/commons/testrenderer.h b/tests/auto/render/commons/testrenderer.h index 4ae74a74c..9f9837198 100644 --- a/tests/auto/render/commons/testrenderer.h +++ b/tests/auto/render/commons/testrenderer.h @@ -66,8 +66,8 @@ public: bool shouldRender() const override { return true; } void skipNextFrame() override {} void jobsDone(Qt3DCore::QAspectManager *manager) override { Q_UNUSED(manager); } - QVector<Qt3DCore::QAspectJobPtr> preRenderingJobs() override { return QVector<Qt3DCore::QAspectJobPtr>(); } - QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() override { return QVector<Qt3DCore::QAspectJobPtr>(); } + std::vector<Qt3DCore::QAspectJobPtr> preRenderingJobs() override { return {}; } + std::vector<Qt3DCore::QAspectJobPtr> renderBinJobs() override { return {}; } void setSceneRoot(Qt3DRender::Render::Entity *root) override { Q_UNUSED(root); } Qt3DRender::Render::Entity *sceneRoot() const override { return nullptr; } Qt3DRender::Render::FrameGraphNode *frameGraphRoot() const override { return nullptr; } diff --git a/tests/auto/render/opengl/renderer/tst_renderer.cpp b/tests/auto/render/opengl/renderer/tst_renderer.cpp index 1208fac2a..c0e2e39ea 100644 --- a/tests/auto/render/opengl/renderer/tst_renderer.cpp +++ b/tests/auto/render/opengl/renderer/tst_renderer.cpp @@ -73,7 +73,7 @@ private Q_SLOTS: QCoreApplication::processEvents(); // WHEN (nothing dirty, no buffers, no layers to be rebuilt, no materials to be rebuilt) - QVector<Qt3DCore::QAspectJobPtr> jobs = renderer.preRenderingJobs(); + std::vector<Qt3DCore::QAspectJobPtr> jobs = renderer.preRenderingJobs(); // THEN QCOMPARE(jobs.size(), 0); @@ -154,7 +154,7 @@ private Q_SLOTS: // n * (RenderViewCommandBuildJobs) // WHEN - QVector<Qt3DCore::QAspectJobPtr> jobs = renderer.renderBinJobs(); + std::vector<Qt3DCore::QAspectJobPtr> jobs = renderer.renderBinJobs(); // THEN -> AllDirty // (Renderer is not initialized so FilterCompatibleTechniqueJob diff --git a/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp b/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp index 846d21828..1582b92e6 100644 --- a/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp +++ b/tests/auto/render/opengl/renderviewbuilder/tst_renderviewbuilder.cpp @@ -197,6 +197,14 @@ Qt3DCore::QEntity *buildEntityFilterTestScene(Qt3DRender::QFrameGraphNode *fg, Q return root; } +bool containsDependency(const std::vector<QWeakPointer<Qt3DCore::QAspectJob>> &dependencies, + const Qt3DCore::QAspectJobPtr &dependency) +{ + return std::find(dependencies.begin(), + dependencies.end(), + dependency) != dependencies.end(); +} + } // anonymous @@ -318,7 +326,7 @@ private Q_SLOTS: // Step 2 QCOMPARE(renderViewBuilder.syncRenderViewPostInitializationJob()->dependencies().size(), 1); - QCOMPARE(renderViewBuilder.syncRenderViewPostInitializationJob()->dependencies().constFirst().toStrongRef().data(), + QCOMPARE(renderViewBuilder.syncRenderViewPostInitializationJob()->dependencies().front().toStrongRef().data(), renderViewBuilder.renderViewJob().data()); // Step 3 @@ -326,43 +334,43 @@ private Q_SLOTS: QVERIFY(renderViewBuilder.syncFilterEntityByLayerJob().isNull()); QCOMPARE(renderViewBuilder.filterProximityJob()->dependencies().size(), 2); - QVERIFY(renderViewBuilder.filterProximityJob()->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(renderViewBuilder.filterProximityJob()->dependencies().contains(expandBVJob)); + QVERIFY(containsDependency(renderViewBuilder.filterProximityJob()->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(renderViewBuilder.filterProximityJob()->dependencies(), expandBVJob)); QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().size(), 1); - QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().constFirst().toStrongRef().data(), + QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().front().toStrongRef().data(), renderViewBuilder.syncRenderViewPostInitializationJob().data()); QCOMPARE(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().size(), 3); - QVERIFY(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().contains(wordTransformJob)); - QVERIFY(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().contains(testAspect.renderer()->updateShaderDataTransformJob())); + QVERIFY(containsDependency(renderViewBuilder.syncPreFrustumCullingJob()->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(renderViewBuilder.syncPreFrustumCullingJob()->dependencies(), wordTransformJob)); + QVERIFY(containsDependency(renderViewBuilder.syncPreFrustumCullingJob()->dependencies(), testAspect.renderer()->updateShaderDataTransformJob())); // Step 4 QCOMPARE(renderViewBuilder.frustumCullingJob()->dependencies().size(), 2); - QVERIFY(renderViewBuilder.frustumCullingJob()->dependencies().contains(renderViewBuilder.syncPreFrustumCullingJob())); - QVERIFY(renderViewBuilder.frustumCullingJob()->dependencies().contains(expandBVJob)); + QVERIFY(containsDependency(renderViewBuilder.frustumCullingJob()->dependencies(), renderViewBuilder.syncPreFrustumCullingJob())); + QVERIFY(containsDependency(renderViewBuilder.frustumCullingJob()->dependencies(), expandBVJob)); QCOMPARE(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().size(), renderViewBuilder.materialGathererJobs().size() + 7); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(renderViewBuilder.filterProximityJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(renderViewBuilder.frustumCullingJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(testAspect.renderer()->introspectShadersJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(testAspect.renderer()->bufferGathererJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(testAspect.renderer()->textureGathererJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(testAspect.renderer()->lightGathererJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), renderViewBuilder.filterProximityJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), renderViewBuilder.frustumCullingJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), testAspect.renderer()->introspectShadersJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), testAspect.renderer()->bufferGathererJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), testAspect.renderer()->textureGathererJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), testAspect.renderer()->lightGathererJob())); // Step 5 for (const auto &renderViewBuilderJob : renderViewBuilder.renderViewCommandUpdaterJobs()) { QCOMPARE(renderViewBuilderJob->dependencies().size(), 1); - QCOMPARE(renderViewBuilderJob->dependencies().constFirst().toStrongRef().data(), + QCOMPARE(renderViewBuilderJob->dependencies().front().toStrongRef().data(), renderViewBuilder.syncRenderViewPreCommandUpdateJob().data()); } // Step 6 QCOMPARE(renderViewBuilder.syncRenderViewPostCommandUpdateJob()->dependencies().size(), renderViewBuilder.renderViewCommandUpdaterJobs().size()); for (const auto &renderViewBuilderJob : renderViewBuilder.renderViewCommandUpdaterJobs()) { - QVERIFY(renderViewBuilder.syncRenderViewPostCommandUpdateJob()->dependencies().contains(renderViewBuilderJob)); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPostCommandUpdateJob()->dependencies(), renderViewBuilderJob)); } } { @@ -379,62 +387,62 @@ private Q_SLOTS: // Step 2 QCOMPARE(renderViewBuilder.syncRenderViewPostInitializationJob()->dependencies().size(), 1); - QCOMPARE(renderViewBuilder.syncRenderViewPostInitializationJob()->dependencies().constFirst().toStrongRef().data(), + QCOMPARE(renderViewBuilder.syncRenderViewPostInitializationJob()->dependencies().front().toStrongRef().data(), renderViewBuilder.renderViewJob().data()); // Step 3 QCOMPARE(renderViewBuilder.filterEntityByLayerJob()->dependencies().size(), 3); - QVERIFY(renderViewBuilder.filterEntityByLayerJob()->dependencies().contains(updateEntityLayerJob)); - QVERIFY(renderViewBuilder.filterEntityByLayerJob()->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(renderViewBuilder.filterEntityByLayerJob()->dependencies().contains(updateTreeEnabledJob)); + QVERIFY(containsDependency(renderViewBuilder.filterEntityByLayerJob()->dependencies(), updateEntityLayerJob)); + QVERIFY(containsDependency(renderViewBuilder.filterEntityByLayerJob()->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(renderViewBuilder.filterEntityByLayerJob()->dependencies(), updateTreeEnabledJob)); QCOMPARE(renderViewBuilder.syncFilterEntityByLayerJob()->dependencies().size(), 1); - QVERIFY(renderViewBuilder.syncFilterEntityByLayerJob()->dependencies().contains(renderViewBuilder.filterEntityByLayerJob())); + QVERIFY(containsDependency(renderViewBuilder.syncFilterEntityByLayerJob()->dependencies(), renderViewBuilder.filterEntityByLayerJob())); QCOMPARE(renderViewBuilder.filterProximityJob()->dependencies().size(), 2); - QVERIFY(renderViewBuilder.filterProximityJob()->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(renderViewBuilder.filterProximityJob()->dependencies().contains(expandBVJob)); + QVERIFY(containsDependency(renderViewBuilder.filterProximityJob()->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(renderViewBuilder.filterProximityJob()->dependencies(), expandBVJob)); QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().size(), 1); - QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().constFirst().toStrongRef().data(), + QCOMPARE(renderViewBuilder.setClearDrawBufferIndexJob()->dependencies().front().toStrongRef().data(), renderViewBuilder.syncRenderViewPostInitializationJob().data()); QCOMPARE(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().size(), 3); - QVERIFY(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().contains(wordTransformJob)); - QVERIFY(renderViewBuilder.syncPreFrustumCullingJob()->dependencies().contains(testAspect.renderer()->updateShaderDataTransformJob())); + QVERIFY(containsDependency(renderViewBuilder.syncPreFrustumCullingJob()->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(renderViewBuilder.syncPreFrustumCullingJob()->dependencies(), wordTransformJob)); + QVERIFY(containsDependency(renderViewBuilder.syncPreFrustumCullingJob()->dependencies(), testAspect.renderer()->updateShaderDataTransformJob())); for (const auto &materialGatherer : renderViewBuilder.materialGathererJobs()) { QCOMPARE(materialGatherer->dependencies().size(), 3); - QVERIFY(materialGatherer->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(materialGatherer->dependencies().contains(testAspect.renderer()->introspectShadersJob())); - QVERIFY(materialGatherer->dependencies().contains(testAspect.renderer()->filterCompatibleTechniqueJob())); + QVERIFY(containsDependency(materialGatherer->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(materialGatherer->dependencies(), testAspect.renderer()->introspectShadersJob())); + QVERIFY(containsDependency(materialGatherer->dependencies(), testAspect.renderer()->filterCompatibleTechniqueJob())); } // Step 4 QCOMPARE(renderViewBuilder.frustumCullingJob()->dependencies().size(), 2); - QVERIFY(renderViewBuilder.frustumCullingJob()->dependencies().contains(renderViewBuilder.syncPreFrustumCullingJob())); - QVERIFY(renderViewBuilder.frustumCullingJob()->dependencies().contains(expandBVJob)); + QVERIFY(containsDependency(renderViewBuilder.frustumCullingJob()->dependencies(), renderViewBuilder.syncPreFrustumCullingJob())); + QVERIFY(containsDependency(renderViewBuilder.frustumCullingJob()->dependencies(), expandBVJob)); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(renderViewBuilder.syncRenderViewPostInitializationJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(renderViewBuilder.syncFilterEntityByLayerJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(renderViewBuilder.frustumCullingJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(renderViewBuilder.filterProximityJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(testAspect.renderer()->introspectShadersJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(testAspect.renderer()->bufferGathererJob())); - QVERIFY(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies().contains(testAspect.renderer()->textureGathererJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), renderViewBuilder.syncRenderViewPostInitializationJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), renderViewBuilder.syncFilterEntityByLayerJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), renderViewBuilder.frustumCullingJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), renderViewBuilder.filterProximityJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), testAspect.renderer()->introspectShadersJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), testAspect.renderer()->bufferGathererJob())); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPreCommandUpdateJob()->dependencies(), testAspect.renderer()->textureGathererJob())); // Step 5 for (const auto &renderViewBuilderJob : renderViewBuilder.renderViewCommandUpdaterJobs()) { QCOMPARE(renderViewBuilderJob->dependencies().size(), 1); - QCOMPARE(renderViewBuilderJob->dependencies().constFirst().toStrongRef().data(), + QCOMPARE(renderViewBuilderJob->dependencies().front().toStrongRef().data(), renderViewBuilder.syncRenderViewPreCommandUpdateJob().data()); } // Step 6 QCOMPARE(renderViewBuilder.syncRenderViewPostCommandUpdateJob()->dependencies().size(), renderViewBuilder.renderViewCommandUpdaterJobs().size()); for (const auto &renderViewBuilderJob : renderViewBuilder.renderViewCommandUpdaterJobs()) { - QVERIFY(renderViewBuilder.syncRenderViewPostCommandUpdateJob()->dependencies().contains(renderViewBuilderJob)); + QVERIFY(containsDependency(renderViewBuilder.syncRenderViewPostCommandUpdateJob()->dependencies(), renderViewBuilderJob)); } } } diff --git a/tests/auto/render/sceneloader/tst_sceneloader.cpp b/tests/auto/render/sceneloader/tst_sceneloader.cpp index 9efdd386c..b7bd8e1e6 100644 --- a/tests/auto/render/sceneloader/tst_sceneloader.cpp +++ b/tests/auto/render/sceneloader/tst_sceneloader.cpp @@ -51,7 +51,7 @@ private Q_SLOTS: // THEN QVERIFY(sceneLoader.source().isEmpty()); QVERIFY(sceneLoader.peerId().isNull()); - QVERIFY(sceneManager.takePendingSceneLoaderJobs().isEmpty()); + QVERIFY(sceneManager.takePendingSceneLoaderJobs().empty()); // GIVEN @@ -93,7 +93,7 @@ private Q_SLOTS: // THEN QCOMPARE(sceneLoader.peerId(), frontendSceneLoader.id()); QCOMPARE(sceneLoader.source(), frontendSceneLoader.source()); - QVERIFY(!sceneManager.takePendingSceneLoaderJobs().isEmpty()); + QVERIFY(!sceneManager.takePendingSceneLoaderJobs().empty()); } void checkPropertyChanges() @@ -109,7 +109,7 @@ private Q_SLOTS: simulateInitializationSync(&frontendSceneLoader, &sceneLoader); // THEN - QVERIFY(sceneManager.takePendingSceneLoaderJobs().isEmpty()); + QVERIFY(sceneManager.takePendingSceneLoaderJobs().empty()); // WHEN const QUrl newUrl(QStringLiteral("file:///Bownling_Green_KY")); @@ -118,7 +118,7 @@ private Q_SLOTS: // THEN QCOMPARE(sceneLoader.source(), newUrl); - QVERIFY(!sceneManager.takePendingSceneLoaderJobs().isEmpty()); + QVERIFY(!sceneManager.takePendingSceneLoaderJobs().empty()); // WHEN frontendSceneLoader.setEnabled(false); @@ -141,7 +141,7 @@ private Q_SLOTS: simulateInitializationSync(&frontendSceneLoader, &sceneLoader); // THEN - QVERIFY(sceneManager.takePendingSceneLoaderJobs().isEmpty()); + QVERIFY(sceneManager.takePendingSceneLoaderJobs().empty()); // WHEN const QUrl newUrl(QStringLiteral("file:///Bownling_Green_KY")); @@ -150,7 +150,7 @@ private Q_SLOTS: // THEN QCOMPARE(sceneLoader.source(), newUrl); - QVERIFY(!sceneManager.takePendingSceneLoaderJobs().isEmpty()); + QVERIFY(!sceneManager.takePendingSceneLoaderJobs().empty()); // WHEN frontendSceneLoader.setSource(QUrl()); @@ -158,7 +158,7 @@ private Q_SLOTS: // THEN -> we should still have generated a job to reset the scene (immediately) QCOMPARE(sceneLoader.source(), QUrl()); - QVERIFY(!sceneManager.takePendingSceneLoaderJobs().isEmpty()); + QVERIFY(!sceneManager.takePendingSceneLoaderJobs().empty()); } }; diff --git a/tests/benchmarks/render/jobs/tst_bench_jobs.cpp b/tests/benchmarks/render/jobs/tst_bench_jobs.cpp index 1e0747ce4..a8e43bd00 100644 --- a/tests/benchmarks/render/jobs/tst_bench_jobs.cpp +++ b/tests/benchmarks/render/jobs/tst_bench_jobs.cpp @@ -86,43 +86,43 @@ namespace Qt3DRender { } } - QVector<Qt3DCore::QAspectJobPtr> worldTransformJob() + std::vector<Qt3DCore::QAspectJobPtr> worldTransformJob() { auto renderer = static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer); auto daspect = Qt3DRender::QRenderAspectPrivate::get(renderer->aspect()); daspect->m_worldTransformJob->setRoot(d_func()->m_renderer->sceneRoot()); - return QVector<Qt3DCore::QAspectJobPtr>() << daspect->m_worldTransformJob; + return {daspect->m_worldTransformJob}; } - QVector<Qt3DCore::QAspectJobPtr> updateBoundingJob() + std::vector<Qt3DCore::QAspectJobPtr> updateBoundingJob() { auto renderer = static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer); auto daspect = Qt3DRender::QRenderAspectPrivate::get(renderer->aspect()); daspect->m_updateWorldBoundingVolumeJob->setManager(d_func()->m_renderer->nodeManagers()->renderNodesManager()); - return QVector<Qt3DCore::QAspectJobPtr>() << daspect->m_updateWorldBoundingVolumeJob; + return {daspect->m_updateWorldBoundingVolumeJob}; } - QVector<Qt3DCore::QAspectJobPtr> calculateBoundingVolumeJob() + std::vector<Qt3DCore::QAspectJobPtr> calculateBoundingVolumeJob() { auto renderer = static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer); auto daspect = Qt3DRender::QRenderAspectPrivate::get(renderer->aspect()); daspect->m_calculateBoundingVolumeJob->setRoot(d_func()->m_renderer->sceneRoot()); - return QVector<Qt3DCore::QAspectJobPtr>() << daspect->m_calculateBoundingVolumeJob; + return {daspect->m_calculateBoundingVolumeJob}; } - QVector<Qt3DCore::QAspectJobPtr> framePreparationJob() + std::vector<Qt3DCore::QAspectJobPtr> framePreparationJob() { static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer)->m_updateShaderDataTransformJob->setManagers(d_func()->m_renderer->nodeManagers()); - return QVector<Qt3DCore::QAspectJobPtr>() << static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer)->m_updateShaderDataTransformJob; + return {static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer)->m_updateShaderDataTransformJob}; } - QVector<Qt3DCore::QAspectJobPtr> frameCleanupJob() + std::vector<Qt3DCore::QAspectJobPtr> frameCleanupJob() { static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer)->m_cleanupJob->setRoot(d_func()->m_renderer->sceneRoot()); - return QVector<Qt3DCore::QAspectJobPtr>() << static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer)->m_cleanupJob; + return {static_cast<Render::OpenGL::Renderer *>(d_func()->m_renderer)->m_cleanupJob}; } - QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() + std::vector<Qt3DCore::QAspectJobPtr> renderBinJobs() { return d_func()->m_renderer->renderBinJobs(); } @@ -264,7 +264,7 @@ private Q_SLOTS: Qt3DCore::QAbstractAspectPrivate::get(&aspect)->setRootAndCreateNodes(qobject_cast<Qt3DCore::QEntity *>(rootEntity), {}); // WHEN - QVector<Qt3DCore::QAspectJobPtr> jobs = aspect.worldTransformJob(); + std::vector<Qt3DCore::QAspectJobPtr> jobs = aspect.worldTransformJob(); QBENCHMARK { Qt3DCore::QAbstractAspectPrivate::get(&aspect)->jobManager()->enqueueJobs(jobs); @@ -287,7 +287,7 @@ private Q_SLOTS: Qt3DCore::QAbstractAspectPrivate::get(&aspect)->setRootAndCreateNodes(qobject_cast<Qt3DCore::QEntity *>(rootEntity), {}); // WHEN - QVector<Qt3DCore::QAspectJobPtr> jobs = aspect.updateBoundingJob(); + std::vector<Qt3DCore::QAspectJobPtr> jobs = aspect.updateBoundingJob(); QBENCHMARK { Qt3DCore::QAbstractAspectPrivate::get(&aspect)->jobManager()->enqueueJobs(jobs); @@ -310,7 +310,7 @@ private Q_SLOTS: Qt3DCore::QAbstractAspectPrivate::get(&aspect)->setRootAndCreateNodes(qobject_cast<Qt3DCore::QEntity *>(rootEntity), {}); // WHEN - QVector<Qt3DCore::QAspectJobPtr> jobs = aspect.calculateBoundingVolumeJob(); + std::vector<Qt3DCore::QAspectJobPtr> jobs = aspect.calculateBoundingVolumeJob(); QBENCHMARK { Qt3DCore::QAbstractAspectPrivate::get(&aspect)->jobManager()->enqueueJobs(jobs); @@ -333,7 +333,7 @@ private Q_SLOTS: Qt3DCore::QAbstractAspectPrivate::get(&aspect)->setRootAndCreateNodes(qobject_cast<Qt3DCore::QEntity *>(rootEntity), {}); // WHEN - QVector<Qt3DCore::QAspectJobPtr> jobs = aspect.framePreparationJob(); + std::vector<Qt3DCore::QAspectJobPtr> jobs = aspect.framePreparationJob(); QBENCHMARK { Qt3DCore::QAbstractAspectPrivate::get(&aspect)->jobManager()->enqueueJobs(jobs); @@ -356,7 +356,7 @@ private Q_SLOTS: Qt3DCore::QAbstractAspectPrivate::get(&aspect)->setRootAndCreateNodes(qobject_cast<Qt3DCore::QEntity *>(rootEntity), {}); // WHEN - QVector<Qt3DCore::QAspectJobPtr> jobs = aspect.frameCleanupJob(); + std::vector<Qt3DCore::QAspectJobPtr> jobs = aspect.frameCleanupJob(); QBENCHMARK { Qt3DCore::QAbstractAspectPrivate::get(&aspect)->jobManager()->enqueueJobs(jobs); Qt3DCore::QAbstractAspectPrivate::get(&aspect)->jobManager()->waitForAllJobs(); |