diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-14 12:43:46 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-15 09:30:31 +0000 |
commit | c2414e16aba2ad499a49d3661a2961795c9a9dc9 (patch) | |
tree | 08c8d0a06bc4c9bb218f45739daf3b48540cd2d0 /src/quick/scenegraph/adaptations | |
parent | 12de7bbc1ee2959f4e31a345b4573242d34474cf (diff) |
Fix rendercontrol grabs with the software backend
Calling grabWindow recurses (since that is implemented via
QQuickRenderControl::grab...) so it's not an option. Instead,
call directly in the software renderer implementation.
Fix also the size of the offscreen QQuickWindow when using QQuickWidget
in combination with the software backend.
Change-Id: I857a2cc0aebbbaa5d52d809aeaec37c15b0787b9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/adaptations')
4 files changed, 14 insertions, 1 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp index 26efba5b13..a6cb99ae05 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp @@ -236,7 +236,7 @@ void QSGAbstractSoftwareRenderer::setBackgroundSize(const QSize &size) m_background->setRect(0.0f, 0.0f, size.width(), size.height()); renderableNode(m_background)->markGeometryDirty(); // Invalidate the whole scene when the background is resized - m_dirtyRegion = QRegion(m_background->rect().toRect()); + markDirty(); } QColor QSGAbstractSoftwareRenderer::backgroundColor() @@ -322,4 +322,9 @@ void QSGAbstractSoftwareRenderer::nodeOpacityUpdated(QSGNode *node) m_nodeUpdater->updateNodes(node); } +void QSGAbstractSoftwareRenderer::markDirty() +{ + m_dirtyRegion = QRegion(m_background->rect().toRect()); +} + QT_END_NAMESPACE diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h index 73410b09f5..905577b92a 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h @@ -75,6 +75,8 @@ public: void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override; + void markDirty(); + protected: QRegion renderNodes(QPainter *painter); void buildRenderList(); diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp index 7bf06f8081..257009472e 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp @@ -69,6 +69,11 @@ void QSGSoftwareRenderer::setCurrentPaintDevice(QPaintDevice *device) m_backingStore = nullptr; } +QPaintDevice *QSGSoftwareRenderer::currentPaintDevice() const +{ + return m_paintDevice; +} + void QSGSoftwareRenderer::setBackingStore(QBackingStore *backingStore) { m_backingStore = backingStore; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer_p.h index a201e4887e..bb28da4ca5 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer_p.h @@ -65,6 +65,7 @@ public: virtual ~QSGSoftwareRenderer(); void setCurrentPaintDevice(QPaintDevice *device); + QPaintDevice *currentPaintDevice() const; void setBackingStore(QBackingStore *backingStore); QRegion flushRegion() const; |