diff options
author | Gunnar Sletta <gunnar@sletta.org> | 2015-09-09 11:23:37 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar@sletta.org> | 2015-09-11 07:10:31 +0000 |
commit | 001c47e75779b9b55adebdfc293c232d757d4a8e (patch) | |
tree | 34ad777efdc0a7cf0b4dfac3ab59634df0b60bd2 | |
parent | 8feca74deda0abca0bc1787e18d227c2a3d578e7 (diff) |
Make Canvas::layer::enabled work
Change-Id: I3e159ea6d02f415307db6d45470665085aaa023e
Reviewed-by: Michael Brasser <michael.brasser@live.com>
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitem.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 75507c68d2..6ef2d6123b 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -783,6 +783,12 @@ bool QQuickCanvasItem::isTextureProvider() const QSGTextureProvider *QQuickCanvasItem::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 canvas itself. + if (QQuickItem::isTextureProvider()) + return QQuickItem::textureProvider(); + Q_D(const QQuickCanvasItem); QQuickWindow *w = window(); if (!w || !w->openglContext() || QThread::currentThread() != w->openglContext()->thread()) { |