diff options
author | Kim Motoyoshi Kalland <[email protected]> | 2012-05-18 14:23:29 +0200 |
---|---|---|
committer | Qt by Nokia <[email protected]> | 2012-05-21 11:22:43 +0200 |
commit | e2395b83622b11b18e5416f9a0f05910d3d7e809 (patch) | |
tree | 559c7cb8c63653897154d96fadc904b71578ae02 /src/quick/items/qquickshadereffectsource.cpp | |
parent | 1fc67d759aa56697772b2e882305a66f238b4191 (diff) |
Always emit signal after ShaderEffectSource::scheduleUpdate().
The scheduledUpdateCompleted signal was originally added so that
you can take some action after updating a ShaderEffectSource with
scheduleUpdate(). However, before this commit, the signal would
not be emitted if the ShaderEffectSource was already up-to-date.
Instead, the signal would be delayed until the next time the
ShaderEffectSource was redrawn. This commit ensures the signal is
emitted even if the ShaderEffectSource is already up-to-date.
Change-Id: Idd22cdea1f7c14ed7a45081c98b8cfbef896dccd
Reviewed-by: Kim Gronholm <[email protected]>
Reviewed-by: Gunnar Sletta <[email protected]>
Diffstat (limited to 'src/quick/items/qquickshadereffectsource.cpp')
-rw-r--r-- | src/quick/items/qquickshadereffectsource.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index a855c6deca..4513263ed3 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -186,12 +186,13 @@ void QQuickShaderEffectTexture::bind() bool QQuickShaderEffectTexture::updateTexture() { - if ((m_live || m_grab) && m_dirtyTexture) { + bool doGrab = (m_live || m_grab) && m_dirtyTexture; + if (doGrab) grab(); - m_grab = false; - return true; - } - return false; + if (m_grab) + emit scheduledUpdateCompleted(); + m_grab = false; + return doGrab; } void QQuickShaderEffectTexture::setHasMipmaps(bool mipmap) @@ -297,8 +298,6 @@ void QQuickShaderEffectTexture::grab() m_fbo = m_secondaryFbo = 0; m_depthStencilBuffer.clear(); m_dirtyTexture = false; - if (m_grab) - emit scheduledUpdateCompleted(); return; } QSGNode *root = m_item; @@ -443,9 +442,6 @@ void QQuickShaderEffectTexture::grab() #endif if (m_recursive) markDirtyTexture(); // Continuously update if 'live' and 'recursive'. - - if (m_grab) - emit scheduledUpdateCompleted(); } QImage QQuickShaderEffectTexture::toImage() const |