From 250368c565ef9a40e3c0ebb646e45f04b5200e01 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 27 Sep 2016 16:43:29 +0200 Subject: remove pointless load(qt_build_paths) all .prf files that need the variables it sets actually load it by themselves. This reverts commit 3ec11e4d94d57678f4dd1162185beef62e43da12. Change-Id: Ia662f252b8215f83e090391748947a8579566885 Reviewed-by: Laszlo Agocs Reviewed-by: Sean Harmer --- tools/qgltf/qgltf.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/qgltf/qgltf.pro b/tools/qgltf/qgltf.pro index a61607204..c40016015 100644 --- a/tools/qgltf/qgltf.pro +++ b/tools/qgltf/qgltf.pro @@ -1,5 +1,4 @@ option(host_build) -!cross_compile:load(qt_build_paths) SOURCES = qgltf.cpp -- cgit v1.2.3 From 8c4b9eda3383a469ae47b8dedbf5093c5b4e10df Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 5 Oct 2016 09:12:31 +0200 Subject: GLTFIO: check return value of QFile::open() We checked that the file exists prior to opening it, but it could still be unreadable (due to permissions, e.g.), so check with QFile::open() and emit QFile::errorString() in case it goes wrong. Coverity-Id: 161328 Change-Id: I3489488023bb697d6cb9eee6be07c0edd923c478 Reviewed-by: Giuseppe D'Angelo --- src/plugins/sceneparsers/gltf/gltfparser.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/sceneparsers/gltf/gltfparser.cpp b/src/plugins/sceneparsers/gltf/gltfparser.cpp index 6bfca2b55..e42ebb510 100644 --- a/src/plugins/sceneparsers/gltf/gltfparser.cpp +++ b/src/plugins/sceneparsers/gltf/gltfparser.cpp @@ -196,13 +196,11 @@ bool GLTFParser::setJSON(const QJsonDocument &json ) void GLTFParser::setSource(const QUrl &source) { const QString path = QUrlHelper::urlToLocalFileOrQrc(source); - QFileInfo finfo(path); - if (!finfo.exists()) { - qCWarning(GLTFParserLog) << "missing file:" << path; + QFile f(path); + if (Q_UNLIKELY(!f.open(QIODevice::ReadOnly))) { + qCWarning(GLTFParserLog) << "cannot open " << path << ": " << f.errorString(); return; } - QFile f(path); - f.open(QIODevice::ReadOnly); QByteArray jsonData = f.readAll(); QJsonDocument sceneDocument = QJsonDocument::fromBinaryData(jsonData); @@ -214,7 +212,7 @@ void GLTFParser::setSource(const QUrl &source) return; } - setBasePath(finfo.dir().absolutePath()); + setBasePath(QFileInfo(path).dir().absolutePath()); } /*! -- cgit v1.2.3 From 1a5a3f92add2248fb8308bbc40e941d48db8e9b5 Mon Sep 17 00:00:00 2001 From: Milla Pohjanheimo Date: Tue, 18 Oct 2016 14:05:12 +0300 Subject: Merge fix for tst_renderqueue::concurrentQueueAccess autotest to 5.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test is failing in 5.6 also. Same as e8a691192d5646924453cd1c617eae1b3d2a93aa Task-number: QTBUG-53915 Change-Id: I8075c65abc96536c3fafad912c07b73aa6e0b2d7 Reviewed-by: Antti Määttä Reviewed-by: Paul Lemire --- tests/auto/render/renderqueue/tst_renderqueue.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/auto/render/renderqueue/tst_renderqueue.cpp b/tests/auto/render/renderqueue/tst_renderqueue.cpp index c571de2c0..daf672edd 100644 --- a/tests/auto/render/renderqueue/tst_renderqueue.cpp +++ b/tests/auto/render/renderqueue/tst_renderqueue.cpp @@ -145,9 +145,8 @@ class SimpleWorker : public QThread { Q_OBJECT public: - QWaitCondition m_waitTimeToSubmit; - QWaitCondition m_waitToFillQueue; - QMutex m_mutex; + QSemaphore m_waitSubmit; + QSemaphore m_waitQueue; Qt3DRender::Render::RenderQueue *m_renderQueues; public Q_SLOTS: @@ -155,9 +154,7 @@ public Q_SLOTS: void run() Q_DECL_FINAL // In Thread { for (int i = 0; i < 5; i++) { - QMutexLocker lock(&m_mutex); - m_waitToFillQueue.wait(&m_mutex); - lock.unlock(); + m_waitQueue.acquire(); QVERIFY(m_renderQueues->currentRenderViewCount() == 0); QVERIFY(!m_renderQueues->isFrameQueueComplete()); @@ -175,7 +172,7 @@ public Q_SLOTS: } QVERIFY(m_renderQueues->isFrameQueueComplete()); - m_waitTimeToSubmit.wakeOne(); + m_waitSubmit.release(); } } }; @@ -198,14 +195,10 @@ void tst_RenderQueue::concurrentQueueAccess() // Start thread jobsThread->start(); - QThread::msleep(500); // To be sure the thread is properly started - - jobsThread->m_waitToFillQueue.wakeAll(); + jobsThread->m_waitQueue.release(); for (int i = 0; i < 5; ++i) { - QMutexLocker lock(&jobsThread->m_mutex); - jobsThread->m_waitTimeToSubmit.wait(&jobsThread->m_mutex); - lock.unlock(); + jobsThread->m_waitSubmit.acquire(); // WHEN unlocked // THEN @@ -214,7 +207,7 @@ void tst_RenderQueue::concurrentQueueAccess() // reset queue for next frame renderQueue->reset(); - jobsThread->m_waitToFillQueue.wakeAll(); + jobsThread->m_waitQueue.release(); } jobsThread->wait(); } -- cgit v1.2.3 From b949f984e286c7a34132fbd97301186826dcc7fa Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 5 Oct 2016 09:51:53 +0200 Subject: QRenderAspect: remove misleading check The check of d->m_renderer against nullptr follows an unconditional deref of the same pointer with no intervening code. It must therefore be always true. Remove it. That done, m_renderer _is_ nullptr after the ctor ran, and before the dtor runs (there's a check), so maybe the code should at least assert the existence of m_renderer before using it. Coverity-Id: 156307 Change-Id: Iacf2c09db1c0a5a55a67cfb6ef2a00652e557d09 Reviewed-by: Paul Lemire --- src/render/frontend/qrenderaspect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp index b5d5ef780..2561a6c60 100644 --- a/src/render/frontend/qrenderaspect.cpp +++ b/src/render/frontend/qrenderaspect.cpp @@ -316,7 +316,7 @@ QVector QRenderAspect::jobsToExecute(qint64 time) // 7 Cleanup Job (depends on RV) // Create jobs to load in any meshes that are pending - if (d->m_renderer != Q_NULLPTR && d->m_renderer->isRunning()) { + if (d->m_renderer->isRunning()) { Render::NodeManagers *manager = d->m_renderer->nodeManagers(); QAspectJobPtr pickBoundingVolumeJob = d->m_renderer->pickBoundingVolumeJob(); -- cgit v1.2.3 From 8206e216c1e9fbe3fd5c7c221d2e471523fd76f7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 5 Oct 2016 10:35:30 +0200 Subject: QFixedFrameAllocator: Extract Method scan() The old code used indices to detect when it fell off the end of m_chunks and needed to allocate a new chunk, but this was opaque to Coverity, which saw the potential for m_lastAllocatedChunk == nullptr at the end of the function, and thus reported a nullptr deref there. Fix by moving the scanning of m_chunks into a new method, scan(), which more clearly communicates that it never returns nullptr, not least because it returns by reference instead of pointer. Coverity-Id: 154279 Change-Id: I0cfe8fd819bbfc5b03a98b5e9354c0e98a521d34 Reviewed-by: Paul Lemire --- src/core/resources/qframeallocator.cpp | 39 ++++++++++++++++++-------------- src/core/resources/qframeallocator_p_p.h | 3 +++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/core/resources/qframeallocator.cpp b/src/core/resources/qframeallocator.cpp index d2527000d..6eb904014 100644 --- a/src/core/resources/qframeallocator.cpp +++ b/src/core/resources/qframeallocator.cpp @@ -144,25 +144,30 @@ void QFixedFrameAllocator::init(uint blockSize, uchar pageSize) void *QFixedFrameAllocator::allocate() { - Q_ASSERT(m_blockSize && m_nbrBlock); - if (m_lastAllocatedChunck == Q_NULLPTR || - m_lastAllocatedChunck->m_blocksAvailable == 0) { - int i = 0; - for (; i < m_chunks.size(); i++) { - if (m_chunks[i].m_blocksAvailable > 0) { - m_lastAllocatedChunck = m_chunks.begin() + i; - break; - } - } - if (i == m_chunks.size()) { - m_chunks.resize(m_chunks.size() + 1); - QFrameChunk &newChunk = m_chunks.last(); - newChunk.init(m_blockSize, m_nbrBlock); - m_lastAllocatedChunck = &newChunk; - m_lastFreedChunck = m_lastAllocatedChunck; + Q_ASSERT(m_blockSize); + return scan().allocate(m_blockSize); +} + +QFrameChunk &QFixedFrameAllocator::scan() +{ + Q_ASSERT(m_blockSize); + Q_ASSERT(m_nbrBlock); + + if (m_lastAllocatedChunck && m_lastAllocatedChunck->m_blocksAvailable) + return *m_lastAllocatedChunck; + + for (int i = 0; i < m_chunks.size(); i++) { + if (m_chunks[i].m_blocksAvailable > 0) { + m_lastAllocatedChunck = m_chunks.begin() + i; + return *m_lastAllocatedChunck; } } - return m_lastAllocatedChunck->allocate(m_blockSize); + m_chunks.resize(m_chunks.size() + 1); + QFrameChunk &newChunk = m_chunks.last(); + newChunk.init(m_blockSize, m_nbrBlock); + m_lastAllocatedChunck = &newChunk; + m_lastFreedChunck = &newChunk; + return newChunk; } void QFixedFrameAllocator::deallocate(void *ptr) diff --git a/src/core/resources/qframeallocator_p_p.h b/src/core/resources/qframeallocator_p_p.h index 3e6cdf4d8..2dea2dc23 100644 --- a/src/core/resources/qframeallocator_p_p.h +++ b/src/core/resources/qframeallocator_p_p.h @@ -92,6 +92,9 @@ public: inline uchar pageSize() const { return m_nbrBlock; } inline uint blockSize() const { return m_blockSize; } +private: + QFrameChunk &scan(); + private: uint m_blockSize; uchar m_nbrBlock; -- cgit v1.2.3 From 6c248da9fc6715ed5bf26cb4105792e0b0964da0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 Nov 2016 18:12:01 +0100 Subject: remove dependencies from sync.profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the CI obtains them from the qt5 super repo nowadays. Change-Id: If4ad33246234c8d579e6c4f8c3acd9e5981de0ec Reviewed-by: Sean Harmer Reviewed-by: Jędrzej Nowacki --- sync.profile | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sync.profile b/sync.profile index f30e4f81a..e871e6771 100644 --- a/sync.profile +++ b/sync.profile @@ -12,16 +12,3 @@ # Force generation of camel case headers for classes inside Qt3D* namespaces $publicclassregexp = "Qt3D.*::.+"; - -# Module dependencies. -# Every module that is required to build this module should have one entry. -# Each of the module version specifiers can take one of the following values: -# - A specific Git revision. -# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) -# -%dependencies = ( - "qtbase" => "", - "qtxmlpatterns" => "", - "qtdeclarative" => "", - "qtimageformats" => "", -); -- cgit v1.2.3