In FilterEffectRenderer::build, we first clear the old effects and then create the new effects. Suppose we have one FECustomFilter animating on our page. In FilterEffectRenderer::build, we first destroy the old FECustomFilter. This removes its validated program from the cache since it was the last FECustomFilter using it. Then, we create the new FECustomFilter, and we have to create a new validated program. We need to keep the old effects around until we're done creating the new effects so that we can reuse validated programs.
Created attachment 163721 [details] Patch
Comment on attachment 163721 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=163721&action=review > Source/WebCore/rendering/FilterEffectRenderer.cpp:207 > + // New FECustomFilters can reuse cached resources from old FECustomFilters. I think it would be easy to just create a new list and swap it here. It would be similar to clearing m_effects, while still keeping the old ones alive. FilterEffectList oldEffects; m_effects.swap(oldEffects);
(In reply to comment #2) > (From update of attachment 163721 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163721&action=review > > > Source/WebCore/rendering/FilterEffectRenderer.cpp:207 > > + // New FECustomFilters can reuse cached resources from old FECustomFilters. > > I think it would be easy to just create a new list and swap it here. It would be similar to clearing m_effects, while still keeping the old ones alive. > > FilterEffectList oldEffects; > m_effects.swap(oldEffects); Sure, I can do that.
Created attachment 163724 [details] Patch Updated patch based on Alex's informal review.
Comment on attachment 163724 [details] Patch Clearing flags on attachment: 163724 Committed r128387: <http://trac.webkit.org/changeset/128387>
All reviewed patches have been landed. Closing bug.