[CSS Shaders] Cached validated programs are destroyed and recreated when there...

[CSS Shaders] Cached validated programs are destroyed and recreated when there is only one custom filter animating
https://bugs.webkit.org/show_bug.cgi?id=96563

Patch by Max Vujovic <mvujovic@adobe.com> on 2012-09-12
Reviewed by Dean Jackson.

Before this patch, in FilterEffectRenderer::build, we would first clear the old effects and
then create the new effects.

Suppose we have one FECustomFilter animating on the page. This FECustomFilter holds the last
reference to the cached validated program. Before this patch, we would first destroy the old
FECustomFilter, which would destroy its cached validated program. Then, we would create the
new FECustomFilter and have to recreate the validated program.

This patch makes FilterEffectRenderer::build keep the old effects around until we're
done creating the new effects. This way, we won't recreate validated programs.

No new tests. We can't test this because the validated program cache is not exposed to web
pages.

* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cc24e248
2012-09-12 Max Vujovic <mvujovic@adobe.com>
[CSS Shaders] Cached validated programs are destroyed and recreated when there is only one custom filter animating
https://bugs.webkit.org/show_bug.cgi?id=96563
Reviewed by Dean Jackson.
Before this patch, in FilterEffectRenderer::build, we would first clear the old effects and
then create the new effects.
Suppose we have one FECustomFilter animating on the page. This FECustomFilter holds the last
reference to the cached validated program. Before this patch, we would first destroy the old
FECustomFilter, which would destroy its cached validated program. Then, we would create the
new FECustomFilter and have to recreate the validated program.
This patch makes FilterEffectRenderer::build keep the old effects around until we're
done creating the new effects. This way, we won't recreate validated programs.
No new tests. We can't test this because the validated program cache is not exposed to web
pages.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
2012-09-12 Tony Chang <tony@chromium.org>
flex item sized incorrectly in a column flexbox with height set via top/bottom
......@@ -202,7 +202,11 @@ bool FilterEffectRenderer::build(Document* document, const FilterOperations& ope
m_hasFilterThatMovesPixels = operations.hasFilterThatMovesPixels();
if (m_hasFilterThatMovesPixels)
operations.getOutsets(m_topOutset, m_rightOutset, m_bottomOutset, m_leftOutset);
m_effects.clear();
// Keep the old effects on the stack until we've created the new effects.
// New FECustomFilters can reuse cached resources from old FECustomFilters.
FilterEffectList oldEffects;
m_effects.swap(oldEffects);
RefPtr<FilterEffect> previousEffect = m_sourceGraphic;
for (size_t i = 0; i < operations.operations().size(); ++i) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment