diff options
-rw-r--r-- | src/effects/private/qgfxsourceproxy.cpp | 23 | ||||
-rw-r--r-- | tests/manual/SourceProxyTest.qml | 16 |
2 files changed, 25 insertions, 14 deletions
diff --git a/src/effects/private/qgfxsourceproxy.cpp b/src/effects/private/qgfxsourceproxy.cpp index a319e18..cdc6fc1 100644 --- a/src/effects/private/qgfxsourceproxy.cpp +++ b/src/effects/private/qgfxsourceproxy.cpp @@ -96,7 +96,7 @@ void QGfxSourceProxy::useProxy() m_proxy = new QQuickShaderEffectSource(this); m_proxy->setSourceRect(m_sourceRect); m_proxy->setSourceItem(m_input); - m_proxy->setSmooth(true); + m_proxy->setSmooth(m_interpolation != NearestInterpolation); setOutput(m_proxy); } @@ -111,23 +111,20 @@ void QGfxSourceProxy::updatePolish() QQuickImage *image = qobject_cast<QQuickImage *>(m_input); QQuickShaderEffectSource *shaderSource = qobject_cast<QQuickShaderEffectSource *>(m_input); - bool layered = d->extra.isAllocated() && d->extra->layer && d->extra->layer->enabled(); + bool layered = d->extra.isAllocated() && d->extra->transparentForPositioner; if (shaderSource) { - if ((shaderSource->sourceRect() != m_sourceRect) - || (m_interpolation == LinearInterpolation && !shaderSource->smooth()) - || (m_interpolation == NearestInterpolation && shaderSource->smooth())) - useProxy(); - else + if (layered) { + shaderSource->setSourceRect(m_sourceRect); + shaderSource->setSmooth(m_interpolation != NearestInterpolation); setOutput(m_input); - - } else if (layered) { - if ((d->extra->layer->sourceRect() != m_sourceRect) - || (m_interpolation == LinearInterpolation && !d->extra->layer->smooth()) - || (m_interpolation == NearestInterpolation && d->extra->layer->smooth())) + } else if ((shaderSource->sourceRect() != m_sourceRect) + || (m_interpolation == LinearInterpolation && !shaderSource->smooth()) + || (m_interpolation == NearestInterpolation && shaderSource->smooth())) { useProxy(); - else + } else { setOutput(m_input); + } } else if (image && image->fillMode() == QQuickImage::Stretch && m_input->childItems().size() == 0) { // item is an image with default tiling, use directly diff --git a/tests/manual/SourceProxyTest.qml b/tests/manual/SourceProxyTest.qml index e68bc35..94c948d 100644 --- a/tests/manual/SourceProxyTest.qml +++ b/tests/manual/SourceProxyTest.qml @@ -97,6 +97,20 @@ Rectangle { } Text { + id: autoConfLabel; + // This will be shown when the source is a layer which has different + // attributes set than what the source proxy expects. The source proxy + // will then configure the layer. + color: "#00ff00" + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter; + text: "(configured)" + font.pixelSize: 12 + font.bold: true + visible: root.expectProxy != proxy.active && !proxy.active && root.sourcing == "layered"; + } + + Text { color: "red" anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter; @@ -104,7 +118,7 @@ Rectangle { text: "FAIL" font.pixelSize: 12 font.bold: true - visible: root.expectProxy != proxy.active + visible: root.expectProxy != proxy.active && !autoConfLabel.visible } } |