Changeset 104370 in webkit


Ignore:
Timestamp:
Jan 6, 2012 6:50:25 PM (12 years ago)
Author:
ostapenko.viatcheslav@nokia.com
Message:

[Qt] [WK2] Minibrowser leaks memory ~6-7Mb per reload
https://bugs.webkit.org/show_bug.cgi?id=75746

Reset WebGraphicsLayer::m_layerTreeTileClient of all dependent
layers from ~LayerTreeHostQt(). This replaces r103760 which
causes leaks of GraphicsLayerTextureMapper objects on UI side.

Reviewed by Noam Rosenthal.

  • WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:

(WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
(WebCore::WebGraphicsLayer::setLayerTreeTileClient):

  • WebProcess/WebCoreSupport/WebGraphicsLayer.h:
  • WebProcess/WebPage/qt/LayerTreeHostQt.cpp:

(WebKit::LayerTreeHostQt::~LayerTreeHostQt):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r104334 r104370  
     12012-01-06  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
     2
     3        [Qt] [WK2] Minibrowser leaks memory ~6-7Mb per reload
     4        https://bugs.webkit.org/show_bug.cgi?id=75746
     5
     6        Reset WebGraphicsLayer::m_layerTreeTileClient of all dependent
     7        layers from ~LayerTreeHostQt(). This replaces r103760 which
     8        causes leaks of GraphicsLayerTextureMapper objects on UI side.
     9
     10        Reviewed by Noam Rosenthal.
     11
     12        * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
     13        (WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
     14        (WebCore::WebGraphicsLayer::setLayerTreeTileClient):
     15        * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
     16        * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
     17        (WebKit::LayerTreeHostQt::~LayerTreeHostQt):
     18
    1192012-01-06  Alexey Proskuryakov  <ap@apple.com>
    220
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp

    r103760 r104370  
    402402void WebGraphicsLayer::syncCompositingStateForThisLayerOnly()
    403403{
     404    if (!m_layerTreeTileClient)
     405        m_layerTreeTileClient = layerTreeTileClient();
     406
    404407    updateContentBuffers();
    405408
     
    432435        m_layerInfo.children.append(toWebLayerID(children()[i]));
    433436
    434     WebLayerTreeTileClient* tileClient = layerTreeTileClient();
    435     ASSERT(tileClient);
     437    ASSERT(m_layerTreeTileClient);
    436438    if (m_layerInfo.imageIsUpdated && m_image && !m_layerInfo.imageBackingStoreID)
    437         m_layerInfo.imageBackingStoreID = tileClient->adoptImageBackingStore(m_image.get());
    438 
    439     tileClient->didSyncCompositingStateForLayer(m_layerInfo);
     439        m_layerInfo.imageBackingStoreID = m_layerTreeTileClient->adoptImageBackingStore(m_image.get());
     440
     441    m_layerTreeTileClient->didSyncCompositingStateForLayer(m_layerInfo);
    440442    m_modified = false;
    441443    m_layerInfo.imageIsUpdated = false;
     
    613615        setContentsNeedsDisplay();
    614616}
     617
     618void WebGraphicsLayer::setLayerTreeTileClient(WebKit::WebLayerTreeTileClient* client)
     619{
     620    if (m_layerTreeTileClient == client)
     621        return;
     622
     623    for (size_t i = 0; i < children().size(); ++i) {
     624        WebGraphicsLayer* layer = toWebGraphicsLayer(this->children()[i]);
     625        layer->setLayerTreeTileClient(client);
     626    }
     627
     628    // Have to force detach from remote layer here if layer tile client changes.
     629    if (m_layerTreeTileClient)
     630        m_layerTreeTileClient->didDeleteLayer(id());
     631    m_layerTreeTileClient = client;
     632}
    615633#endif
    616634
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h

    r102435 r104370  
    125125    virtual void removeTile(int tileID);
    126126
    127     void setLayerTreeTileClient(WebKit::WebLayerTreeTileClient* client) { m_layerTreeTileClient = client; }
     127    void setLayerTreeTileClient(WebKit::WebLayerTreeTileClient*);
    128128    WebKit::WebLayerTreeTileClient* layerTreeTileClient() const;
    129129
  • trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp

    r102435 r104370  
    5353LayerTreeHostQt::~LayerTreeHostQt()
    5454{
     55    if (m_rootLayer)
     56        toWebGraphicsLayer(m_rootLayer.get())->setLayerTreeTileClient(0);
    5557}
    5658
Note: See TracChangeset for help on using the changeset viewer.