summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/commons
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2016-12-12 15:31:32 +0000
committerJani Heikkinen <jani.heikkinen@qt.io>2016-12-14 11:18:19 +0000
commit412f9985bd59b1c46407eda67b963cbdbdc48e4b (patch)
tree1915f46702bfb7b44cb52485c5d02363f375b927 /tests/auto/render/commons
parentf3e9952fb03050fd30fc0618f520bcdbdbfc45d2 (diff)
Ensure offscreen surface used during cleanup is created on gui thread
Windows uses a QWindow to back QOffscreenSurface so we must needs create it on the gui thread. To complicate matters we don't know the format used by Qt 3D until the Renderer is initialized. So we have to defer creation of the offscreen surface until that time and do it in the gui thread with the correct format. Task-number: QTBUG-57496 Change-Id: Idaad23c2229ab069f3e02c8d075be8e6718a8a50 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/render/commons')
-rw-r--r--tests/auto/render/commons/testrenderer.cpp10
-rw-r--r--tests/auto/render/commons/testrenderer.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/render/commons/testrenderer.cpp b/tests/auto/render/commons/testrenderer.cpp
index cda741936..87e60a263 100644
--- a/tests/auto/render/commons/testrenderer.cpp
+++ b/tests/auto/render/commons/testrenderer.cpp
@@ -66,4 +66,14 @@ QVariant TestRenderer::executeCommand(const QStringList &args)
return QVariant();
}
+void TestRenderer::setOffscreenSurfaceHelper(Qt3DRender::Render::OffscreenSurfaceHelper *helper)
+{
+ Q_UNUSED(helper);
+}
+
+QSurfaceFormat TestRenderer::format()
+{
+ return QSurfaceFormat();
+}
+
QT_END_NAMESPACE
diff --git a/tests/auto/render/commons/testrenderer.h b/tests/auto/render/commons/testrenderer.h
index 05aafbbd8..2e572582e 100644
--- a/tests/auto/render/commons/testrenderer.h
+++ b/tests/auto/render/commons/testrenderer.h
@@ -75,6 +75,9 @@ public:
void resetDirty();
QVariant executeCommand(const QStringList &args) Q_DECL_OVERRIDE;
+ void setOffscreenSurfaceHelper(Qt3DRender::Render::OffscreenSurfaceHelper *helper) Q_DECL_OVERRIDE;
+ QSurfaceFormat format() Q_DECL_OVERRIDE;
+
protected:
Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet m_changes;
};