summaryrefslogtreecommitdiffstats
path: root/src/plugins/renderers/opengl/renderer
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-02-26 13:51:23 +0000
committerMike Krus <mike.krus@kdab.com>2020-02-26 14:08:06 +0000
commit7f625e93620b313466d0223e911c0c3a5b492617 (patch)
tree22bc8ce1ab8fb82cf6fdb82062ad501982bc6f5f /src/plugins/renderers/opengl/renderer
parent6b4d0c1e55809c5a2e0b5d344dddf355dd983085 (diff)
Fix deprecations and warnings
In particular: - QHash::unite deprecated - QQuickWindow::createTextureFromId deprecated - also removed unused or deprecated code, and fixed out of order initialization Change-Id: Ia583654fcfcd654ca388575aa7716c282b134e33 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins/renderers/opengl/renderer')
-rw-r--r--src/plugins/renderers/opengl/renderer/commandexecuter.cpp72
-rw-r--r--src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp9
2 files changed, 8 insertions, 73 deletions
diff --git a/src/plugins/renderers/opengl/renderer/commandexecuter.cpp b/src/plugins/renderers/opengl/renderer/commandexecuter.cpp
index 03d5d5a7f..ff8ff3669 100644
--- a/src/plugins/renderers/opengl/renderer/commandexecuter.cpp
+++ b/src/plugins/renderers/opengl/renderer/commandexecuter.cpp
@@ -67,24 +67,11 @@ QJsonObject typeToJsonObj(const Type &)
template<typename Type>
QJsonValue typeToJsonValue(const Type &t)
{
- Q_UNUSED(t);
+ Q_UNUSED(t)
return QJsonValue();
}
template<>
-QJsonObject typeToJsonObj<QRectF>(const QRectF &rect)
-{
- QJsonObject obj;
-
- obj.insert(QLatin1String("x"), rect.x());
- obj.insert(QLatin1String("y"), rect.y());
- obj.insert(QLatin1String("width"), rect.width());
- obj.insert(QLatin1String("height"), rect.height());
-
- return obj;
-}
-
-template<>
QJsonValue typeToJsonValue<QRectF>(const QRectF &rect)
{
QJsonArray value;
@@ -98,17 +85,6 @@ QJsonValue typeToJsonValue<QRectF>(const QRectF &rect)
}
template<>
-QJsonObject typeToJsonObj<QSize>(const QSize &s)
-{
- QJsonObject obj;
-
- obj.insert(QLatin1String("width"), s.width());
- obj.insert(QLatin1String("height"), s.height());
-
- return obj;
-}
-
-template<>
QJsonValue typeToJsonValue<QSize>(const QSize &s)
{
QJsonArray value;
@@ -120,18 +96,6 @@ QJsonValue typeToJsonValue<QSize>(const QSize &s)
}
template<>
-QJsonObject typeToJsonObj<QVector3D>(const QVector3D &v)
-{
- QJsonObject obj;
-
- obj.insert(QLatin1String("x"), v.x());
- obj.insert(QLatin1String("y"), v.y());
- obj.insert(QLatin1String("z"), v.z());
-
- return obj;
-}
-
-template<>
QJsonValue typeToJsonValue<QVector3D>(const QVector3D &v)
{
QJsonArray value;
@@ -144,14 +108,6 @@ QJsonValue typeToJsonValue<QVector3D>(const QVector3D &v)
}
template<>
-QJsonObject typeToJsonObj<Qt3DCore::QNodeId>(const Qt3DCore::QNodeId &v)
-{
- QJsonObject obj;
- obj.insert(QLatin1String("id"), qint64(v.id()));
- return obj;
-}
-
-template<>
QJsonValue typeToJsonValue<Qt3DCore::QNodeId>(const Qt3DCore::QNodeId &v)
{
QJsonValue value(qint64(v.id()));
@@ -159,19 +115,6 @@ QJsonValue typeToJsonValue<Qt3DCore::QNodeId>(const Qt3DCore::QNodeId &v)
}
template<>
-QJsonObject typeToJsonObj<QVector4D>(const QVector4D &v)
-{
- QJsonObject obj;
-
- obj.insert(QLatin1String("x"), v.x());
- obj.insert(QLatin1String("y"), v.y());
- obj.insert(QLatin1String("z"), v.z());
- obj.insert(QLatin1String("w"), v.w());
-
- return obj;
-}
-
-template<>
QJsonValue typeToJsonValue<QVector4D>(const QVector4D &v)
{
QJsonArray value;
@@ -185,19 +128,6 @@ QJsonValue typeToJsonValue<QVector4D>(const QVector4D &v)
}
template<>
-QJsonObject typeToJsonObj<QMatrix4x4>(const QMatrix4x4 &v)
-{
- QJsonObject obj;
-
- obj.insert(QLatin1String("row 0"), typeToJsonObj(v.row(0)));
- obj.insert(QLatin1String("row 1"), typeToJsonObj(v.row(0)));
- obj.insert(QLatin1String("row 2"), typeToJsonObj(v.row(0)));
- obj.insert(QLatin1String("row 3"), typeToJsonObj(v.row(0)));
-
- return obj;
-}
-
-template<>
QJsonValue typeToJsonValue<QMatrix4x4>(const QMatrix4x4 &v)
{
QJsonArray value;
diff --git a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
index a80fbe445..a9713d2b9 100644
--- a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
@@ -441,8 +441,13 @@ public:
RendererCache::LeafNodeData &dataCacheForLeaf = m_renderer->cache()->leafNodeCache[m_leafNode];
dataCacheForLeaf.materialParameterGatherer.clear();
- for (const auto &materialGatherer : qAsConst(m_materialParameterGathererJobs))
- dataCacheForLeaf.materialParameterGatherer.unite(materialGatherer->materialToPassAndParameter());
+ for (const auto &materialGatherer : qAsConst(m_materialParameterGathererJobs)) {
+ const MaterialParameterGathererData &source = materialGatherer->materialToPassAndParameter();
+ for (auto it = std::begin(source); it != std::end(source); ++it) {
+ Q_ASSERT(!dataCacheForLeaf.materialParameterGatherer.contains(it.key()));
+ dataCacheForLeaf.materialParameterGatherer.insert(it.key(), it.value());
+ }
+ }
}
private: