summaryrefslogtreecommitdiffstats
path: root/src/render/backend
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2018-03-12 08:32:35 +0100
committerPaul Lemire <paul.lemire@kdab.com>2020-02-05 11:33:49 +0100
commit0e115ff000fb294de8519bf5b39beee0d6bfa605 (patch)
treec66c1f19ad5e4b7fc4f3be7951fa74d1d4df64bb /src/render/backend
parentf1f387c22dac8748a7edb1f4aa1ea6dac7dfbdfd (diff)
Make the OpenGL renderer a plugin
By default the QRenderAspect will try to load this plugin Change-Id: Ie55e207fb8e6d0b64f717bbb99699eb669eaa3f2 Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/render/backend')
-rw-r--r--src/render/backend/apishadermanager_p.h2
-rw-r--r--src/render/backend/attachmentpack_p.h5
-rw-r--r--src/render/backend/backendnode.cpp3
-rw-r--r--src/render/backend/cameralens.cpp3
-rw-r--r--src/render/backend/commandexecuter.cpp391
-rw-r--r--src/render/backend/commandexecuter_p.h95
-rw-r--r--src/render/backend/computecommand_p.h2
-rw-r--r--src/render/backend/entity_p.h4
-rw-r--r--src/render/backend/levelofdetail_p.h2
-rw-r--r--src/render/backend/managers_p.h62
-rw-r--r--src/render/backend/offscreensurfacehelper_p.h3
-rw-r--r--src/render/backend/platformsurfacefilter.cpp2
-rw-r--r--src/render/backend/platformsurfacefilter_p.h2
-rw-r--r--src/render/backend/qgraphicsutils_p.h410
-rw-r--r--src/render/backend/render-backend.pri5
-rw-r--r--src/render/backend/rendersettings_p.h2
-rw-r--r--src/render/backend/rendertarget_p.h2
-rw-r--r--src/render/backend/rendertargetoutput_p.h2
-rw-r--r--src/render/backend/renderthread_p.h4
-rw-r--r--src/render/backend/resourceaccessor.cpp1
-rw-r--r--src/render/backend/stringtoint_p.h3
-rw-r--r--src/render/backend/transform_p.h2
-rw-r--r--src/render/backend/uniform_p.h6
23 files changed, 59 insertions, 954 deletions
diff --git a/src/render/backend/apishadermanager_p.h b/src/render/backend/apishadermanager_p.h
index ec17b2196..9ebf49710 100644
--- a/src/render/backend/apishadermanager_p.h
+++ b/src/render/backend/apishadermanager_p.h
@@ -169,7 +169,7 @@ public:
return std::move(m_updatedShaders);
}
- QVector<Qt3DCore::QNodeId> shaderIdsForProgram(GLShader *glShader) const
+ QVector<Qt3DCore::QNodeId> shaderIdsForProgram(APIShader *glShader) const
{
QReadLocker lock(&m_readWriteLock);
return m_apiShaders.value(glShader);
diff --git a/src/render/backend/attachmentpack_p.h b/src/render/backend/attachmentpack_p.h
index a3a2586dd..32ea774b6 100644
--- a/src/render/backend/attachmentpack_p.h
+++ b/src/render/backend/attachmentpack_p.h
@@ -52,6 +52,7 @@
//
#include <Qt3DRender/qrendertargetoutput.h>
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <QVector>
QT_BEGIN_NAMESPACE
@@ -59,7 +60,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
namespace Render {
-struct Attachment
+struct Q_3DRENDERSHARED_PRIVATE_EXPORT Attachment
{
Attachment()
: m_mipLevel(0)
@@ -80,7 +81,7 @@ class RenderTarget;
class RenderTargetSelector;
class AttachmentManager;
-class AttachmentPack
+class Q_3DRENDERSHARED_PRIVATE_EXPORT AttachmentPack
{
public:
AttachmentPack();
diff --git a/src/render/backend/backendnode.cpp b/src/render/backend/backendnode.cpp
index f85ece1b9..18e7af256 100644
--- a/src/render/backend/backendnode.cpp
+++ b/src/render/backend/backendnode.cpp
@@ -38,10 +38,11 @@
****************************************************************************/
#include <private/backendnode_p.h>
-#include <private/renderer_p.h>
+#include <private/abstractrenderer_p.h>
#include <private/resourceaccessor_p.h>
#include <private/nodemanagers_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
+#include <Qt3DCore/qnode.h>
QT_BEGIN_NAMESPACE
diff --git a/src/render/backend/cameralens.cpp b/src/render/backend/cameralens.cpp
index e1d72efda..ab74e8b56 100644
--- a/src/render/backend/cameralens.cpp
+++ b/src/render/backend/cameralens.cpp
@@ -39,10 +39,11 @@
#include "cameralens_p.h"
#include <Qt3DRender/qcameralens.h>
+#include <Qt3DRender/qrenderaspect.h>
#include <Qt3DRender/private/nodemanagers_p.h>
#include <Qt3DRender/private/managers_p.h>
#include <Qt3DRender/private/renderlogging_p.h>
-#include <Qt3DRender/private/renderer_p.h>
+#include <Qt3DRender/private/abstractrenderer_p.h>
#include <Qt3DRender/private/entity_p.h>
#include <Qt3DRender/private/sphere_p.h>
#include <Qt3DRender/private/computefilteredboundingvolumejob_p.h>
diff --git a/src/render/backend/commandexecuter.cpp b/src/render/backend/commandexecuter.cpp
deleted file mode 100644
index 8e45fb924..000000000
--- a/src/render/backend/commandexecuter.cpp
+++ /dev/null
@@ -1,391 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "commandexecuter_p.h"
-
-#include <Qt3DRender/private/renderer_p.h>
-#include <Qt3DCore/private/qabstractaspect_p.h>
-#include <Qt3DCore/qbackendnode.h>
-#include <Qt3DRender/private/graphicscontext_p.h>
-#include <Qt3DRender/private/renderview_p.h>
-#include <Qt3DRender/private/rendercommand_p.h>
-#include <Qt3DRender/private/nodemanagers_p.h>
-#include <Qt3DRender/private/geometryrenderermanager_p.h>
-#include <Qt3DRender/private/stringtoint_p.h>
-#include <Qt3DRender/private/submissioncontext_p.h>
-#include <QJsonObject>
-#include <QJsonDocument>
-#include <QJsonArray>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DRender {
-
-namespace Debug {
-
-namespace {
-
-template<typename Type>
-QJsonObject typeToJsonObj(const Type &)
-{
- return QJsonObject();
-}
-
-template<typename Type>
-QJsonValue typeToJsonValue(const Type &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;
-
- value.push_back(rect.x());
- value.push_back(rect.y());
- value.push_back(rect.width());
- value.push_back(rect.height());
-
- return value;
-}
-
-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;
-
- value.push_back(s.width());
- value.push_back(s.height());
-
- return value;
-}
-
-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;
-
- value.push_back(v.x());
- value.push_back(v.y());
- value.push_back(v.z());
-
- return value;
-}
-
-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()));
- return value;
-}
-
-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;
-
- value.push_back(v.x());
- value.push_back(v.y());
- value.push_back(v.z());
- value.push_back(v.w());
-
- return value;
-}
-
-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;
-
- value.push_back(typeToJsonValue(v.row(0)));
- value.push_back(typeToJsonValue(v.row(1)));
- value.push_back(typeToJsonValue(v.row(2)));
- value.push_back(typeToJsonValue(v.row(3)));
-
- return value;
-}
-
-template<>
-QJsonValue typeToJsonValue<QVariant>(const QVariant &v)
-{
- const int nodeTypeId = qMetaTypeId<Qt3DCore::QNodeId>();
-
- if (v.userType() == nodeTypeId)
- return typeToJsonValue(v.value<Qt3DCore::QNodeId>());
-
- switch (v.userType()) {
- case QMetaType::QVector3D:
- return typeToJsonValue(v.value<QVector3D>());
- case QMetaType::QVector4D:
- return typeToJsonValue(v.value<QVector4D>());
- case QMetaType::QMatrix4x4:
- return typeToJsonValue(v.value<QMatrix4x4>());
- default:
- return QJsonValue::fromVariant(v);
- }
-}
-
-template<typename Handle, typename Manager>
-QJsonObject backendNodeToJSon(Handle handle, Manager *manager)
-{
- Qt3DCore::QBackendNode *node = manager->data(handle);
- QJsonObject obj;
- Qt3DCore::QNodeId id;
- if (node != nullptr)
- id = node->peerId();
- obj.insert(QLatin1String("id"), qint64(id.id()));
- return obj;
-}
-
-QJsonObject parameterPackToJson(const Render::ShaderParameterPack &pack)
-{
- QJsonObject obj;
-
- const Render::PackUniformHash &uniforms = pack.uniforms();
- QJsonArray uniformsArray;
- for (int i = 0, m = uniforms.keys.size(); i < m; ++i) {
- QJsonObject uniformObj;
- uniformObj.insert(QLatin1String("name"), Render::StringToInt::lookupString(uniforms.keys.at(i)));
- const Render::UniformValue::ValueType type = uniforms.values.at(i).valueType();
- uniformObj.insert(QLatin1String("type"),
- type == Render::UniformValue::ScalarValue
- ? QLatin1String("value")
- : QLatin1String("texture"));
- uniformsArray.push_back(uniformObj);
- }
- obj.insert(QLatin1String("uniforms"), uniformsArray);
-
- QJsonArray texturesArray;
- const QVector<Render::ShaderParameterPack::NamedResource> &textures = pack.textures();
- for (const auto & texture : textures) {
- QJsonObject textureObj;
- textureObj.insert(QLatin1String("name"), Render::StringToInt::lookupString(texture.glslNameId));
- textureObj.insert(QLatin1String("id"), qint64(texture.nodeId.id()));
- texturesArray.push_back(textureObj);
- }
- obj.insert(QLatin1String("textures"), texturesArray);
-
- const QVector<Render::BlockToUBO> &ubos = pack.uniformBuffers();
- QJsonArray ubosArray;
- for (const auto &ubo : ubos) {
- QJsonObject uboObj;
- uboObj.insert(QLatin1String("index"), ubo.m_blockIndex);
- uboObj.insert(QLatin1String("bufferId"), qint64(ubo.m_bufferID.id()));
- ubosArray.push_back(uboObj);
-
- }
- obj.insert(QLatin1String("ubos"), ubosArray);
-
- const QVector<Render::BlockToSSBO> &ssbos = pack.shaderStorageBuffers();
- QJsonArray ssbosArray;
- for (const auto &ssbo : ssbos) {
- QJsonObject ssboObj;
- ssboObj.insert(QLatin1String("index"), ssbo.m_blockIndex);
- ssboObj.insert(QLatin1String("bufferId"), qint64(ssbo.m_bufferID.id()));
- ssbosArray.push_back(ssboObj);
- }
- obj.insert(QLatin1String("ssbos"), ssbosArray);
-
- return obj;
-}
-
-} // anonymous
-
-CommandExecuter::CommandExecuter(Render::Renderer *renderer)
- : m_renderer(renderer)
-{
-}
-
-// Render thread
-void CommandExecuter::performAsynchronousCommandExecution(const QVector<Render::RenderView *> &views)
-{
- QMutexLocker lock(&m_pendingCommandsMutex);
- const QVector<Qt3DCore::Debug::AsynchronousCommandReply *> shellCommands = std::move(m_pendingCommands);
- lock.unlock();
-
- for (auto *reply : shellCommands) {
- if (reply->commandName() == QLatin1String("glinfo")) {
- QJsonObject replyObj;
- const GraphicsApiFilterData *contextInfo = m_renderer->submissionContext()->contextInfo();
- if (contextInfo != nullptr) {
- replyObj.insert(QLatin1String("api"),
- contextInfo->m_api == QGraphicsApiFilter::OpenGL
- ? QLatin1String("OpenGL")
- : QLatin1String("OpenGLES"));
- const QString versionString =
- QString::number(contextInfo->m_major)
- + QStringLiteral(".")
- + QString::number(contextInfo->m_minor);
- replyObj.insert(QLatin1String("version"), versionString);
- replyObj.insert(QLatin1String("profile"),
- contextInfo->m_profile == QGraphicsApiFilter::CoreProfile
- ? QLatin1String("Core")
- : contextInfo->m_profile == QGraphicsApiFilter::CompatibilityProfile
- ? QLatin1String("Compatibility")
- : QLatin1String("None"));
- }
- reply->setData(QJsonDocument(replyObj).toJson());
- } else if (reply->commandName() == QLatin1String("rendercommands")) {
- QJsonObject replyObj;
-
- QJsonArray viewArray;
- for (Render::RenderView *v : views) {
- QJsonObject viewObj;
- viewObj.insert(QLatin1String("viewport"), typeToJsonValue(v->viewport()));
- viewObj.insert(QLatin1String("surfaceSize"), typeToJsonValue(v->surfaceSize()));
- viewObj.insert(QLatin1String("devicePixelRatio"), v->devicePixelRatio());
- viewObj.insert(QLatin1String("noDraw"), v->noDraw());
- viewObj.insert(QLatin1String("frustumCulling"), v->frustumCulling());
- viewObj.insert(QLatin1String("compute"), v->isCompute());
- viewObj.insert(QLatin1String("clearDepthValue"), v->clearDepthValue());
- viewObj.insert(QLatin1String("clearStencilValue"), v->clearStencilValue());
-
- QJsonArray renderCommandsArray;
- for (const Render::RenderCommand &c : v->commands()) {
- QJsonObject commandObj;
- Render::NodeManagers *nodeManagers = m_renderer->nodeManagers();
- commandObj.insert(QLatin1String("shader"), int(c.m_shaderId.id()));
- commandObj.insert(QLatin1String("vao"), double(c.m_vao.handle()));
- commandObj.insert(QLatin1String("instanceCount"), c.m_instanceCount);
- commandObj.insert(QLatin1String("geometry"), backendNodeToJSon(c.m_geometry, nodeManagers->geometryManager()));
- commandObj.insert(QLatin1String("geometryRenderer"), backendNodeToJSon(c.m_geometryRenderer, nodeManagers->geometryRendererManager()));
- commandObj.insert(QLatin1String("shaderParameterPack"), parameterPackToJson(c.m_parameterPack));
-
- renderCommandsArray.push_back(commandObj);
- }
- viewObj.insert(QLatin1String("commands"), renderCommandsArray);
- viewArray.push_back(viewObj);
- }
-
- replyObj.insert(QLatin1String("renderViews"), viewArray);
- reply->setData(QJsonDocument(replyObj).toJson());
- }
- reply->setFinished(true);
- }
-}
-
-// Main thread
-QVariant CommandExecuter::executeCommand(const QStringList &args)
-{
- // Note: The replies will be deleted by the AspectCommandDebugger
- if (args.length() > 0 &&
- (args.first() == QLatin1String("glinfo") ||
- args.first() == QLatin1String("rendercommands"))) {
- auto reply = new Qt3DCore::Debug::AsynchronousCommandReply(args.first());
- QMutexLocker lock(&m_pendingCommandsMutex);
- m_pendingCommands.push_back(reply);
- return QVariant::fromValue(reply);
- }
- return QVariant();
-}
-
-} // Debug
-
-} // Qt3DRenderer
-
-QT_END_NAMESPACE
diff --git a/src/render/backend/commandexecuter_p.h b/src/render/backend/commandexecuter_p.h
deleted file mode 100644
index 2d90bf4d6..000000000
--- a/src/render/backend/commandexecuter_p.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DRENDER_DEBUG_COMMANDEXECUTER_H
-#define QT3DRENDER_DEBUG_COMMANDEXECUTER_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of other Qt classes. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QVector>
-#include <QVariant>
-#include <QMutex>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DCore {
-
-namespace Debug {
-class AsynchronousCommandReply;
-} // Debug
-
-} // Qt3DCore
-
-namespace Qt3DRender {
-
-namespace Render {
-class Renderer;
-class RenderView;
-} // Render
-
-namespace Debug {
-
-class CommandExecuter
-{
-public:
- explicit CommandExecuter(Render::Renderer *renderer);
-
- void performAsynchronousCommandExecution(const QVector<Render::RenderView *> &views);
-
- QVariant executeCommand(const QStringList &args);
-
-private:
- Render::Renderer *m_renderer;
- QVector<Qt3DCore::Debug::AsynchronousCommandReply *> m_pendingCommands;
- QMutex m_pendingCommandsMutex;
-};
-
-} // Debug
-
-} // Qt3DRender
-
-QT_END_NAMESPACE
-
-#endif // QT3DRENDER_DEBUG_COMMANDEXECUTER_H
diff --git a/src/render/backend/computecommand_p.h b/src/render/backend/computecommand_p.h
index 5012930ae..00e238474 100644
--- a/src/render/backend/computecommand_p.h
+++ b/src/render/backend/computecommand_p.h
@@ -62,7 +62,7 @@ namespace Render {
class ComputeJobPrivate;
-class Q_AUTOTEST_EXPORT ComputeCommand : public BackendNode
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ComputeCommand : public BackendNode
{
public:
ComputeCommand();
diff --git a/src/render/backend/entity_p.h b/src/render/backend/entity_p.h
index d13d96784..8ac10454e 100644
--- a/src/render/backend/entity_p.h
+++ b/src/render/backend/entity_p.h
@@ -53,7 +53,7 @@
//
#include <Qt3DRender/private/backendnode_p.h>
-#include <Qt3DRender/private/renderer_p.h>
+#include <Qt3DRender/private/abstractrenderer_p.h>
#include <Qt3DRender/private/handle_types_p.h>
#include <Qt3DCore/qnodecreatedchange.h>
#include <Qt3DCore/private/qentity_p.h>
@@ -81,7 +81,7 @@ class Renderer;
class NodeManagers;
class EntityPrivate;
-class Q_AUTOTEST_EXPORT Entity : public BackendNode
+class Q_3DRENDERSHARED_PRIVATE_EXPORT Entity : public BackendNode
{
public:
Entity();
diff --git a/src/render/backend/levelofdetail_p.h b/src/render/backend/levelofdetail_p.h
index 8399e19b7..b559b3114 100644
--- a/src/render/backend/levelofdetail_p.h
+++ b/src/render/backend/levelofdetail_p.h
@@ -67,7 +67,7 @@ namespace Render {
class LevelOfDetailManager;
-class Q_AUTOTEST_EXPORT LevelOfDetail : public BackendNode
+class Q_3DRENDERSHARED_PRIVATE_EXPORT LevelOfDetail : public BackendNode
{
public:
LevelOfDetail();
diff --git a/src/render/backend/managers_p.h b/src/render/backend/managers_p.h
index 24b161b6e..db12a8a7b 100644
--- a/src/render/backend/managers_p.h
+++ b/src/render/backend/managers_p.h
@@ -91,7 +91,7 @@ namespace Qt3DRender {
namespace Render {
-class AttachmentManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT AttachmentManager : public Qt3DCore::QResourceManager<
RenderTargetOutput,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -100,7 +100,7 @@ public:
AttachmentManager() {}
};
-class CameraManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT CameraManager : public Qt3DCore::QResourceManager<
CameraLens,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -109,7 +109,7 @@ public:
CameraManager() {}
};
-class FilterKeyManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT FilterKeyManager : public Qt3DCore::QResourceManager<
FilterKey,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -119,7 +119,7 @@ public:
FilterKeyManager() {}
};
-class EffectManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT EffectManager : public Qt3DCore::QResourceManager<
Effect,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -128,7 +128,7 @@ public:
EffectManager() {}
};
-class Q_AUTOTEST_EXPORT EntityManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT EntityManager : public Qt3DCore::QResourceManager<
Entity,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -146,7 +146,7 @@ public:
class FrameGraphNode;
-class Q_AUTOTEST_EXPORT FrameGraphManager
+class Q_3DRENDERSHARED_PRIVATE_EXPORT FrameGraphManager
{
public:
FrameGraphManager() {}
@@ -161,7 +161,7 @@ private:
QHash<Qt3DCore::QNodeId, FrameGraphNode*> m_nodes;
};
-class LayerManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT LayerManager : public Qt3DCore::QResourceManager<
Layer,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -170,7 +170,7 @@ public:
LayerManager() {}
};
-class LevelOfDetailManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT LevelOfDetailManager : public Qt3DCore::QResourceManager<
LevelOfDetail,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -179,7 +179,7 @@ public:
LevelOfDetailManager() {}
};
-class MaterialManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT MaterialManager : public Qt3DCore::QResourceManager<
Material,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -188,7 +188,7 @@ public:
MaterialManager() {}
};
-class MatrixManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT MatrixManager : public Qt3DCore::QResourceManager<
Matrix4x4,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -197,7 +197,7 @@ public:
MatrixManager() {}
};
-class ShaderManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ShaderManager : public Qt3DCore::QResourceManager<
Shader,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -221,7 +221,7 @@ private:
QVector<Qt3DCore::QNodeId> m_shaderIdsToCleanup;
};
-class ShaderBuilderManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ShaderBuilderManager : public Qt3DCore::QResourceManager<
ShaderBuilder,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -230,7 +230,7 @@ public:
ShaderBuilderManager() {}
};
-class TextureManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT TextureManager : public Qt3DCore::QResourceManager<
Texture,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -269,7 +269,7 @@ private:
QVector<Qt3DCore::QNodeId> m_textureIdsToCleanup;
};
-class TransformManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT TransformManager : public Qt3DCore::QResourceManager<
Transform,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -278,7 +278,7 @@ public:
TransformManager() {}
};
-class RenderTargetManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderTargetManager : public Qt3DCore::QResourceManager<
RenderTarget,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -287,7 +287,7 @@ public:
RenderTargetManager() {}
};
-class RenderPassManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderPassManager : public Qt3DCore::QResourceManager<
RenderPass,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -297,7 +297,7 @@ public:
};
-class ParameterManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ParameterManager : public Qt3DCore::QResourceManager<
Parameter,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -306,7 +306,7 @@ public:
ParameterManager() {}
};
-class ShaderImageManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ShaderImageManager : public Qt3DCore::QResourceManager<
ShaderImage,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -315,7 +315,7 @@ public:
ShaderImageManager() {}
};
-class ShaderDataManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ShaderDataManager : public Qt3DCore::QResourceManager<
ShaderData,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -324,35 +324,35 @@ public:
ShaderDataManager() {}
};
-class TextureImageManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT TextureImageManager : public Qt3DCore::QResourceManager<
TextureImage,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
{
};
-class AttributeManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT AttributeManager : public Qt3DCore::QResourceManager<
Attribute,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
{
};
-class GeometryManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT GeometryManager : public Qt3DCore::QResourceManager<
Geometry,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
{
};
-class ObjectPickerManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ObjectPickerManager : public Qt3DCore::QResourceManager<
ObjectPicker,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
{
};
-class RayCasterManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RayCasterManager : public Qt3DCore::QResourceManager<
RayCaster,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -368,7 +368,7 @@ class BoundingVolumeDebugManager : public Qt3DCore::QResourceManager<
};
#endif
-class LightManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT LightManager : public Qt3DCore::QResourceManager<
Light,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -377,7 +377,7 @@ public:
LightManager() {}
};
-class EnvironmentLightManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT EnvironmentLightManager : public Qt3DCore::QResourceManager<
EnvironmentLight,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -386,7 +386,7 @@ public:
EnvironmentLightManager() {}
};
-class ComputeCommandManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ComputeCommandManager : public Qt3DCore::QResourceManager<
ComputeCommand,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -395,21 +395,21 @@ public:
ComputeCommandManager() {}
};
-class RenderStateManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderStateManager : public Qt3DCore::QResourceManager<
RenderStateNode,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
{
};
-class ArmatureManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT ArmatureManager : public Qt3DCore::QResourceManager<
Armature,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
{
};
-class SkeletonManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT SkeletonManager : public Qt3DCore::QResourceManager<
Skeleton,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
@@ -428,7 +428,7 @@ private:
QVector<HSkeleton> m_dirtyTransformSkeletons;
};
-class JointManager : public Qt3DCore::QResourceManager<
+class Q_3DRENDERSHARED_PRIVATE_EXPORT JointManager : public Qt3DCore::QResourceManager<
Joint,
Qt3DCore::QNodeId,
Qt3DCore::NonLockingPolicy>
diff --git a/src/render/backend/offscreensurfacehelper_p.h b/src/render/backend/offscreensurfacehelper_p.h
index 8dc86d9a4..6ec82db2f 100644
--- a/src/render/backend/offscreensurfacehelper_p.h
+++ b/src/render/backend/offscreensurfacehelper_p.h
@@ -52,6 +52,7 @@
//
#include <QObject>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -62,7 +63,7 @@ namespace Render {
class AbstractRenderer;
-class Q_AUTOTEST_EXPORT OffscreenSurfaceHelper : public QObject
+class Q_3DRENDERSHARED_PRIVATE_EXPORT OffscreenSurfaceHelper : public QObject
{
Q_OBJECT
public:
diff --git a/src/render/backend/platformsurfacefilter.cpp b/src/render/backend/platformsurfacefilter.cpp
index 891e30c44..115fb637f 100644
--- a/src/render/backend/platformsurfacefilter.cpp
+++ b/src/render/backend/platformsurfacefilter.cpp
@@ -39,7 +39,7 @@
#include "platformsurfacefilter_p.h"
-#include <Qt3DRender/private/renderer_p.h>
+#include <Qt3DRender/private/abstractrenderer_p.h>
#include <QMetaObject>
#include <QPlatformSurfaceEvent>
diff --git a/src/render/backend/platformsurfacefilter_p.h b/src/render/backend/platformsurfacefilter_p.h
index 4fb43bae1..0bb425989 100644
--- a/src/render/backend/platformsurfacefilter_p.h
+++ b/src/render/backend/platformsurfacefilter_p.h
@@ -67,7 +67,7 @@ namespace Render {
class AbstractRenderer;
-class PlatformSurfaceFilter : public QObject
+class Q_3DRENDERSHARED_PRIVATE_EXPORT PlatformSurfaceFilter : public QObject
{
Q_OBJECT
diff --git a/src/render/backend/qgraphicsutils_p.h b/src/render/backend/qgraphicsutils_p.h
deleted file mode 100644
index 40ff99f0e..000000000
--- a/src/render/backend/qgraphicsutils_p.h
+++ /dev/null
@@ -1,410 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 QT3DRENDER_RENDER_QGRAPHICSUTILS_P_H
-#define QT3DRENDER_RENDER_QGRAPHICSUTILS_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of other Qt classes. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <Qt3DRender/qt3drender_global.h>
-#include <Qt3DRender/private/shadervariables_p.h>
-#include <QMatrix2x2>
-#include <QMatrix3x3>
-#include <QMatrix4x4>
-#include <QGenericMatrix>
-#include <QVector2D>
-#include <QVarLengthArray>
-#include <QColor>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DRender {
-
-namespace Render {
-
-namespace {
-
-const int QMatrix2x2Type = qMetaTypeId<QMatrix2x2>();
-const int QMatrix2x3Type = qMetaTypeId<QMatrix2x3>();
-const int QMatrix2x4Type = qMetaTypeId<QMatrix2x4>();
-const int QMatrix3x2Type = qMetaTypeId<QMatrix3x2>();
-const int QMatrix3x3Type = qMetaTypeId<QMatrix3x3>();
-const int QMatrix3x4Type = qMetaTypeId<QMatrix3x4>();
-const int QMatrix4x2Type = qMetaTypeId<QMatrix4x2>();
-const int QMatrix4x3Type = qMetaTypeId<QMatrix4x3>();
-
-}
-
-class QGraphicsUtils
-{
-
-public:
-
- template<typename T>
- static const char *bytesFromVariant(const QVariant &v)
- {
- uint byteSize = sizeof(T);
- // Max 16 float that we may want as doubles
- // 64 should be best for most cases
- static QVarLengthArray<char, 64> array(16 * byteSize);
- memset(array.data(), 0, array.size());
-
- switch (static_cast<QMetaType::Type>(v.type())) {
-
- // 1 byte
- case QMetaType::Bool: {
- T data = v.value<bool>();
- memcpy(array.data(), &data, byteSize);
- break;
- }
- case QMetaType::Char: {
- T data = v.value<char>();
- memcpy(array.data(), &data, byteSize);
- break;
- }
-
- // 4 bytes
- case QMetaType::Float: {
- T data = v.value<float>();
- memcpy(array.data(), &data, byteSize);
- break;
- }
- case QMetaType::Int: {
- T data = v.value<int>();
- memcpy(array.data(), &data, byteSize);
- break;
-
- }
- case QMetaType::UInt: {
- qDebug() << "UINT";
- T data = v.value<uint>();
- memcpy(array.data(), &data, byteSize);
- break;
- }
-
- // 8 bytes
- case QMetaType::Double: {
- T data = v.value<double>();
- memcpy(array.data(), &data, byteSize);
- break;
- }
-
- // 2 floats
- case QMetaType::QPointF: {
- QPointF vv = v.value<QPointF>();
- T data = vv.x();
- memcpy(array.data(), &data, byteSize);
- data = vv.y();
- memcpy(array.data() + byteSize, &data, byteSize);
- break;
- }
- case QMetaType::QSizeF: {
- QSizeF vv = v.value<QSizeF>();
- T data = vv.width();
- memcpy(array.data(), &data, byteSize);
- data = vv.height();
- memcpy(array.data() + byteSize, &data, byteSize);
- break;
- }
-
- case QMetaType::QVector2D: {
- QVector2D vv = v.value<QVector2D>();
- T data = vv.x();
- memcpy(array.data(), &data, byteSize);
- data = vv.y();
- memcpy(array.data() + byteSize, &data, byteSize);
- break;
- }
-
- // 2 ints
- case QMetaType::QPoint: {
- QPointF vv = v.value<QPoint>();
- T data = vv.x();
- memcpy(array.data(), &data, byteSize);
- data = vv.y();
- memcpy(array.data() + byteSize, &data, byteSize);
- break;
- }
-
- case QMetaType::QSize: {
- QSize vv = v.value<QSize>();
- T data = vv.width();
- memcpy(array.data(), &data, byteSize);
- data = vv.height();
- memcpy(array.data() + byteSize, &data, byteSize);
- break;
- }
-
- // 3 floats
- case QMetaType::QVector3D: {
- QVector3D vv = v.value<QVector3D>();
- T data = vv.x();
- memcpy(array.data(), &data, byteSize);
- data = vv.y();
- memcpy(array.data() + byteSize, &data, byteSize);
- data = vv.z();
- memcpy(array.data() + 2 * byteSize, &data, byteSize);
- break;
- }
-
- // 4 floats
- case QMetaType::QVector4D: {
- QVector4D vv = v.value<QVector4D>();
- T data = vv.x();
- memcpy(array.data(), &data, byteSize);
- data = vv.y();
- memcpy(array.data() + byteSize, &data, byteSize);
- data = vv.z();
- memcpy(array.data() + 2 * byteSize, &data, byteSize);
- data = vv.w();
- memcpy(array.data() + 3 * byteSize, &data, byteSize);
- break;
- }
-
- case QMetaType::QQuaternion: {
-
- break;
- }
-
- case QMetaType::QRectF: {
- QRectF vv = v.value<QRectF>();
- T data = vv.x();
- memcpy(array.data(), &data, byteSize);
- data = vv.y();
- memcpy(array.data() + byteSize, &data, byteSize);
- data = vv.width();
- memcpy(array.data() + 2 * byteSize, &data, byteSize);
- data = vv.height();
- memcpy(array.data() + 3 * byteSize, &data, byteSize);
- break;
- }
-
- case QMetaType::QColor: {
- QColor vv = v.value<QColor>();
- T data = vv.redF();
- memcpy(array.data(), &data, byteSize);
- data = vv.greenF();
- memcpy(array.data() + byteSize, &data, byteSize);
- data = vv.blueF();
- memcpy(array.data() + 2 * byteSize, &data, byteSize);
- data = vv.alphaF();
- memcpy(array.data() + 3 * byteSize, &data, byteSize);
- break;
- }
-
- // 4 ints
- case QMetaType::QRect: {
- QRectF vv = v.value<QRect>();
- T data = vv.x();
- memcpy(array.data(), &data, byteSize);
- data = vv.y();
- memcpy(array.data() + byteSize, &data, byteSize);
- data = vv.width();
- memcpy(array.data() + 2 * byteSize, &data, byteSize);
- data = vv.height();
- memcpy(array.data() + 3 * byteSize, &data, byteSize);
- break;
- }
-
- // 16 floats
- case QMetaType::QMatrix4x4: {
- QMatrix4x4 mat = v.value<QMatrix4x4>();
- float *data = mat.data();
- for (int i = 0; i < 16; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- break;
- }
-
- default: {
-
- float *data = nullptr;
- if (v.userType() == QMatrix3x3Type) {
- QMatrix3x3 mat = v.value<QMatrix3x3>();
- data = mat.data();
- for (int i = 0; i < 9; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else if (v.userType() == QMatrix2x2Type) {
- QMatrix2x2 mat = v.value<QMatrix2x2>();
- data = mat.data();
- for (int i = 0; i < 4; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else if (v.userType() == QMatrix2x3Type) {
- QMatrix2x3 mat = v.value<QMatrix2x3>();
- data = mat.data();
- for (int i = 0; i < 6; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else if (v.userType() == QMatrix3x2Type) {
- QMatrix3x2 mat = v.value<QMatrix3x2>();
- data = mat.data();
- for (int i = 0; i < 6; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else if (v.userType() == QMatrix2x4Type) {
- QMatrix2x4 mat = v.value<QMatrix2x4>();
- data = mat.data();
- for (int i = 0; i < 8; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else if (v.userType() == QMatrix4x2Type) {
- QMatrix4x2 mat = v.value<QMatrix4x2>();
- data = mat.data();
- for (int i = 0; i < 8; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else if (v.userType() == QMatrix3x4Type) {
- QMatrix3x4 mat = v.value<QMatrix3x4>();
- data = mat.data();
- for (int i = 0; i < 12; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else if (v.userType() == QMatrix4x3Type) {
- QMatrix4x3 mat = v.value<QMatrix4x3>();
- data = mat.data();
- for (int i = 0; i < 12; i++) {
- T d = data[i];
- memcpy(array.data() + i * byteSize, &d, byteSize);
- }
- }
- else
- qWarning() << Q_FUNC_INFO << "QVariant type conversion not handled for " << v.type();
- break;
- }
-
- }
- return array.constData();
- }
-
-
- template<typename T>
- static const T *valueArrayFromVariant(const QVariant &v, int count, int tupleSize)
- {
- uint byteSize = sizeof(T);
- uint offset = byteSize * tupleSize;
- static QVarLengthArray<char, 1024> uniformValuesArray(1024);
- uniformValuesArray.resize(count * offset);
- char *data = uniformValuesArray.data();
- memset(data, 0, uniformValuesArray.size());
-
- QVariantList vList = v.toList();
- // Handles list of QVariant: usually arrays of float
- if (!vList.isEmpty()) {
- for (int i = 0; i < vList.length() && uint(i) * offset < uint(uniformValuesArray.size()); i++) {
- const char *subBuffer = QGraphicsUtils::bytesFromVariant<T>(vList.at(i));
- memcpy(data + i * offset, subBuffer, offset);
- }
- }
- else {
- memcpy(data, QGraphicsUtils::bytesFromVariant<T>(v), offset);
- }
- return reinterpret_cast<const T *>(uniformValuesArray.constData());
- }
-
- template<typename T>
- static void fillDataArray(void *buffer, const T *data, const ShaderUniform &description, int tupleSize)
- {
- uint offset = description.m_offset / sizeof(T);
- uint stride = description.m_arrayStride / sizeof(T);
- T *bufferData = (T*)buffer;
-
- for (int i = 0; i < description.m_size; ++i) {
- for (int j = 0; j < tupleSize; j++) {
- int idx = i * tupleSize + j;
- bufferData[offset + j] = data[idx];
- }
- offset += stride;
- }
- }
-
- template<typename T>
- static void fillDataMatrixArray(void *buffer, const T *data, const ShaderUniform &description, int cols, int rows)
- {
- uint offset = description.m_offset / sizeof(T);
- uint arrayStride = description.m_arrayStride / sizeof(T);
- uint matrixStride = description.m_matrixStride / sizeof(T);
- T *bufferData = (T*)buffer;
-
- for (int i = 0; i < description.m_size; ++i) {
- for (int col = 0; col < cols; ++col) {
- for (int row = 0; row < rows; ++row) {
- int idx = i * cols * rows + rows * col + row;
- bufferData[offset + row] = data[idx];
- }
- offset += matrixStride;
- }
- offset += arrayStride;
- }
- }
-
-};
-
-} // namespace Render
-
-} // namespace Qt3DRender
-
-QT_END_NAMESPACE
-
-#endif // QT3DRENDER_RENDER_QGRAPHICSUTILS_P_H
diff --git a/src/render/backend/render-backend.pri b/src/render/backend/render-backend.pri
index 87083312f..2815ee0ab 100644
--- a/src/render/backend/render-backend.pri
+++ b/src/render/backend/render-backend.pri
@@ -5,7 +5,6 @@ HEADERS += \
$$PWD/parameterpack_p.h \
$$PWD/rendertarget_p.h \
$$PWD/attachmentpack_p.h \
- $$PWD/qgraphicsutils_p.h \
$$PWD/managers_p.h \
$$PWD/handle_types_p.h \
$$PWD/platformsurfacefilter_p.h \
@@ -38,7 +37,6 @@ HEADERS += \
$$PWD/visitorutils_p.h \
$$PWD/segmentsvisitor_p.h \
$$PWD/pointsvisitor_p.h \
- $$PWD/commandexecuter_p.h \
$$PWD/apishadermanager_p.h
SOURCES += \
@@ -69,5 +67,4 @@ SOURCES += \
$$PWD/offscreensurfacehelper.cpp \
$$PWD/resourceaccessor.cpp \
$$PWD/segmentsvisitor.cpp \
- $$PWD/pointsvisitor.cpp \
- $$PWD/commandexecuter.cpp
+ $$PWD/pointsvisitor.cpp
diff --git a/src/render/backend/rendersettings_p.h b/src/render/backend/rendersettings_p.h
index 317fca957..af1ee58ec 100644
--- a/src/render/backend/rendersettings_p.h
+++ b/src/render/backend/rendersettings_p.h
@@ -62,7 +62,7 @@ namespace Render {
class AbstractRenderer;
-class Q_AUTOTEST_EXPORT RenderSettings : public BackendNode
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderSettings : public BackendNode
{
public:
RenderSettings();
diff --git a/src/render/backend/rendertarget_p.h b/src/render/backend/rendertarget_p.h
index 30769dcfc..eeaf94940 100644
--- a/src/render/backend/rendertarget_p.h
+++ b/src/render/backend/rendertarget_p.h
@@ -65,7 +65,7 @@ namespace Render {
class RenderTargetManager;
-class Q_AUTOTEST_EXPORT RenderTarget : public BackendNode
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderTarget : public BackendNode
{
public:
RenderTarget();
diff --git a/src/render/backend/rendertargetoutput_p.h b/src/render/backend/rendertargetoutput_p.h
index d72f6d231..3a8828eeb 100644
--- a/src/render/backend/rendertargetoutput_p.h
+++ b/src/render/backend/rendertargetoutput_p.h
@@ -65,7 +65,7 @@ namespace Render {
class AttachmentManager;
-class RenderTargetOutput : public BackendNode
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderTargetOutput : public BackendNode
{
public:
RenderTargetOutput();
diff --git a/src/render/backend/renderthread_p.h b/src/render/backend/renderthread_p.h
index 56a7ec3bc..cdbb4f8c5 100644
--- a/src/render/backend/renderthread_p.h
+++ b/src/render/backend/renderthread_p.h
@@ -52,7 +52,7 @@
//
#include <QThread>
-
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <QtCore/QSemaphore>
QT_BEGIN_NAMESPACE
@@ -63,7 +63,7 @@ namespace Render {
class AbstractRenderer;
-class Q_AUTOTEST_EXPORT RenderThread : public QThread
+class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderThread : public QThread
{
Q_OBJECT
public:
diff --git a/src/render/backend/resourceaccessor.cpp b/src/render/backend/resourceaccessor.cpp
index 846caca58..ebc55c7ca 100644
--- a/src/render/backend/resourceaccessor.cpp
+++ b/src/render/backend/resourceaccessor.cpp
@@ -40,7 +40,6 @@
#include <private/qrendertargetoutput_p.h>
#include <private/nodemanagers_p.h>
-#include <private/glresourcemanagers_p.h>
#include <private/rendertargetoutput_p.h>
#include <private/managers_p.h>
diff --git a/src/render/backend/stringtoint_p.h b/src/render/backend/stringtoint_p.h
index 996cecf33..1aa6f0b08 100644
--- a/src/render/backend/stringtoint_p.h
+++ b/src/render/backend/stringtoint_p.h
@@ -54,6 +54,7 @@
#include <QVector>
#include <QString>
+#include <Qt3DRender/private/qt3drender_global_p.h>
QT_BEGIN_NAMESPACE
@@ -61,7 +62,7 @@ namespace Qt3DRender {
namespace Render {
-class Q_AUTOTEST_EXPORT StringToInt
+class Q_3DRENDERSHARED_PRIVATE_EXPORT StringToInt
{
public:
static int lookupId(const QString &str);
diff --git a/src/render/backend/transform_p.h b/src/render/backend/transform_p.h
index 8c0cd826a..3023a19d1 100644
--- a/src/render/backend/transform_p.h
+++ b/src/render/backend/transform_p.h
@@ -65,7 +65,7 @@ namespace Render {
class Renderer;
class TransformManager;
-class Q_AUTOTEST_EXPORT Transform : public BackendNode
+class Q_3DRENDERSHARED_PRIVATE_EXPORT Transform : public BackendNode
{
public:
Transform();
diff --git a/src/render/backend/uniform_p.h b/src/render/backend/uniform_p.h
index c8731637c..eb959923a 100644
--- a/src/render/backend/uniform_p.h
+++ b/src/render/backend/uniform_p.h
@@ -56,7 +56,7 @@
#include <Qt3DCore/private/matrix4x4_p.h>
#include <Qt3DCore/private/vector3d_p.h>
#include <Qt3DCore/private/vector4d_p.h>
-
+#include <Qt3DRender/private/qt3drender_global_p.h>
#include <QMatrix4x4>
#include <QVector2D>
#include <QVector3D>
@@ -105,7 +105,7 @@ enum UniformType {
Unknown
};
-class Q_AUTOTEST_EXPORT UniformValue
+class Q_3DRENDERSHARED_PRIVATE_EXPORT UniformValue
{
public:
enum ValueType {
@@ -238,7 +238,7 @@ private:
};
template<>
-Q_AUTOTEST_EXPORT void UniformValue::setData<QMatrix4x4>(const QVector<QMatrix4x4> &v);
+Q_3DRENDERSHARED_PRIVATE_EXPORT void UniformValue::setData<QMatrix4x4>(const QVector<QMatrix4x4> &v);
} // namespace Render
} // namespace Qt3DRender