aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-09-15 15:28:24 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-15 15:31:00 +0200
commit8c175bee55f1e0e0bb27cbf72911fedf370c26c6 (patch)
tree95f265acd5f8d894028b607f884706dd49044db3 /src
parent77bb02ff9095db0e7b2012e7bcc8411528d8319d (diff)
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 <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/items/qsgimage.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/declarative/items/qsgimage.cpp b/src/declarative/items/qsgimage.cpp
index cb12c177cd..8cf85997cb 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<QSGImagePrivate *>(d)->provider = new QSGImageTextureProvider(this);
+ QSGImagePrivate *dd = const_cast<QSGImagePrivate *>(d);
+ dd->provider = new QSGImageTextureProvider;
+ dd->provider->m_texture = d->pix.texture(d->sceneGraphContext());
}
return d->provider;