summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2016-02-17 17:53:42 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-03-09 13:19:39 +0000
commitc042228267dc4bb05ee3e6d53074c7218d1e7054 (patch)
treeaacbe10f48912e9324526e64d722377143d542cc
parent807a25d74550faf42ed79dfe234b5f1ce3380cf4 (diff)
Drop QFrameGraph in favor of QRenderSettings
QFrameGraph did store just the Frame Graph Root, and was not configurable at runtime. This functionality has been moved to QRenderSettings. The renderer now gets the scene graph root directly from QRenderSettings. Change-Id: I3012eb96b8073717f96f5e42374859a3f4a89bfc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--examples/qt3d/cylinder-qml/main.qml2
-rw-r--r--examples/qt3d/examples-common/qt3dquickwindow.cpp12
-rw-r--r--examples/qt3d/examples-common/qt3dwindow.cpp16
-rw-r--r--examples/qt3d/examples-common/qt3dwindow.h4
-rw-r--r--src/quick3d/imports/render/qt3dquick3drenderplugin.cpp2
-rw-r--r--src/quick3d/imports/scene3d/scene3ditem.cpp12
-rw-r--r--src/render/backend/abstractrenderer_p.h1
-rw-r--r--src/render/backend/renderer.cpp23
-rw-r--r--src/render/backend/renderer_p.h2
-rw-r--r--src/render/backend/rendersettings.cpp6
-rw-r--r--src/render/backend/rendersettings_p.h3
-rw-r--r--src/render/framegraph/framegraph.pri3
-rw-r--r--src/render/framegraph/framegraphnode.cpp28
-rw-r--r--src/render/framegraph/framegraphnode_p.h12
-rw-r--r--src/render/framegraph/qframegraph.cpp146
-rw-r--r--src/render/framegraph/qframegraph.h86
-rw-r--r--src/render/framegraph/qframegraph_p.h78
-rw-r--r--src/render/frontend/qrenderaspect.cpp2
-rw-r--r--src/render/frontend/qrendersettings.cpp22
-rw-r--r--src/render/frontend/qrendersettings.h7
-rw-r--r--src/render/frontend/qrendersettings_p.h1
-rw-r--r--tests/auto/render/commons/testrenderer.h1
-rw-r--r--tests/auto/render/qframegraph/qframegraph.pro10
-rw-r--r--tests/auto/render/qframegraph/tst_qframegraph.cpp184
-rw-r--r--tests/auto/render/render.pro1
-rw-r--r--tests/benchmarks/render/jobs/tst_bench_jobs.cpp9
26 files changed, 69 insertions, 604 deletions
diff --git a/examples/qt3d/cylinder-qml/main.qml b/examples/qt3d/cylinder-qml/main.qml
index 05779fa08..8f4ba27f0 100644
--- a/examples/qt3d/cylinder-qml/main.qml
+++ b/examples/qt3d/cylinder-qml/main.qml
@@ -69,7 +69,7 @@ Entity {
FirstPersonCameraController { camera: camera }
- FrameGraph {
+ RendererSettings {
id : external_forward_renderer
activeFrameGraph : ForwardRenderer {
camera: camera
diff --git a/examples/qt3d/examples-common/qt3dquickwindow.cpp b/examples/qt3d/examples-common/qt3dquickwindow.cpp
index f43df0bd8..72e10c34e 100644
--- a/examples/qt3d/examples-common/qt3dquickwindow.cpp
+++ b/examples/qt3d/examples-common/qt3dquickwindow.cpp
@@ -52,7 +52,7 @@
#include <Qt3DQuick/QQmlAspectEngine>
#include <Qt3DRender/qcamera.h>
#include <Qt3DRender/qrenderaspect.h>
-#include <Qt3DRender/qframegraph.h>
+#include <Qt3DRender/qrendersettings.h>
#include <Qt3DRender/qrendersurfaceselector.h>
#include <Qt3DInput/qinputaspect.h>
#include <Qt3DInput/qinputsettings.h>
@@ -193,14 +193,14 @@ void Qt3DQuickWindow::setWindowSurface(QObject *rootObject)
{
// Find surface selector in framegraph and set ourselves up as the
// render surface there
- Qt3DRender::QFrameGraph *frameGraphComponent
- = rootObject->findChild<Qt3DRender::QFrameGraph *>();
- if (!frameGraphComponent) {
- qWarning() << "No frame graph component found";
+ Qt3DRender::QRenderSettings *rendererSettings
+ = rootObject->findChild<Qt3DRender::QRenderSettings *>();
+ if (!rendererSettings) {
+ qWarning() << "No renderer settings component found";
return;
}
- Qt3DCore::QNode *frameGraphRoot = frameGraphComponent->activeFrameGraph();
+ Qt3DCore::QNode *frameGraphRoot = rendererSettings->activeFrameGraph();
if (!frameGraphRoot) {
qWarning() << "No active frame graph found";
return;
diff --git a/examples/qt3d/examples-common/qt3dwindow.cpp b/examples/qt3d/examples-common/qt3dwindow.cpp
index 9d24e3204..9644042c0 100644
--- a/examples/qt3d/examples-common/qt3dwindow.cpp
+++ b/examples/qt3d/examples-common/qt3dwindow.cpp
@@ -51,7 +51,7 @@
#include "qt3dwindow.h"
#include <Qt3DRender/qforwardrenderer.h>
-#include <Qt3DRender/qframegraph.h>
+#include <Qt3DRender/qrendersettings.h>
#include <Qt3DRender/qrenderaspect.h>
#include <Qt3DInput/qinputaspect.h>
#include <Qt3DInput/qinputsettings.h>
@@ -71,7 +71,7 @@ Qt3DWindow::Qt3DWindow(QScreen *screen)
, m_renderAspect(new Qt3DRender::QRenderAspect)
, m_inputAspect(new Qt3DInput::QInputAspect)
, m_logicAspect(new Qt3DLogic::QLogicAspect)
- , m_frameGraph(new Qt3DRender::QFrameGraph)
+ , m_rendererSettings(new Qt3DRender::QRenderSettings)
, m_forwardRenderer(new Qt3DRender::QForwardRenderer)
, m_defaultCamera(new Qt3DRender::QCamera)
, m_inputSettings(new Qt3DInput::QInputSettings)
@@ -100,7 +100,7 @@ Qt3DWindow::Qt3DWindow(QScreen *screen)
m_forwardRenderer->setCamera(m_defaultCamera);
m_forwardRenderer->setSurface(this);
- m_frameGraph->setActiveFrameGraph(m_forwardRenderer);
+ m_rendererSettings->setActiveFrameGraph(m_forwardRenderer);
m_inputSettings->setEventSource(this);
}
@@ -111,7 +111,7 @@ Qt3DWindow::Qt3DWindow(QWindow *parent)
, m_renderAspect(new Qt3DRender::QRenderAspect)
, m_inputAspect(new Qt3DInput::QInputAspect)
, m_logicAspect(new Qt3DLogic::QLogicAspect)
- , m_frameGraph(new Qt3DRender::QFrameGraph)
+ , m_rendererSettings(new Qt3DRender::QRenderSettings)
, m_defaultCamera(new Qt3DRender::QCamera)
, m_inputSettings(new Qt3DInput::QInputSettings)
, m_root(new Qt3DCore::QEntity)
@@ -139,7 +139,7 @@ Qt3DWindow::Qt3DWindow(QWindow *parent)
m_forwardRenderer->setCamera(m_defaultCamera);
m_forwardRenderer->setSurface(this);
- m_frameGraph->setActiveFrameGraph(m_forwardRenderer);
+ m_rendererSettings->setActiveFrameGraph(m_forwardRenderer);
m_inputSettings->setEventSource(this);
}
@@ -168,12 +168,12 @@ void Qt3DWindow::setRootEntity(Qt3DCore::QEntity *root)
void Qt3DWindow::setActiveFrameGraph(Qt3DRender::QFrameGraphNode *activeFrameGraph)
{
- m_frameGraph->setActiveFrameGraph(activeFrameGraph);
+ m_rendererSettings->setActiveFrameGraph(activeFrameGraph);
}
Qt3DRender::QFrameGraphNode *Qt3DWindow::activeFrameGraph() const
{
- return m_frameGraph->activeFrameGraph();
+ return m_rendererSettings->activeFrameGraph();
}
Qt3DRender::QForwardRenderer *Qt3DWindow::defaultFramegraph() const
@@ -192,7 +192,7 @@ void Qt3DWindow::showEvent(QShowEvent *e)
if (m_userRoot != nullptr)
m_userRoot->setParent(m_root);
- m_root->addComponent(m_frameGraph);
+ m_root->addComponent(m_rendererSettings);
m_root->addComponent(m_inputSettings);
m_aspectEngine->setRootEntity(Qt3DCore::QEntityPtr(m_root));
diff --git a/examples/qt3d/examples-common/qt3dwindow.h b/examples/qt3d/examples-common/qt3dwindow.h
index fad0ace11..48ba487e8 100644
--- a/examples/qt3d/examples-common/qt3dwindow.h
+++ b/examples/qt3d/examples-common/qt3dwindow.h
@@ -63,10 +63,10 @@ class QEntity;
namespace Qt3DRender {
class QCamera;
-class QFrameGraph;
class QFrameGraphNode;
class QForwardRenderer;
class QRenderAspect;
+class QRenderSettings;
}
namespace Qt3DInput {
@@ -114,7 +114,7 @@ private:
Qt3DLogic::QLogicAspect *m_logicAspect;
// Renderer configuration
- Qt3DRender::QFrameGraph *m_frameGraph;
+ Qt3DRender::QRenderSettings *m_rendererSettings;
Qt3DRender::QForwardRenderer *m_forwardRenderer;
Qt3DRender::QCamera *m_defaultCamera;
diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
index ee78b0060..065a9f196 100644
--- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
+++ b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
@@ -50,7 +50,6 @@
#include <Qt3DRender/qrendertargetselector.h>
#include <Qt3DRender/qrendersurfaceselector.h>
#include <Qt3DRender/qtexture.h>
-#include <Qt3DRender/qframegraph.h>
#include <Qt3DRender/qtechnique.h>
#include <Qt3DRender/qcameraselector.h>
#include <Qt3DRender/qeffect.h>
@@ -273,7 +272,6 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<Qt3DRender::QFrameGraphNode>(uri, 2, 0, "FrameGraphNode", QStringLiteral("FrameGraphNode is a base class"));
Qt3DRender::Quick::registerExtendedType<Qt3DRender::QRenderStateSet, Qt3DRender::Render::Quick::Quick3DStateSet>("QRenderStateSet", "Qt3D.Render/RenderStateSet", uri, 2, 0, "RenderStateSet");
qmlRegisterType<Qt3DRender::QNoDraw>(uri, 2, 0, "NoDraw");
- qmlRegisterType<Qt3DRender::QFrameGraph>(uri, 2, 0, "FrameGraph");
qmlRegisterType<Qt3DRender::QFrustumCulling>(uri, 2, 0, "FrustumCulling");
qmlRegisterType<Qt3DRender::QLighting>(uri, 2, 0, "Lighting");
qmlRegisterType<Qt3DRender::QDispatchCompute>(uri, 2, 0, "DispatchCompute");
diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp
index bc6c83610..457a38316 100644
--- a/src/quick3d/imports/scene3d/scene3ditem.cpp
+++ b/src/quick3d/imports/scene3d/scene3ditem.cpp
@@ -47,8 +47,8 @@
#include <Qt3DCore/qentity.h>
#include <Qt3DRender/qcamera.h>
#include <Qt3DRender/QRenderAspect>
-#include <Qt3DRender/qframegraph.h>
#include <Qt3DRender/qrendersurfaceselector.h>
+#include <Qt3DRender/qrendersettings.h>
#include <Qt3DInput/QInputAspect>
#include <Qt3DInput/qinputsettings.h>
@@ -192,14 +192,14 @@ void Scene3DItem::setWindowSurface(QObject *rootObject)
{
// Find surface selector in framegraph and set ourselves up as the
// render surface there
- Qt3DRender::QFrameGraph *frameGraphComponent
- = rootObject->findChild<Qt3DRender::QFrameGraph *>();
- if (!frameGraphComponent) {
- qWarning() << "No frame graph component found";
+ Qt3DRender::QRenderSettings *renderSettings
+ = rootObject->findChild<Qt3DRender::QRenderSettings *>();
+ if (!renderSettings) {
+ qWarning() << "No renderer settings component found";
return;
}
- Qt3DCore::QNode *frameGraphRoot = frameGraphComponent->activeFrameGraph();
+ Qt3DCore::QNode *frameGraphRoot = renderSettings->activeFrameGraph();
if (!frameGraphRoot) {
qWarning() << "No active frame graph found";
return;
diff --git a/src/render/backend/abstractrenderer_p.h b/src/render/backend/abstractrenderer_p.h
index 92ff9e456..900c43dea 100644
--- a/src/render/backend/abstractrenderer_p.h
+++ b/src/render/backend/abstractrenderer_p.h
@@ -133,7 +133,6 @@ public:
virtual QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() = 0;
virtual Qt3DCore::QAspectJobPtr pickBoundingVolumeJob() = 0;
- virtual void setFrameGraphRoot(const Qt3DCore::QNodeId fgRootId) = 0;
virtual void setSceneRoot(Qt3DCore::QBackendNodeFactory *factory, Entity *root) = 0;
virtual Entity *sceneRoot() const = 0;
diff --git a/src/render/backend/renderer.cpp b/src/render/backend/renderer.cpp
index 65301850e..12cdaf8be 100644
--- a/src/render/backend/renderer.cpp
+++ b/src/render/backend/renderer.cpp
@@ -107,8 +107,6 @@ namespace Render {
const QString SCENE_PARSERS_PATH = QStringLiteral("/sceneparsers");
-const RenderSettings Renderer::ms_defaultSettings;
-
/*!
\internal
@@ -144,7 +142,7 @@ Renderer::Renderer(QRenderAspect::RenderType type)
, m_glContext(Q_NULLPTR)
, m_pickBoundingVolumeJob(Q_NULLPTR)
, m_time(0)
- , m_settings(const_cast<RenderSettings *>(&ms_defaultSettings))
+ , m_settings(Q_NULLPTR)
{
// Set renderer as running - it will wait in the context of the
// RenderThread for RenderViews to be submitted
@@ -155,9 +153,6 @@ Renderer::Renderer(QRenderAspect::RenderType type)
Renderer::~Renderer()
{
- // CLean up settings if not using defaults
- if (m_settings != &ms_defaultSettings)
- delete m_settings;
delete m_renderQueue;
}
@@ -377,15 +372,10 @@ void Renderer::setSurfaceExposed(bool exposed)
m_exposed.fetchAndStoreOrdered(exposed);
}
-void Renderer::setFrameGraphRoot(const Qt3DCore::QNodeId fgRootId)
-{
- m_frameGraphRootUuid = fgRootId;
- qCDebug(Backend) << Q_FUNC_INFO << m_frameGraphRootUuid;
-}
-
Render::FrameGraphNode *Renderer::frameGraphRoot() const
{
- return m_nodesManager->frameGraphManager()->lookupNode(m_frameGraphRootUuid);
+ Q_ASSERT(m_settings);
+ return m_nodesManager->frameGraphManager()->lookupNode(m_settings->activeFrameGraphID());
}
// QAspectThread context
@@ -443,12 +433,7 @@ void Renderer::registerEventFilter(QEventFilterService *service)
void Renderer::setSettings(RenderSettings *settings)
{
- // If default settings not in use, clean up
- if (m_settings != &ms_defaultSettings)
- delete m_settings;
-
- // If removing settings, restore to default
- m_settings = (settings != Q_NULLPTR) ? settings : const_cast<RenderSettings *>(&ms_defaultSettings);
+ m_settings = settings;
}
RenderSettings *Renderer::settings() const
diff --git a/src/render/backend/renderer_p.h b/src/render/backend/renderer_p.h
index 4ead7e979..3afc84236 100644
--- a/src/render/backend/renderer_p.h
+++ b/src/render/backend/renderer_p.h
@@ -149,7 +149,6 @@ public:
void setSceneRoot(Qt3DCore::QBackendNodeFactory *factory, Entity *sgRoot) Q_DECL_OVERRIDE;
Entity *sceneRoot() const Q_DECL_OVERRIDE { return m_renderSceneRoot; }
- void setFrameGraphRoot(const Qt3DCore::QNodeId fgRootId) Q_DECL_OVERRIDE;
FrameGraphNode *frameGraphRoot() const Q_DECL_OVERRIDE;
void markDirty(BackendNodeDirtySet changes, BackendNode *node) Q_DECL_OVERRIDE;
@@ -266,7 +265,6 @@ private:
qint64 m_time;
RenderSettings *m_settings;
- static const RenderSettings ms_defaultSettings;
void performDraw(GeometryRenderer *rGeometryRenderer,
GLsizei primitiveCount, Attribute *indexAttribute);
diff --git a/src/render/backend/rendersettings.cpp b/src/render/backend/rendersettings.cpp
index e51379e5a..ff7e48f0b 100644
--- a/src/render/backend/rendersettings.cpp
+++ b/src/render/backend/rendersettings.cpp
@@ -40,6 +40,7 @@
#include "rendersettings_p.h"
#include <Qt3DCore/qscenepropertychange.h>
+#include <Qt3DRender/QFrameGraphNode>
#include <Qt3DRender/private/abstractrenderer_p.h>
QT_BEGIN_NAMESPACE
@@ -59,12 +60,14 @@ void RenderSettings::updateFromPeer(Qt3DCore::QNode *peer)
QRenderSettings *settings = static_cast<QRenderSettings *>(peer);
m_pickMethod = settings->pickMethod();
m_pickResultMode = settings->pickResultMode();
+ m_activeFrameGraph = settings->activeFrameGraph()->id();
}
void RenderSettings::cleanup()
{
m_pickMethod = QRenderSettings::BoundingVolumePicking;
m_pickResultMode = QRenderSettings::NearestPick;
+ m_activeFrameGraph = Qt3DCore::QNodeId();
}
void RenderSettings::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
@@ -75,11 +78,12 @@ void RenderSettings::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
m_pickMethod = propertyChange->value().value<QRenderSettings::PickMethod>();
else if (propertyChange->propertyName() == QByteArrayLiteral("pickResult"))
m_pickResultMode = propertyChange->value().value<QRenderSettings::PickResultMode>();
+ else if (propertyChange->propertyName() == QByteArrayLiteral("activeFrameGraph"))
+ m_activeFrameGraph = propertyChange->value().value<QNodePtr>()->id();
markDirty(AbstractRenderer::AllDirty);
}
}
-
RenderSettingsFunctor::RenderSettingsFunctor(AbstractRenderer *renderer)
: m_renderer(renderer)
{
diff --git a/src/render/backend/rendersettings_p.h b/src/render/backend/rendersettings_p.h
index fdca3e0bc..1e63e1f44 100644
--- a/src/render/backend/rendersettings_p.h
+++ b/src/render/backend/rendersettings_p.h
@@ -70,9 +70,12 @@ public:
void cleanup();
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE;
+ Qt3DCore::QNodeId activeFrameGraphID() const { return m_activeFrameGraph; }
+
private:
QRenderSettings::PickMethod m_pickMethod;
QRenderSettings::PickResultMode m_pickResultMode;
+ Qt3DCore::QNodeId m_activeFrameGraph;
};
class RenderSettingsFunctor : public Qt3DCore::QBackendNodeMapper
diff --git a/src/render/framegraph/framegraph.pri b/src/render/framegraph/framegraph.pri
index 490c7ff3e..27a644850 100644
--- a/src/render/framegraph/framegraph.pri
+++ b/src/render/framegraph/framegraph.pri
@@ -12,8 +12,6 @@ HEADERS += \
$$PWD/qcameraselector_p.h \
$$PWD/qclearbuffer.h \
$$PWD/qclearbuffer_p.h \
- $$PWD/qframegraph.h \
- $$PWD/qframegraph_p.h \
$$PWD/qframegraphnode.h \
$$PWD/qframegraphnode_p.h \
$$PWD/qframegraphselector.h \
@@ -63,7 +61,6 @@ SOURCES += \
$$PWD/nodraw.cpp \
$$PWD/qcameraselector.cpp \
$$PWD/qclearbuffer.cpp \
- $$PWD/qframegraph.cpp \
$$PWD/qframegraphnode.cpp \
$$PWD/qframegraphselector.cpp \
$$PWD/qlayerfilter.cpp \
diff --git a/src/render/framegraph/framegraphnode.cpp b/src/render/framegraph/framegraphnode.cpp
index 2ba4d61fa..b1b5256d6 100644
--- a/src/render/framegraph/framegraphnode.cpp
+++ b/src/render/framegraph/framegraphnode.cpp
@@ -40,7 +40,6 @@
#include "framegraphnode_p.h"
#include <Qt3DRender/private/renderer_p.h>
#include <Qt3DRender/private/nodemanagers_p.h>
-#include <Qt3DRender/qframegraph.h>
QT_BEGIN_NAMESPACE
@@ -137,33 +136,6 @@ QList<FrameGraphNode *> FrameGraphNode::children() const
return children;
}
-// TO DO: We need to rework that and probably add a RenderFrameGraph element
-FrameGraphComponentFunctor::FrameGraphComponentFunctor(AbstractRenderer *renderer)
- : m_renderer(renderer)
-{
-}
-
-Qt3DCore::QBackendNode *FrameGraphComponentFunctor::create(Qt3DCore::QNode *frontend) const
-{
- // TO DO: Ideally we should have a RenderFrameGraph component and use its setPeer method
- // to do that
- QFrameGraph *framegraph = static_cast<QFrameGraph *>(frontend);
- if (framegraph->activeFrameGraph() != Q_NULLPTR)
- m_renderer->setFrameGraphRoot(framegraph->activeFrameGraph()->id());
- return Q_NULLPTR;
-}
-
-Qt3DCore::QBackendNode *FrameGraphComponentFunctor::get(Qt3DCore::QNodeId id) const
-{
- Q_UNUSED(id);
- return Q_NULLPTR;
-}
-
-void FrameGraphComponentFunctor::destroy(Qt3DCore::QNodeId id) const
-{
- Q_UNUSED(id);
-}
-
} // namespace Render
} // namespace Qt3DRender
diff --git a/src/render/framegraph/framegraphnode_p.h b/src/render/framegraph/framegraphnode_p.h
index d22977acb..b79563136 100644
--- a/src/render/framegraph/framegraphnode_p.h
+++ b/src/render/framegraph/framegraphnode_p.h
@@ -173,18 +173,6 @@ private:
AbstractRenderer *m_renderer;
};
-class FrameGraphComponentFunctor : public Qt3DCore::QBackendNodeMapper
-{
-public:
- explicit FrameGraphComponentFunctor(AbstractRenderer *renderer);
- Qt3DCore::QBackendNode *create(Qt3DCore::QNode *frontend) const Q_DECL_OVERRIDE;
- Qt3DCore::QBackendNode *get(Qt3DCore::QNodeId id) const Q_DECL_OVERRIDE;
- void destroy(Qt3DCore::QNodeId id) const Q_DECL_OVERRIDE;
-
-private:
- AbstractRenderer *m_renderer;
-};
-
} // namespace Render
} // namespace Qt3DRender
diff --git a/src/render/framegraph/qframegraph.cpp b/src/render/framegraph/qframegraph.cpp
deleted file mode 100644
index 9b18b2cd4..000000000
--- a/src/render/framegraph/qframegraph.cpp
+++ /dev/null
@@ -1,146 +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$
-**
-****************************************************************************/
-
-#include "qframegraph.h"
-#include "qframegraph_p.h"
-#include <Qt3DCore/qentity.h>
-#include <Qt3DRender/qframegraphnode.h>
-#include <Qt3DRender/private/qframegraphnode_p.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DRender {
-
-QFrameGraphPrivate::QFrameGraphPrivate()
- : QComponentPrivate()
- , m_activeFrameGraph(Q_NULLPTR)
-{
-
-}
-
-/*!
- \class Qt3DRender::QFrameGraph
- \inmodule Qt3DRender
- \since 5.3
-
- \brief Defines the rendering method to be used by the renderer.
-
- QFrameGraph is the Component that has an activeFrameGraph property
- that should reference the root FrameGraphItem of a frame graph
- tree. The Entity that contains a FrameGraph property defines the
- rendering method to be used by the renderer.
-
- \note Only one FrameGraph can be active at any moment.
- */
-
-/*!
- \qmltype FrameGraph
- \instantiates Qt3DRender::QFrameGraph
- \inherits Component3D
- \inqmlmodule Qt3D.Render
- \since 5.5
- \brief For OpenGL ...
-*/
-
-/*!
- \fn void Qt3DRender::QFrameGraph::copy(const Qt3DCore::QNode *ref)
-
- Copies the \a ref instance into this one.
- */
-void QFrameGraph::copy(const QNode *ref)
-{
- QComponent::copy(ref);
- const QFrameGraph *other = static_cast<const QFrameGraph*>(ref);
- setActiveFrameGraph(qobject_cast<QFrameGraphNode *>(QNode::clone(other->d_func()->m_activeFrameGraph)));
-}
-
-/*!
- \fn Qt3DRender::QFrameGraph::QFrameGraph(Qt3DCore::QNode *parent)
-
- Constructs a new QFrameGraph with the specified \a parent.
-*/
-QFrameGraph::QFrameGraph(QNode *parent)
- : QComponent(*new QFrameGraphPrivate, parent)
-{
-}
-
-QFrameGraph::~QFrameGraph()
-{
- QNode::cleanup();
-}
-
-/*! \internal */
-QFrameGraph::QFrameGraph(QFrameGraphPrivate &dd, QNode *parent)
- : QComponent(dd, parent)
-{
-}
-
-/*!
- \qmlproperty FrameGraphNode Qt3D.Render::FrameGraph::activeFrameGraph
-
- Holds the current activeFrameGraph root node.
-*/
-
-/*!
- \property Qt3DRender::QFrameGraph::activeFrameGraph
-
- Holds the current activeFrameGraph root node.
- */
-QFrameGraphNode *QFrameGraph::activeFrameGraph() const
-{
- Q_D(const QFrameGraph);
- return d->m_activeFrameGraph;
-}
-
-void QFrameGraph::setActiveFrameGraph(QFrameGraphNode *activeFrameGraph)
-{
- Q_D(QFrameGraph);
- if (activeFrameGraph != d->m_activeFrameGraph) {
-
- if (activeFrameGraph != Q_NULLPTR && !activeFrameGraph->parent())
- activeFrameGraph->setParent(this);
-
- d->m_activeFrameGraph = activeFrameGraph;
- emit activeFrameGraphChanged(activeFrameGraph);
- }
-}
-
-} // namespace Qt3DRender
-
-QT_END_NAMESPACE
diff --git a/src/render/framegraph/qframegraph.h b/src/render/framegraph/qframegraph.h
deleted file mode 100644
index 3a81a6a9e..000000000
--- a/src/render/framegraph/qframegraph.h
+++ /dev/null
@@ -1,86 +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_QFRAMEGRAPH_H
-#define QT3DRENDER_QFRAMEGRAPH_H
-
-#include <Qt3DRender/qt3drender_global.h>
-#include <Qt3DCore/qcomponent.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DRender {
-
-class QFrameGraphPrivate;
-class QFrameGraphNode;
-
-class QT3DRENDERSHARED_EXPORT QFrameGraph : public Qt3DCore::QComponent
-{
- Q_OBJECT
- // Note : The full namespace has to be used to define the property
- // otherwise this results in an error "cannot assign object to property"
- Q_PROPERTY(Qt3DRender::QFrameGraphNode *activeFrameGraph READ activeFrameGraph WRITE setActiveFrameGraph NOTIFY activeFrameGraphChanged)
- Q_CLASSINFO("DefaultProperty", "activeFrameGraph")
-
-public:
- explicit QFrameGraph(Qt3DCore::QNode *parent = 0);
- ~QFrameGraph();
-
- QFrameGraphNode *activeFrameGraph() const;
-
-public Q_SLOTS:
- void setActiveFrameGraph(QFrameGraphNode *activeFrameGraph);
-
-Q_SIGNALS:
- void activeFrameGraphChanged(QFrameGraphNode *activeFrameGraph);
-
-protected:
- QFrameGraph(QFrameGraphPrivate &dd, Qt3DCore::QNode *parent = 0);
- void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE;
-
-private:
- Q_DECLARE_PRIVATE(QFrameGraph)
- QT3D_CLONEABLE(QFrameGraph)
-};
-
-} // namespace Qt3DRender
-
-QT_END_NAMESPACE
-
-#endif // QT3DRENDER_QFRAMEGRAPH_H
diff --git a/src/render/framegraph/qframegraph_p.h b/src/render/framegraph/qframegraph_p.h
deleted file mode 100644
index de2fd966a..000000000
--- a/src/render/framegraph/qframegraph_p.h
+++ /dev/null
@@ -1,78 +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_QFRAMEGRAPH_P_H
-#define QT3DRENDER_QFRAMEGRAPH_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 <Qt3DCore/qt3dcore_global.h>
-#include <private/qcomponent_p.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DRender {
-
-class QFrameGraph;
-class QFrameGraphNode;
-
-class QFrameGraphPrivate : public Qt3DCore::QComponentPrivate
-{
-public:
- QFrameGraphPrivate();
-
- Q_DECLARE_PUBLIC(QFrameGraph)
-
- QFrameGraphNode *m_activeFrameGraph;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QT3DRENDER_QFRAMEGRAPH_P_H
diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp
index c5c3fc329..ff53db362 100644
--- a/src/render/frontend/qrenderaspect.cpp
+++ b/src/render/frontend/qrenderaspect.cpp
@@ -48,7 +48,6 @@
#include <Qt3DRender/qabstractsceneloader.h>
#include <Qt3DRender/qcameraselector.h>
-#include <Qt3DRender/qframegraph.h>
#include <Qt3DRender/qlayer.h>
#include <Qt3DRender/qlayerfilter.h>
#include <Qt3DRender/qmaterial.h>
@@ -272,7 +271,6 @@ void QRenderAspect::registerBackendTypes()
registerBackendType<QLayerFilter>(QBackendNodeMapperPtr(new Render::FrameGraphNodeFunctor<Render::LayerFilterNode, QLayerFilter>(d->m_renderer, d->m_nodeManagers->frameGraphManager())));
registerBackendType<QSortPolicy>(QBackendNodeMapperPtr(new Render::FrameGraphNodeFunctor<Render::SortPolicy, QSortPolicy>(d->m_renderer, d->m_nodeManagers->frameGraphManager())));
registerBackendType<QFrameGraphSelector>(QBackendNodeMapperPtr(new Render::FrameGraphNodeFunctor<Render::FrameGraphSubtreeSelector, QFrameGraphSelector>(d->m_renderer, d->m_nodeManagers->frameGraphManager())));
- registerBackendType<QFrameGraph>(QBackendNodeMapperPtr(new Render::FrameGraphComponentFunctor(d->m_renderer)));
registerBackendType<QParameter>(QBackendNodeMapperPtr(new Render::NodeFunctor<Render::Parameter, Render::ParameterManager>(d->m_renderer, d->m_nodeManagers->parameterManager())));
registerBackendType<QShaderData>(QBackendNodeMapperPtr(new Render::RenderShaderDataFunctor(d->m_renderer, d->m_nodeManagers)));
registerBackendType<QAbstractTextureImage>(QBackendNodeMapperPtr(new Render::TextureImageFunctor(d->m_renderer, d->m_nodeManagers->textureManager(), d->m_nodeManagers->textureImageManager(), d->m_nodeManagers->textureDataManager())));
diff --git a/src/render/frontend/qrendersettings.cpp b/src/render/frontend/qrendersettings.cpp
index 06dfa238d..bf6537c84 100644
--- a/src/render/frontend/qrendersettings.cpp
+++ b/src/render/frontend/qrendersettings.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include "qframegraphnode.h"
#include "qrendersettings.h"
#include "qrendersettings_p.h"
@@ -46,6 +47,7 @@ namespace Qt3DRender {
QRenderSettingsPrivate::QRenderSettingsPrivate()
: Qt3DCore::QComponentPrivate()
+ , m_activeFrameGraph(Q_NULLPTR)
, m_pickMethod(QRenderSettings::BoundingVolumePicking)
, m_pickResultMode(QRenderSettings::NearestPick)
{
@@ -66,6 +68,12 @@ QRenderSettings::~QRenderSettings()
QNode::cleanup();
}
+QFrameGraphNode *QRenderSettings::activeFrameGraph() const
+{
+ Q_D(const QRenderSettings);
+ return d->m_activeFrameGraph;
+}
+
QRenderSettings::PickMethod QRenderSettings::pickMethod() const
{
Q_D(const QRenderSettings);
@@ -78,6 +86,18 @@ QRenderSettings::PickResultMode QRenderSettings::pickResultMode() const
return d->m_pickResultMode;
}
+void QRenderSettings::setActiveFrameGraph(QFrameGraphNode *activeFrameGraph)
+{
+ Q_D(QRenderSettings);
+ if (d->m_activeFrameGraph == activeFrameGraph)
+ return;
+
+ if (activeFrameGraph != Q_NULLPTR && !activeFrameGraph->parent())
+ activeFrameGraph->setParent(this);
+ d->m_activeFrameGraph = activeFrameGraph;
+ emit activeFrameGraphChanged(activeFrameGraph);
+}
+
void QRenderSettings::setPickMethod(QRenderSettings::PickMethod pickMethod)
{
Q_D(QRenderSettings);
@@ -102,6 +122,8 @@ void QRenderSettings::copy(const QNode *ref)
{
QComponent::copy(ref);
const QRenderSettings *object = static_cast<const QRenderSettings *>(ref);
+ setActiveFrameGraph(qobject_cast<QFrameGraphNode *>(QNode::clone(object->activeFrameGraph())));
+
d_func()->m_pickMethod = object->d_func()->m_pickMethod;
d_func()->m_pickResultMode = object->d_func()->m_pickResultMode;
}
diff --git a/src/render/frontend/qrendersettings.h b/src/render/frontend/qrendersettings.h
index 5d31189b6..9314b5048 100644
--- a/src/render/frontend/qrendersettings.h
+++ b/src/render/frontend/qrendersettings.h
@@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
+class QFrameGraphNode;
class QRenderSettingsPrivate;
class QT3DRENDERSHARED_EXPORT QRenderSettings : public Qt3DCore::QComponent
@@ -55,6 +56,9 @@ class QT3DRENDERSHARED_EXPORT QRenderSettings : public Qt3DCore::QComponent
Q_PROPERTY(PickMethod pickMethod READ pickMethod WRITE setPickMethod NOTIFY pickMethodChanged)
Q_PROPERTY(PickResultMode pickResultMode READ pickResultMode WRITE setPickResultMode NOTIFY pickResultModeChanged)
+ Q_PROPERTY(Qt3DRender::QFrameGraphNode *activeFrameGraph READ activeFrameGraph WRITE setActiveFrameGraph NOTIFY activeFrameGraphChanged)
+ Q_CLASSINFO("DefaultProperty", "activeFrameGraph")
+
public:
explicit QRenderSettings(Qt3DCore::QNode *parent = nullptr);
~QRenderSettings();
@@ -73,14 +77,17 @@ public:
PickMethod pickMethod() const;
PickResultMode pickResultMode() const;
+ QFrameGraphNode *activeFrameGraph() const;
public Q_SLOTS:
void setPickMethod(PickMethod pickMethod);
void setPickResultMode(PickResultMode pickResultMode);
+ void setActiveFrameGraph(QFrameGraphNode *activeFrameGraph);
Q_SIGNALS:
void pickMethodChanged(PickMethod pickMethod);
void pickResultModeChanged(PickResultMode pickResult);
+ void activeFrameGraphChanged(QFrameGraphNode *activeFrameGraph);
protected:
Q_DECLARE_PRIVATE(QRenderSettings)
diff --git a/src/render/frontend/qrendersettings_p.h b/src/render/frontend/qrendersettings_p.h
index a3d98555d..e8d31a70b 100644
--- a/src/render/frontend/qrendersettings_p.h
+++ b/src/render/frontend/qrendersettings_p.h
@@ -63,6 +63,7 @@ class QRenderSettingsPrivate : public Qt3DCore::QComponentPrivate
public:
QRenderSettingsPrivate();
+ QFrameGraphNode *m_activeFrameGraph;
QRenderSettings::PickMethod m_pickMethod;
QRenderSettings::PickResultMode m_pickResultMode;
};
diff --git a/tests/auto/render/commons/testrenderer.h b/tests/auto/render/commons/testrenderer.h
index 977b915e1..bad8c3e3a 100644
--- a/tests/auto/render/commons/testrenderer.h
+++ b/tests/auto/render/commons/testrenderer.h
@@ -58,7 +58,6 @@ public:
void skipNextFrame() Q_DECL_OVERRIDE {}
QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() Q_DECL_OVERRIDE { return QVector<Qt3DCore::QAspectJobPtr>(); }
Qt3DCore::QAspectJobPtr pickBoundingVolumeJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); }
- void setFrameGraphRoot(const Qt3DCore::QNodeId fgRootId) Q_DECL_OVERRIDE { Q_UNUSED(fgRootId); }
void setSceneRoot(Qt3DCore::QBackendNodeFactory *factory, Qt3DRender::Render::Entity *root) Q_DECL_OVERRIDE { Q_UNUSED(factory); Q_UNUSED(root); }
Qt3DRender::Render::Entity *sceneRoot() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
Qt3DRender::Render::FrameGraphNode *frameGraphRoot() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
diff --git a/tests/auto/render/qframegraph/qframegraph.pro b/tests/auto/render/qframegraph/qframegraph.pro
deleted file mode 100644
index 4f782fcd1..000000000
--- a/tests/auto/render/qframegraph/qframegraph.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-
-TARGET = tst_qframegraph
-QT += core-private 3dcore 3dcore-private 3drender 3drender-private testlib
-
-CONFIG += testcase
-
-SOURCES += tst_qframegraph.cpp
-
-include(../commons/commons.pri)
diff --git a/tests/auto/render/qframegraph/tst_qframegraph.cpp b/tests/auto/render/qframegraph/tst_qframegraph.cpp
deleted file mode 100644
index afd7ee471..000000000
--- a/tests/auto/render/qframegraph/tst_qframegraph.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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:GPL-EXCEPT$
-** 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 General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** 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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QTest>
-#include <Qt3DCore/private/qnode_p.h>
-#include <Qt3DCore/private/qscene_p.h>
-#include <Qt3DCore/qentity.h>
-
-#include <Qt3DRender/qframegraphnode.h>
-#include <Qt3DRender/qframegraph.h>
-
-#include "testpostmanarbiter.h"
-
-class MyFrameGraphNode : public Qt3DRender::QFrameGraphNode
-{
- Q_OBJECT
-public:
- explicit MyFrameGraphNode(Qt3DCore::QNode *parent = Q_NULLPTR)
- : QFrameGraphNode(parent)
- {
- }
-
- ~MyFrameGraphNode()
- {
- QNode::cleanup();
- }
-
-private:
- QT3D_CLONEABLE(MyFrameGraphNode)
-};
-
-// We need to call QNode::clone which is protected
-// So we sublcass QNode instead of QObject
-class tst_QFrameGraph: public Qt3DCore::QNode
-{
- Q_OBJECT
-public:
- ~tst_QFrameGraph()
- {
- QNode::cleanup();
- }
-
-private Q_SLOTS:
-
- void checkSaneDefaults()
- {
- QScopedPointer<Qt3DRender::QFrameGraph> defaultFrameGraph(new Qt3DRender::QFrameGraph);
-
- QVERIFY(defaultFrameGraph->activeFrameGraph() == Q_NULLPTR);
- }
-
- void checkCloning_data()
- {
- QTest::addColumn<Qt3DRender::QFrameGraph *>("frameGraph");
- QTest::addColumn<Qt3DRender::QFrameGraphNode *>("frameGraphTree");
-
- Qt3DRender::QFrameGraph *defaultConstructed = new Qt3DRender::QFrameGraph();
- QTest::newRow("defaultConstructed") << defaultConstructed << static_cast<Qt3DRender::QFrameGraphNode *>(Q_NULLPTR);
-
- Qt3DRender::QFrameGraph *frameGraphWithActiveNode = new Qt3DRender::QFrameGraph();
- Qt3DRender::QFrameGraphNode *frameGraphTree = new MyFrameGraphNode();
- frameGraphWithActiveNode->setActiveFrameGraph(frameGraphTree);
- QTest::newRow("frameGraphWithActiveTree") << frameGraphWithActiveNode << frameGraphTree;
- }
-
- void checkCloning()
- {
- // GIVEN
- QFETCH(Qt3DRender::QFrameGraph*, frameGraph);
- QFETCH(Qt3DRender::QFrameGraphNode *, frameGraphTree);
-
- // THEN
- QVERIFY(frameGraph->activeFrameGraph() == frameGraphTree);
-
- // WHEN
- Qt3DRender::QFrameGraph *clone = static_cast<Qt3DRender::QFrameGraph *>(QNode::clone(frameGraph));
-
- // THEN
- QVERIFY(clone != Q_NULLPTR);
- QCOMPARE(frameGraph->id(), clone->id());
-
- if (frameGraph->activeFrameGraph() != Q_NULLPTR) {
- QVERIFY(frameGraph->activeFrameGraph()->parent() == frameGraph);
- QVERIFY(clone->activeFrameGraph() != Q_NULLPTR);
- QCOMPARE(clone->activeFrameGraph()->id(), frameGraph->activeFrameGraph()->id());
- QVERIFY(clone->activeFrameGraph()->parent() == clone);
- }
-
- delete frameGraph;
- delete clone;
- }
-
- void checkPropertyUpdates()
- {
- // GIVEN
- QScopedPointer<Qt3DRender::QFrameGraph> frameGraph(new Qt3DRender::QFrameGraph());
- TestArbiter arbiter(frameGraph.data());
-
- // WHEN
- MyFrameGraphNode *activeFrameGraph1 = new MyFrameGraphNode();
- frameGraph->setActiveFrameGraph(activeFrameGraph1);
- QCoreApplication::processEvents();
-
- // THEN
- QCOMPARE(arbiter.events.size(), 1);
- Qt3DCore::QScenePropertyChangePtr change = arbiter.events.first().staticCast<Qt3DCore::QScenePropertyChange>();
- QCOMPARE(change->propertyName(), "activeFrameGraph");
- QCOMPARE(change->subjectId(), frameGraph->id());
- QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), activeFrameGraph1->id());
- QCOMPARE(change->type(), Qt3DCore::NodeUpdated);
-
- arbiter.events.clear();
-
- // WHEN
- frameGraph->setActiveFrameGraph(activeFrameGraph1);
- QCoreApplication::processEvents();
-
- // THEN
- QCOMPARE(arbiter.events.size(), 0);
-
- // WHEN
- MyFrameGraphNode *activeFrameGraph2 = new MyFrameGraphNode();
- frameGraph->setActiveFrameGraph(activeFrameGraph2);
- QCoreApplication::processEvents();
-
- // THEN
- QCOMPARE(arbiter.events.size(), 1);
- change = arbiter.events.first().staticCast<Qt3DCore::QScenePropertyChange>();
- QCOMPARE(change->propertyName(), "activeFrameGraph");
- QCOMPARE(change->subjectId(), frameGraph->id());
- QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), activeFrameGraph2->id());
- QCOMPARE(change->type(), Qt3DCore::NodeUpdated);
-
- arbiter.events.clear();
-
- // WHEN
- frameGraph->setActiveFrameGraph(Q_NULLPTR);
- QCoreApplication::processEvents();
-
- // THEN
- QCOMPARE(arbiter.events.size(), 1);
- change = arbiter.events.first().staticCast<Qt3DCore::QScenePropertyChange>();
- QCOMPARE(change->propertyName(), "activeFrameGraph");
- QCOMPARE(change->subjectId(), frameGraph->id());
- QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), Qt3DCore::QNodeId());
- QCOMPARE(change->type(), Qt3DCore::NodeUpdated);
- }
-
-protected:
- Qt3DCore::QNode *doClone() const Q_DECL_OVERRIDE
- {
- return Q_NULLPTR;
- }
-
-};
-
-QTEST_MAIN(tst_QFrameGraph)
-
-#include "tst_qframegraph.moc"
diff --git a/tests/auto/render/render.pro b/tests/auto/render/render.pro
index 0f4ba3035..e78b98d50 100644
--- a/tests/auto/render/render.pro
+++ b/tests/auto/render/render.pro
@@ -25,7 +25,6 @@ contains(QT_CONFIG, private_tests) {
qcameraselector \
qclearbuffer \
qframegraphnode \
- qframegraph \
qlayerfilter \
qlight \
qray3d \
diff --git a/tests/benchmarks/render/jobs/tst_bench_jobs.cpp b/tests/benchmarks/render/jobs/tst_bench_jobs.cpp
index 3c85752b3..305cd8094 100644
--- a/tests/benchmarks/render/jobs/tst_bench_jobs.cpp
+++ b/tests/benchmarks/render/jobs/tst_bench_jobs.cpp
@@ -31,10 +31,10 @@
#include <Qt3DCore/QEntity>
#include <Qt3DCore/QTransform>
#include <Qt3DRender/QMaterial>
-#include <Qt3DRender/QFrameGraph>
#include <Qt3DRender/QForwardRenderer>
#include <Qt3DRender/QPhongMaterial>
#include <Qt3DRender/QCylinderMesh>
+#include <Qt3DRender/QRenderSettings>
#include <Qt3DRender/private/managers_p.h>
#include <Qt3DCore/private/qresourcemanager_p.h>
@@ -164,13 +164,12 @@ Qt3DCore::QEntity *buildBigScene()
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
// FrameGraph
- Qt3DRender::QFrameGraph *frameGraph = new Qt3DRender::QFrameGraph();
+ Qt3DRender::QRenderSettings* renderSettings = new Qt3DRender::QRenderSettings();
Qt3DRender::QForwardRenderer *forwardRenderer = new Qt3DRender::QForwardRenderer();
forwardRenderer->setCamera(cameraEntity);
forwardRenderer->setClearColor(Qt::black);
- frameGraph->setActiveFrameGraph(forwardRenderer);
- root->addComponent(frameGraph);
-
+ renderSettings->setActiveFrameGraph(forwardRenderer);
+ root->addComponent(renderSettings);
const float radius = 100.0f;
const int max = 1000;