aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickimage.cpp')
-rw-r--r--src/quick/items/qquickimage.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp
index d6be13f3c0..0708304051 100644
--- a/src/quick/items/qquickimage.cpp
+++ b/src/quick/items/qquickimage.cpp
@@ -532,17 +532,17 @@ QRectF QQuickImage::boundingRect() const
QSGTextureProvider *QQuickImage::textureProvider() const
{
Q_D(const QQuickImage);
+
+ if (!d->window || !d->sceneGraphRenderContext() || QThread::currentThread() != d->sceneGraphRenderContext()->thread()) {
+ qWarning("QQuickImage::textureProvider: can only be queried on the rendering thread of an exposed window");
+ return 0;
+ }
+
if (!d->provider) {
- // Make sure it gets thread affinity on the rendering thread so deletion works properly..
- Q_ASSERT_X(d->window
- && d->sceneGraphContext()
- && QThread::currentThread() == d->sceneGraphContext()->thread(),
- "QQuickImage::textureProvider",
- "Cannot be used outside the GUI thread");
QQuickImagePrivate *dd = const_cast<QQuickImagePrivate *>(d);
dd->provider = new QQuickImageTextureProvider;
dd->provider->m_smooth = d->smooth;
- dd->provider->m_texture = d->sceneGraphContext()->textureForFactory(d->pix.textureFactory(), window());
+ dd->provider->m_texture = d->sceneGraphRenderContext()->textureForFactory(d->pix.textureFactory(), window());
}
return d->provider;
@@ -552,7 +552,7 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
Q_D(QQuickImage);
- QSGTexture *texture = d->sceneGraphContext()->textureForFactory(d->pix.textureFactory(), window());
+ QSGTexture *texture = d->sceneGraphRenderContext()->textureForFactory(d->pix.textureFactory(), window());
// Copy over the current texture state into the texture provider...
if (d->provider) {