From: Gunnar Sletta Date: Thu, 15 Sep 2011 13:28:24 +0000 (+0200) Subject: When we create textureprovider, initialize it with the texture if we got it X-Git-Tag: qt-v5.0.0-alpha1~1672 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c175bee55f1e0e0bb27cbf72911fedf370c26c6;p=profile%2Fivi%2Fqtdeclarative.git When we create textureprovider, initialize it with the texture if we got it Change-Id: Ia3ab1a75db947a67c610e664051f73bf84b079c1 Reviewed-on: http://codereview.qt-project.org/5008 Reviewed-by: Qt Sanity Bot Reviewed-by: Kim M. Kalland --- diff --git a/src/declarative/items/qsgimage.cpp b/src/declarative/items/qsgimage.cpp index cb12c17..8cf8599 100644 --- a/src/declarative/items/qsgimage.cpp +++ b/src/declarative/items/qsgimage.cpp @@ -56,9 +56,8 @@ class QSGImageTextureProvider : public QSGTextureProvider { Q_OBJECT public: - QSGImageTextureProvider(const QSGImage *imageItem) - : d((QSGImagePrivate *) QSGItemPrivate::get(imageItem)) - , m_texture(0) + QSGImageTextureProvider() + : m_texture(0) , m_smooth(false) { } @@ -75,7 +74,6 @@ public: friend class QSGImage; - QSGImagePrivate *d; QSGTexture *m_texture; bool m_smooth; }; @@ -546,7 +544,9 @@ QSGTextureProvider *QSGImage::textureProvider() const && QThread::currentThread() == d->sceneGraphContext()->thread(), "QSGImage::textureProvider", "Cannot be used outside the GUI thread"); - const_cast(d)->provider = new QSGImageTextureProvider(this); + QSGImagePrivate *dd = const_cast(d); + dd->provider = new QSGImageTextureProvider; + dd->provider->m_texture = d->pix.texture(d->sceneGraphContext()); } return d->provider;