Changeset 104832 in webkit


Ignore:
Timestamp:
Jan 12, 2012 9:27:41 AM (12 years ago)
Author:
noam.rosenthal@nokia.com
Message:

[Qt][WK2] WebProcesses crashes when composited reflections/masks are present
https://bugs.webkit.org/show_bug.cgi?id=75883

Reviewed by Kenneth Rohde Christiansen.

Make sure masks and replica layers can access layerTreeTileClient. Let masks
have the right contents/visible rect so that they can render content tiles.
Default the mask's size to be the layer's size.

  • WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:

(WebCore::WebGraphicsLayer::WebGraphicsLayer):
(WebCore::WebGraphicsLayer::setSize):
(WebCore::WebGraphicsLayer::setMaskLayer):
(WebCore::WebGraphicsLayer::setReplicatedByLayer):
(WebCore::WebGraphicsLayer::syncCompositingState):
(WebCore::WebGraphicsLayer::setContentsScale):
(WebCore::WebGraphicsLayer::setVisibleContentRect):
(WebCore::WebGraphicsLayer::tiledBackingStoreContentsRect):
(WebCore::WebGraphicsLayer::updateTileBuffersRecursively):
(WebCore::WebGraphicsLayer::layerTreeTileClient):
(WebCore::WebGraphicsLayer::purgeBackingStores):
(WebCore::WebGraphicsLayer::recreateBackingStoreIfNeeded):
(WebCore::WebGraphicsLayer::setLayerTreeTileClient):

  • WebProcess/WebCoreSupport/WebGraphicsLayer.h:

(WebCore::WebGraphicsLayer::maskTarget):
(WebCore::WebGraphicsLayer::setMaskTarget):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r104823 r104832  
     12012-01-12  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        [Qt][WK2] WebProcesses crashes when composited reflections/masks are present
     4        https://bugs.webkit.org/show_bug.cgi?id=75883
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Make sure masks and replica layers can access layerTreeTileClient. Let masks
     9        have the right contents/visible rect so that they can render content tiles.
     10        Default the mask's size to be the layer's size.
     11
     12        * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
     13        (WebCore::WebGraphicsLayer::WebGraphicsLayer):
     14        (WebCore::WebGraphicsLayer::setSize):
     15        (WebCore::WebGraphicsLayer::setMaskLayer):
     16        (WebCore::WebGraphicsLayer::setReplicatedByLayer):
     17        (WebCore::WebGraphicsLayer::syncCompositingState):
     18        (WebCore::WebGraphicsLayer::setContentsScale):
     19        (WebCore::WebGraphicsLayer::setVisibleContentRect):
     20        (WebCore::WebGraphicsLayer::tiledBackingStoreContentsRect):
     21        (WebCore::WebGraphicsLayer::updateTileBuffersRecursively):
     22        (WebCore::WebGraphicsLayer::layerTreeTileClient):
     23        (WebCore::WebGraphicsLayer::purgeBackingStores):
     24        (WebCore::WebGraphicsLayer::recreateBackingStoreIfNeeded):
     25        (WebCore::WebGraphicsLayer::setLayerTreeTileClient):
     26        * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
     27        (WebCore::WebGraphicsLayer::maskTarget):
     28        (WebCore::WebGraphicsLayer::setMaskTarget):
     29
    1302012-01-12  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    231
     
    1104711076        Reviewed by Adam Roben.
    1104811077
    11049         This avoids calling into the plug-in when only the plug-in position relative to the window changes.
     11078        This avoids calling into the plug-in when only the plug-in position relative to the window changes.
    1105011079   
    1105111080        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp

    r104720 r104832  
    7373WebGraphicsLayer::WebGraphicsLayer(GraphicsLayerClient* client)
    7474    : GraphicsLayer(client)
     75    , m_maskTarget(0)
    7576    , m_needsDisplay(false)
    7677    , m_modified(true)
     
    193194    GraphicsLayer::setSize(size);
    194195    setNeedsDisplay();
     196    if (maskLayer())
     197        maskLayer()->setSize(size);
    195198    notifyChange();
    196199}
     
    355358void WebGraphicsLayer::setMaskLayer(GraphicsLayer* layer)
    356359{
     360    if (layer == maskLayer())
     361        return;
     362
    357363    GraphicsLayer::setMaskLayer(layer);
    358     notifyChange();
     364
     365    if (!layer)
     366        return;
     367
     368    layer->setSize(size());
     369    WebGraphicsLayer* webGraphicsLayer = toWebGraphicsLayer(layer);
     370    webGraphicsLayer->setLayerTreeTileClient(layerTreeTileClient());
     371    webGraphicsLayer->setMaskTarget(this);
     372    webGraphicsLayer->setContentsScale(m_contentsScale);
     373    webGraphicsLayer->notifyChange();
     374    notifyChange();
     375
    359376}
    360377
     
    363380    if (layer == replicaLayer())
    364381        return;
     382
     383    if (layer)
     384        toWebGraphicsLayer(layer)->setLayerTreeTileClient(layerTreeTileClient());
     385
    365386    GraphicsLayer::setReplicatedByLayer(layer);
    366387    notifyChange();
     
    388409    for (size_t i = 0; i < children().size(); ++i)
    389410        children()[i]->syncCompositingState(rect);
    390     if (replicaLayer())
    391         replicaLayer()->syncCompositingState(rect);
    392     if (maskLayer())
    393         maskLayer()->syncCompositingState(rect);
     411
     412    if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
     413        mask->syncCompositingStateForThisLayerOnly();
     414
     415    if (WebGraphicsLayer* replica = toWebGraphicsLayer(replicaLayer()))
     416        replica->syncCompositingStateForThisLayerOnly();
     417
    394418    syncCompositingStateForThisLayerOnly();
    395419}
     
    457481    }
    458482
     483    if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
     484        mask->setContentsScale(scale);
     485
    459486    m_contentsScale = scale;
    460487    if (m_mainBackingStore && m_mainBackingStore->contentsScale() == scale)
     
    484511    notifyChange();
    485512    m_mainBackingStore->adjustVisibleRect();
     513    if (maskLayer())
     514        toWebGraphicsLayer(maskLayer())->setVisibleContentRect(rect);
    486515}
    487516
     
    509538IntRect WebGraphicsLayer::tiledBackingStoreContentsRect()
    510539{
    511     if (m_image)
     540    if (!drawsContent())
    512541        return IntRect();
    513542    return IntRect(0, 0, size().width(), size().height());
     
    552581        layer->updateTileBuffersRecursively();
    553582    }
     583
     584    if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
     585        mask->updateTileBuffersRecursively();
    554586}
    555587
     
    558590    if (m_layerTreeTileClient)
    559591        return m_layerTreeTileClient;
    560     WebGraphicsLayer* parent = toWebGraphicsLayer(this->parent());
     592    WebGraphicsLayer* parent;
     593    if (this->replicatedLayer())
     594        parent = toWebGraphicsLayer(this->replicatedLayer());
     595    else if (this->maskTarget())
     596        parent = toWebGraphicsLayer(this->maskTarget());
     597    else
     598        parent = toWebGraphicsLayer(this->parent());
     599
    561600    if (!parent)
    562601        return 0;
     
    587626    }
    588627
     628    if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
     629        mask->purgeBackingStores();
     630
    589631    if (m_mainBackingStore)
    590632        m_mainBackingStore.clear();
     
    603645        layer->recreateBackingStoreIfNeeded();
    604646    }
     647    if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
     648        mask->recreateBackingStoreIfNeeded();
    605649
    606650    if (!m_mainBackingStore) {
     
    618662        return;
    619663
     664    if (WebGraphicsLayer* replica = toWebGraphicsLayer(replicaLayer()))
     665        replica->setLayerTreeTileClient(client);
     666    if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
     667        mask->setLayerTreeTileClient(client);
    620668    for (size_t i = 0; i < children().size(); ++i) {
    621669        WebGraphicsLayer* layer = toWebGraphicsLayer(this->children()[i]);
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h

    r104370 r104832  
    108108    void notifyAnimationStarted(double);
    109109
     110    GraphicsLayer* maskTarget() const { return m_maskTarget; }
     111    void setMaskTarget(GraphicsLayer* layer) { m_maskTarget = layer; }
     112
    110113    static void initFactory();
    111114
     
    138141private:
    139142    WebKit::WebLayerInfo m_layerInfo;
    140     WebKit::WebLayerTreeTileClient* m_layerTileClient;
    141143    RefPtr<Image> m_image;
     144    GraphicsLayer* m_maskTarget;
    142145    FloatRect m_needsDisplayRect;
    143146    IntRect m_visibleContentRect;
Note: See TracChangeset for help on using the changeset viewer.