aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-09-10 11:01:10 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-09-11 07:08:24 +0200
commitd53af701d166dac56c910319db9eac4b9aa4538d (patch)
tree71dfc25fc87c02d88a1a5955cff1e82b836cad93
parentac1dac7099c9552a60da3240134ddbd8bc4fe048 (diff)
Fix graphical effects on images with no dimensions
When we pick the direct code path for a null image (if you set its source to ""), the shader effect will try to sample non-existent pixels and get black. Whereas if we use a proxy for this, then it will create an empty source item the size of the item instead. This used to work by accident before 3c4c7ac6069a57b17199627742d8e2b32a3a31c9, because the interpolation was always set to the wrong value, so interopOk would always be false and we would always use a proxy. But after that was fixed, we started hitting the direct code path and null images broke as a result. The easy fix is just to go back to using the proxy item code path when there is no actual input. Note: This is only committed to 5.15, as the same issue is not visible in Qt 6, when running on RHI. Fixes: QTBUG-86486 Change-Id: I1b7927fa1a407f70703e8c4fa380c1c3582c0aaf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/effects/private/qgfxsourceproxy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/effects/private/qgfxsourceproxy.cpp b/src/effects/private/qgfxsourceproxy.cpp
index 386cff8..f881c5e 100644
--- a/src/effects/private/qgfxsourceproxy.cpp
+++ b/src/effects/private/qgfxsourceproxy.cpp
@@ -166,7 +166,7 @@ void QGfxSourceProxy::updatePolish()
if (shaderSource->sourceRect() == m_sourceRect || m_sourceRect.isEmpty())
direct = true;
- } else if (!padded && ((image && image->fillMode() == QQuickImage::Stretch)
+ } else if (!padded && ((image && image->fillMode() == QQuickImage::Stretch && !m_sourceRect.isNull())
|| (!image && m_input->isTextureProvider())
)
) {