Changeset 128387 in webkit


Ignore:
Timestamp:
Sep 12, 2012 5:17:23 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128383 r128387  
     12012-09-12  Max Vujovic  <mvujovic@adobe.com>
     2
     3        [CSS Shaders] Cached validated programs are destroyed and recreated when there is only one custom filter animating
     4        https://bugs.webkit.org/show_bug.cgi?id=96563
     5
     6        Reviewed by Dean Jackson.
     7
     8        Before this patch, in FilterEffectRenderer::build, we would first clear the old effects and
     9        then create the new effects.
     10
     11        Suppose we have one FECustomFilter animating on the page. This FECustomFilter holds the last
     12        reference to the cached validated program. Before this patch, we would first destroy the old
     13        FECustomFilter, which would destroy its cached validated program. Then, we would create the
     14        new FECustomFilter and have to recreate the validated program.
     15
     16        This patch makes FilterEffectRenderer::build keep the old effects around until we're
     17        done creating the new effects. This way, we won't recreate validated programs.
     18
     19        No new tests. We can't test this because the validated program cache is not exposed to web
     20        pages.
     21
     22        * rendering/FilterEffectRenderer.cpp:
     23        (WebCore::FilterEffectRenderer::build):
     24
    1252012-09-12  Tony Chang  <tony@chromium.org>
    226
  • trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp

    r127217 r128387  
    203203    if (m_hasFilterThatMovesPixels)
    204204        operations.getOutsets(m_topOutset, m_rightOutset, m_bottomOutset, m_leftOutset);
    205     m_effects.clear();
     205   
     206    // Keep the old effects on the stack until we've created the new effects.
     207    // New FECustomFilters can reuse cached resources from old FECustomFilters.
     208    FilterEffectList oldEffects;
     209    m_effects.swap(oldEffects);
    206210
    207211    RefPtr<FilterEffect> previousEffect = m_sourceGraphic;
Note: See TracChangeset for help on using the changeset viewer.