From 3b762574094e1a807fac7f83f07df2ebd8f1fc80 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 8 Dec 2015 20:09:52 +0000 Subject: Make QQuickPaintedItem support Item::layer Change-Id: I4baf8416704fdb65b96b7e0b8620c651f9199159 Reviewed-by: Laszlo Agocs --- src/quick/items/qquickpainteditem.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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()) { -- cgit v1.2.3