diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-11-13 14:11:01 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-29 09:19:37 +0100 |
commit | 9e345ab3c549851a273df62497f93ad9593385c9 (patch) | |
tree | ca802786ecd2693881aec211173d0e5255a7fe79 /src/quick/items/qquickimage.cpp | |
parent | 9df70b0304fa44d2f1b1504d7e58d718eab4343a (diff) |
Emit textureChanged() when texture provider's texture change
Task-number: QTBUG-32239
Change-Id: I69c5892b1f0ee7934822183cdfeccdaa1ba1f542
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/items/qquickimage.cpp')
-rw-r--r-- | src/quick/items/qquickimage.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index 0708304051..62ac72d244 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -62,6 +62,13 @@ public: { } + void updateTexture(QSGTexture *texture) { + if (m_texture == texture) + return; + m_texture = texture; + emit textureChanged(); + } + QSGTexture *texture() const { if (m_texture) { m_texture->setFiltering(m_smooth ? QSGTexture::Linear : QSGTexture::Nearest); @@ -542,7 +549,7 @@ QSGTextureProvider *QQuickImage::textureProvider() const QQuickImagePrivate *dd = const_cast<QQuickImagePrivate *>(d); dd->provider = new QQuickImageTextureProvider; dd->provider->m_smooth = d->smooth; - dd->provider->m_texture = d->sceneGraphRenderContext()->textureForFactory(d->pix.textureFactory(), window()); + dd->provider->updateTexture(d->sceneGraphRenderContext()->textureForFactory(d->pix.textureFactory(), window())); } return d->provider; @@ -557,7 +564,7 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) // Copy over the current texture state into the texture provider... if (d->provider) { d->provider->m_smooth = d->smooth; - d->provider->m_texture = texture; + d->provider->updateTexture(texture); } if (!texture || width() <= 0 || height() <= 0) { |