diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-02-26 16:36:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-28 07:07:13 +0100 |
commit | ec03673000a52069699a8a784ae8219f174aa3c2 (patch) | |
tree | 4152bcf8200665e5e5c98a5034491dee5cfbe66c /src/quick/items/qquickshadereffectsource.cpp | |
parent | a7f61f73c5f8aebff680014c9ce916eca7126de6 (diff) |
Ensure that ShaderEffectSource's texture has correct parameters.
The provider is created on demand in textureProvider(), but its
parameters are set in updatePaintNode() so if updatePaintNode() was
called before a consumer asked for the texture provider, they wouldn't
be set until the next time updatePaintNode() was called.
Change-Id: Iff866d50a8fe16f3d371cb8e590528f5f8c5ee61
Reviewed-by: Mikko Harju <mikko.harju@jolla.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/items/qquickshadereffectsource.cpp')
-rw-r--r-- | src/quick/items/qquickshadereffectsource.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index f78a05ea9a..ebeff599f4 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -622,6 +622,8 @@ void QQuickShaderEffectSource::ensureTexture() connect(m_texture, SIGNAL(scheduledUpdateCompleted()), this, SIGNAL(scheduledUpdateCompleted())); } +static void get_wrap_mode(QQuickShaderEffectSource::WrapMode mode, QSGTexture::WrapMode *hWrap, QSGTexture::WrapMode *vWrap); + QSGTextureProvider *QQuickShaderEffectSource::textureProvider() const { const QQuickItemPrivate *d = QQuickItemPrivate::get(this); @@ -634,6 +636,10 @@ QSGTextureProvider *QQuickShaderEffectSource::textureProvider() const const_cast<QQuickShaderEffectSource *>(this)->m_provider = new QQuickShaderEffectSourceTextureProvider(); const_cast<QQuickShaderEffectSource *>(this)->ensureTexture(); connect(m_texture, SIGNAL(updateRequested()), m_provider, SIGNAL(textureChanged())); + + get_wrap_mode(m_wrapMode, &m_provider->horizontalWrap, &m_provider->verticalWrap); + m_provider->mipmapFiltering = mipmap() ? QSGTexture::Linear : QSGTexture::None; + m_provider->filtering = smooth() ? QSGTexture::Linear : QSGTexture::Nearest; m_provider->sourceTexture = m_texture; } return m_provider; |