diff options
4 files changed, 9 insertions, 6 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp index 2e5fdbbe6b..af3b901af4 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp @@ -238,12 +238,13 @@ void QSGAbstractSoftwareRenderer::setBackgroundColor(const QColor &color) renderableNode(m_background)->markMaterialDirty(); } -void QSGAbstractSoftwareRenderer::setBackgroundRect(const QRect &rect) +void QSGAbstractSoftwareRenderer::setBackgroundRect(const QRect &rect, qreal devicePixelRatio) { - if (m_background->rect().toRect() == rect) + if (m_background->rect().toRect() == rect && m_devicePixelRatio == devicePixelRatio) return; m_background->setRect(rect); - renderableNode(m_background)->markGeometryDirty(); + m_devicePixelRatio = devicePixelRatio; + renderableNode(m_background)->markGeometryDirty(); // Invalidate the whole scene when the background is resized markDirty(); } diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h index 99204ef25e..875569454f 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h @@ -83,7 +83,7 @@ protected: QRegion optimizeRenderList(); void setBackgroundColor(const QColor &color); - void setBackgroundRect(const QRect &rect); + void setBackgroundRect(const QRect &rect, qreal devicePixelRatio); QColor backgroundColor(); QRect backgroundRect(); // only known after calling optimizeRenderList() @@ -105,6 +105,7 @@ private: QRegion m_dirtyRegion; QRegion m_obscuredRegion; + qreal m_devicePixelRatio = 1; bool m_isOpaque = false; QSGSoftwareRenderableNodeUpdater *m_nodeUpdater; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp index bb4afc8301..4a6d73ec59 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp @@ -79,7 +79,7 @@ void QSGSoftwarePixmapRenderer::render(QPaintDevice *target) QElapsedTimer renderTimer; // Setup background item - setBackgroundRect(m_projectionRect.normalized()); + setBackgroundRect(m_projectionRect.normalized(), qreal(1)); setBackgroundColor(clearColor()); renderTimer.start(); diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp index e9ed52d428..df129cbfee 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp @@ -114,7 +114,8 @@ void QSGSoftwareRenderer::render() setBackgroundColor(clearColor()); setBackgroundRect(QRect(0, 0, m_paintDevice->width() / m_paintDevice->devicePixelRatioF(), - m_paintDevice->height() / m_paintDevice->devicePixelRatioF())); + m_paintDevice->height() / m_paintDevice->devicePixelRatioF()), + m_paintDevice->devicePixelRatioF()); // Build Renderlist // The renderlist is created by visiting each node in the tree and when a |