summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2015-12-08 20:09:52 +0000
committerGunnar Sletta <gunnar@sletta.org>2016-01-04 09:18:28 +0000
commit3b762574094e1a807fac7f83f07df2ebd8f1fc80 (patch)
tree4f268fd532f6e3d213d7d46297efbbef1b39d648
parent2aacd087202371be0d0d5019aa29f757bf265532 (diff)
Make QQuickPaintedItem support Item::layer
Change-Id: I4baf8416704fdb65b96b7e0b8620c651f9199159 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-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()) {