Changeset 169053 in webkit


Ignore:
Timestamp:
May 19, 2014 11:33:26 AM (10 years ago)
Author:
Simon Fraser
Message:

Images missing sometimes with composited clipping layers
https://bugs.webkit.org/show_bug.cgi?id=133065
<rdar://problem/15224559>

Reviewed by Beth Dakin.

Source/WebCore:

When support for solid colors on layers was added, a layer was considered a candidate
for the solid color optimization without regard to whether it had descendent layers
with "paintsIntoCompositedAncestor" requirements.

Fix hasVisibleNonCompositingDescendantLayers(), renaming it to isPaintDestinationForDescendentLayers()
and having it take into account whether descendent layers need to paint into an
ancestor.

Also, this test has to happen after those descendent layers have had their
compositing state updated, so move the isSimpleContainerCompositingLayer() to
a new updateAfterDescendents() function which is called from the various
places we do compositing-udpate-tree-walks.

Test: compositing/backing/solid-color-with-paints-into-ancestor.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateAfterDescendents):
(WebCore::RenderLayerBacking::paintsChildren):
(WebCore::compositedWithOwnBackingStore):
(WebCore::descendentLayerPaintsIntoAncestor):
(WebCore::RenderLayerBacking::isPaintDestinationForDescendentLayers):
(WebCore::hasVisibleNonCompositingDescendant): Deleted.
(WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers): Deleted.

  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):

LayoutTests:

  • compositing/backing/solid-color-with-paints-into-ancestor-expected.html: Added.
  • compositing/backing/solid-color-with-paints-into-ancestor.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169050 r169053  
     12014-05-19  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Images missing sometimes with composited clipping layers
     4        https://bugs.webkit.org/show_bug.cgi?id=133065
     5        <rdar://problem/15224559>
     6
     7        Reviewed by Beth Dakin.
     8
     9        * compositing/backing/solid-color-with-paints-into-ancestor-expected.html: Added.
     10        * compositing/backing/solid-color-with-paints-into-ancestor.html: Added.
     11
    1122014-05-19  Jono Wells  <jonowells@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r169048 r169053  
     12014-05-19  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Images missing sometimes with composited clipping layers
     4        https://bugs.webkit.org/show_bug.cgi?id=133065
     5        <rdar://problem/15224559>
     6
     7        Reviewed by Beth Dakin.
     8       
     9        When support for solid colors on layers was added, a layer was considered a candidate
     10        for the solid color optimization without regard to whether it had descendent layers
     11        with "paintsIntoCompositedAncestor" requirements.
     12       
     13        Fix hasVisibleNonCompositingDescendantLayers(), renaming it to isPaintDestinationForDescendentLayers()
     14        and having it take into account whether descendent layers need to paint into an
     15        ancestor.
     16       
     17        Also, this test has to happen after those descendent layers have had their
     18        compositing state updated, so move the isSimpleContainerCompositingLayer() to
     19        a new updateAfterDescendents() function which is called from the various
     20        places we do compositing-udpate-tree-walks.
     21
     22        Test: compositing/backing/solid-color-with-paints-into-ancestor.html
     23
     24        * rendering/RenderLayerBacking.cpp:
     25        (WebCore::RenderLayerBacking::updateGeometry):
     26        (WebCore::RenderLayerBacking::updateAfterDescendents):
     27        (WebCore::RenderLayerBacking::paintsChildren):
     28        (WebCore::compositedWithOwnBackingStore):
     29        (WebCore::descendentLayerPaintsIntoAncestor):
     30        (WebCore::RenderLayerBacking::isPaintDestinationForDescendentLayers):
     31        (WebCore::hasVisibleNonCompositingDescendant): Deleted.
     32        (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers): Deleted.
     33        * rendering/RenderLayerBacking.h:
     34        * rendering/RenderLayerCompositor.cpp:
     35        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
     36        (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
     37        (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
     38
    1392014-05-19  Zalan Bujtas  <zalan@apple.com>
    240
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r169046 r169053  
    671671#endif
    672672
    673     bool isSimpleContainer = isSimpleContainerCompositingLayer();
    674    
    675673    m_owningLayer.updateDescendantDependentFlags();
    676 
    677     // m_graphicsLayer is the corresponding GraphicsLayer for this RenderLayer and its non-compositing
    678     // descendants. So, the visibility flag for m_graphicsLayer should be true if there are any
    679     // non-compositing visible layers.
    680     m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || hasVisibleNonCompositingDescendantLayers());
    681674
    682675    // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
     
    973966    setRequiresOwnBackingStore(compositor().requiresOwnBackingStore(m_owningLayer, compAncestor, enclosingRelativeCompositingBounds, ancestorCompositingBounds));
    974967
     968    updateAfterWidgetResize();
     969
     970    compositor().updateScrollCoordinatedStatus(m_owningLayer);
     971}
     972
     973void RenderLayerBacking::updateAfterDescendents()
     974{
    975975    bool didUpdateContentsRect = false;
     976    bool isSimpleContainer = isSimpleContainerCompositingLayer();
    976977    updateDirectlyCompositedContents(isSimpleContainer, didUpdateContentsRect);
    977978    if (!didUpdateContentsRect && m_graphicsLayer->usesContentsLayer())
     
    979980
    980981    updateDrawsContent(isSimpleContainer);
    981     updateAfterWidgetResize();
    982 
    983     compositor().updateScrollCoordinatedStatus(m_owningLayer);
     982
     983    m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || isPaintDestinationForDescendentLayers());
    984984}
    985985
     
    16811681        return true;
    16821682
    1683     if (hasVisibleNonCompositingDescendantLayers())
     1683    if (isPaintDestinationForDescendentLayers())
    16841684        return true;
    16851685
     
    17451745}
    17461746
    1747 static bool hasVisibleNonCompositingDescendant(RenderLayer& parent)
     1747static bool compositedWithOwnBackingStore(const RenderLayer* layer)
     1748{
     1749    return layer->isComposited() && !layer->backing()->paintsIntoCompositedAncestor();
     1750}
     1751
     1752static bool descendentLayerPaintsIntoAncestor(RenderLayer& parent)
    17481753{
    17491754    // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512.
     
    17581763        for (size_t i = 0; i < listSize; ++i) {
    17591764            RenderLayer* curLayer = normalFlowList->at(i);
    1760             if (!curLayer->isComposited()
    1761                 && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(*curLayer)))
     1765            if (!compositedWithOwnBackingStore(curLayer)
     1766                && (curLayer->hasVisibleContent() || descendentLayerPaintsIntoAncestor(*curLayer)))
    17621767                return true;
    17631768        }
     
    17731778            for (size_t i = 0; i < listSize; ++i) {
    17741779                RenderLayer* curLayer = negZOrderList->at(i);
    1775                 if (!curLayer->isComposited()
    1776                     && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(*curLayer)))
     1780                if (!compositedWithOwnBackingStore(curLayer)
     1781                    && (curLayer->hasVisibleContent() || descendentLayerPaintsIntoAncestor(*curLayer)))
    17771782                    return true;
    17781783            }
     
    17831788            for (size_t i = 0; i < listSize; ++i) {
    17841789                RenderLayer* curLayer = posZOrderList->at(i);
    1785                 if (!curLayer->isComposited()
    1786                     && (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(*curLayer)))
     1790                if (!compositedWithOwnBackingStore(curLayer)
     1791                    && (curLayer->hasVisibleContent() || descendentLayerPaintsIntoAncestor(*curLayer)))
    17871792                    return true;
    17881793            }
     
    17941799
    17951800// Conservative test for having no rendered children.
    1796 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
    1797 {
    1798     return hasVisibleNonCompositingDescendant(m_owningLayer);
     1801bool RenderLayerBacking::isPaintDestinationForDescendentLayers() const
     1802{
     1803    return descendentLayerPaintsIntoAncestor(m_owningLayer);
    17991804}
    18001805
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r169046 r169053  
    7676    // Returns true if layer configuration changed.
    7777    bool updateConfiguration();
     78
    7879    // Update graphics layer position and bounds.
    79     void updateGeometry(); // make private
     80    void updateGeometry();
     81
     82    // Update state the requires that descendant layers have been updated.
     83    void updateAfterDescendents();
     84
    8085    // Update contents and clipping structure.
    8186    void updateDrawsContent();
     
    283288    void resetContentsRect();
    284289
    285     bool hasVisibleNonCompositingDescendantLayers() const;
     290    bool isPaintDestinationForDescendentLayers() const;
    286291
    287292    bool shouldClipCompositedBounds() const;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r169045 r169053  
    15181518        childLayersOfEnclosingLayer.append(layerBacking->childForSuperlayers());
    15191519    }
     1520   
     1521    if (RenderLayerBacking* layerBacking = layer.backing())
     1522        layerBacking->updateAfterDescendents();
    15201523}
    15211524
     
    17521755        }
    17531756    }
     1757
     1758    if (RenderLayerBacking* layerBacking = layer.backing())
     1759        layerBacking->updateAfterDescendents();
    17541760}
    17551761
     
    17671773
    17681774            layerBacking->updateGeometry();
    1769             if (compositedChildrenOnly)
     1775            if (compositedChildrenOnly) {
     1776                layerBacking->updateAfterDescendents();
    17701777                return;
     1778            }
    17711779        }
    17721780    }
     
    18031811        }
    18041812    }
    1805 }
    1806 
     1813   
     1814    if (&layer != &compositingAncestor) {
     1815        if (RenderLayerBacking* layerBacking = layer.backing())
     1816            layerBacking->updateAfterDescendents();
     1817    }
     1818}
    18071819
    18081820void RenderLayerCompositor::repaintCompositedLayers(const IntRect* absRect)
Note: See TracChangeset for help on using the changeset viewer.