diff options
author | Liang Qi <liang.qi@qt.io> | 2019-06-19 13:05:12 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-06-19 13:05:12 +0200 |
commit | a2d36c9ef566a3e0ec42e297a3d314f134c87da1 (patch) | |
tree | 3cf02240bc190e0ae52c5cb1163e523635e443ab /src/quick/scenegraph/adaptations/software | |
parent | 15b90204fa5126f339db551cf7429534f1359322 (diff) | |
parent | e9520ec84c95e10a6826b2289e46552a2d446895 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
.qmake.conf
src/imports/sharedimage/qsharedimageloader.cpp
src/quick/items/qquickitemviewfxitem_p_p.h
Change-Id: I12ce7c32788f4a394188a934e689b4ebac78138b
Diffstat (limited to 'src/quick/scenegraph/adaptations/software')
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 |