Changeset 94964 in webkit


Ignore:
Timestamp:
Sep 12, 2011 10:52:51 AM (13 years ago)
Author:
jamesr@google.com
Message:

[chromium] REGRESSION(94353): Compositor textures and resources leaked when tab closed that is not last tab in the process
https://bugs.webkit.org/show_bug.cgi?id=67816

Reviewed by Kenneth Russell.

We lack infrastructure to construct an automated test for this today. To test manually, open up a composited
page (like the poster circle), duplicate the tab many times, close all the duplicates, and verify that the
memory use returns to the single tab level.

  • platform/graphics/chromium/LayerChromium.h:
  • platform/graphics/chromium/TiledLayerChromium.cpp:

(WebCore::TiledLayerChromium::setLayerTreeHost):

  • platform/graphics/chromium/VideoLayerChromium.cpp:

(WebCore::VideoLayerChromium::setLayerTreeHost):

  • platform/graphics/chromium/cc/CCLayerTreeHost.cpp:

(WebCore::CCLayerTreeHost::clearRenderSurfacesRecursive):
(WebCore::CCLayerTreeHost::setRootLayer):

  • platform/graphics/chromium/cc/CCLayerTreeHost.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r94962 r94964  
     12011-09-12  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] REGRESSION(94353): Compositor textures and resources leaked when tab closed that is not last tab in the process
     4        https://bugs.webkit.org/show_bug.cgi?id=67816
     5
     6        Reviewed by Kenneth Russell.
     7
     8        We lack infrastructure to construct an automated test for this today. To test manually, open up a composited
     9        page (like the poster circle), duplicate the tab many times, close all the duplicates, and verify that the
     10        memory use returns to the single tab level.
     11
     12        * platform/graphics/chromium/LayerChromium.h:
     13        * platform/graphics/chromium/TiledLayerChromium.cpp:
     14        (WebCore::TiledLayerChromium::setLayerTreeHost):
     15        * platform/graphics/chromium/VideoLayerChromium.cpp:
     16        (WebCore::VideoLayerChromium::setLayerTreeHost):
     17        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     18        (WebCore::CCLayerTreeHost::clearRenderSurfacesRecursive):
     19        (WebCore::CCLayerTreeHost::setRootLayer):
     20        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     21
    1222011-09-12  Kentaro Hara  <haraken@google.com>
    223
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r94703 r94964  
    208208
    209209    CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost.get(); }
    210     virtual void cleanupResourcesRecursive();
     210    void cleanupResourcesRecursive();
    211211
    212212protected:
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

    r94431 r94964  
    139139    LayerChromium::setLayerTreeHost(host);
    140140
    141     if (m_tiler)
     141    if (m_tiler || !host)
    142142        return;
    143143
  • trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp

    r94431 r94964  
    149149void VideoLayerChromium::setLayerTreeHost(CCLayerTreeHost* host)
    150150{
    151     if (layerTreeHost() != host) {
     151    if (host && layerTreeHost() != host) {
    152152        for (size_t i = 0; i < 3; ++i) {
    153153            m_textures[i].m_visibleSize = IntSize();
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r94789 r94964  
    215215}
    216216
     217void CCLayerTreeHost::clearRenderSurfacesRecursive(LayerChromium* layer)
     218{
     219    for (size_t i = 0; i < layer->children().size(); ++i)
     220        clearRenderSurfacesRecursive(layer->children()[i].get());
     221
     222    if (layer->replicaLayer())
     223        clearRenderSurfacesRecursive(layer->replicaLayer());
     224
     225    if (layer->maskLayer())
     226        clearRenderSurfacesRecursive(layer->maskLayer());
     227
     228    layer->clearRenderSurface();
     229}
     230
     231
    217232void CCLayerTreeHost::setRootLayer(GraphicsLayer* layer)
    218233{
     
    221236    if (layer)
    222237        m_nonCompositedContentHost->graphicsLayer()->addChild(layer);
     238    else {
     239        clearRenderSurfacesRecursive(rootLayer()->platformLayer());
     240        m_nonCompositedContentHost->graphicsLayer()->platformLayer()->setLayerTreeHost(0);
     241        m_rootLayer->platformLayer()->setLayerTreeHost(0);
     242    }
    223243}
    224244
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r94789 r94964  
    169169    void updateCompositorResources(LayerChromium*, GraphicsContext3D*);
    170170
     171    void clearRenderSurfacesRecursive(LayerChromium*);
     172
    171173    bool initialize();
    172174
Note: See TracChangeset for help on using the changeset viewer.