aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/items/qquickpainteditem.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index c9b5d34cc9..ad8d94d240 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -638,6 +638,13 @@ bool QQuickPaintedItem::isTextureProvider() const
*/
QSGTextureProvider *QQuickPaintedItem::textureProvider() const
{
+ // When Item::layer::enabled == true, QQuickItem will be a texture
+ // provider. In this case we should prefer to return the layer rather
+ // than the image itself. The layer will include any children and any
+ // the image's wrap and fill mode.
+ if (QQuickItem::isTextureProvider())
+ return QQuickItem::textureProvider();
+
Q_D(const QQuickPaintedItem);
QQuickWindow *w = window();
if (!w || !w->openglContext() || QThread::currentThread() != w->openglContext()->thread()) {