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 <kim.1.gronholm@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
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)
m_fbo = m_secondaryFbo = 0;
m_depthStencilBuffer.clear();
m_dirtyTexture = false;
- if (m_grab)
- emit scheduledUpdateCompleted();
return;
}
QSGNode *root = m_item;
#endif
if (m_recursive)
markDirtyTexture(); // Continuously update if 'live' and 'recursive'.
-
- if (m_grab)
- emit scheduledUpdateCompleted();
}
QImage QQuickShaderEffectTexture::toImage() const