summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-09-09 18:33:26 +0200
committerAndy Nichols <andy.nichols@digia.com>2014-09-11 15:37:37 +0300
commit5b7047618323a9be74169f5a0bbac35b429567e7 (patch)
tree9a499e24fd1ed0add5d4d8d3b053cb3145755c4c
parent60c81befa22108a96bbf505c40f4a2af8ed843e2 (diff)
SoftwareLayer::grab must call QSGRenderer::renderScene to work correctly
If QSGRenderer::renderScene is not called by SoftwareLayer then any updates in the scenegraph will not be reflected in that layer. This is the "live" but not "recursive" situation. Change-Id: If55cc71b3932e283855e3a1f9ff1bca5e07f4498 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--src/plugins/scenegraph/softwarecontext/context.cpp9
-rw-r--r--src/plugins/scenegraph/softwarecontext/softwarelayer.cpp5
2 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/context.cpp b/src/plugins/scenegraph/softwarecontext/context.cpp
index 345728f..4278020 100644
--- a/src/plugins/scenegraph/softwarecontext/context.cpp
+++ b/src/plugins/scenegraph/softwarecontext/context.cpp
@@ -104,12 +104,17 @@ PixmapRenderer::PixmapRenderer(QSGRenderContext *context)
void PixmapRenderer::renderScene(GLuint)
{
- Q_UNREACHABLE();
+ class B : public QSGBindable
+ {
+ public:
+ void bind() const { }
+ } bindable;
+ QSGRenderer::renderScene(bindable);
}
void PixmapRenderer::render()
{
- Q_UNREACHABLE();
+
}
void PixmapRenderer::render(QPixmap *target)
diff --git a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp b/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
index 70cb73f..5dfcf2e 100644
--- a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
+++ b/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
@@ -190,7 +190,7 @@ void SoftwareLayer::grab()
if (!m_renderer) {
m_renderer = new SoftwareContext::PixmapRenderer(m_context);
- connect(m_renderer, SIGNAL(sceneGraphChanged()), this, SLOT(markDirtyTexture()));
+ connect(m_renderer, SIGNAL(sceneGraphChanged()), this, SLOT(markDirtyTextureLater()));
}
m_renderer->setDevicePixelRatio(m_device_pixel_ratio);
m_renderer->setRootNode(static_cast<QSGRootNode *>(root));
@@ -206,10 +206,9 @@ void SoftwareLayer::grab()
m_renderer->setDeviceRect(m_size);
m_renderer->setViewportRect(m_size);
- QRectF mirrored(m_rect.left(), m_rect.bottom(), m_rect.width(), -m_rect.height());
- m_renderer->setProjectionMatrixToRect(mirrored);
m_renderer->setClearColor(Qt::transparent);
+ m_renderer->renderScene();
m_renderer->render(&m_pixmap);
root->markDirty(QSGNode::DirtyForceUpdate); // Force matrix, clip, opacity and render list update.