Changeset 213405 in webkit


Ignore:
Timestamp:
Mar 3, 2017, 5:45:42 PM (8 years ago)
Author:
Simon Fraser
Message:

Clean up some RenderLayerBacking code
https://bugs.webkit.org/show_bug.cgi?id=169160

Reviewed by Dean Jackson.

Modern loops in descendantLayerPaintsIntoAncestor().

Rename RenderLayerBacking::paintsChildren() to RenderLayerBacking::paintsChildRenderers() to clarify that
it refers to renderers, not RenderLayers.

Rename RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() to RenderLayerBacking::paintsBoxDecorations().
"Paints" already implies non-composited.

No behavior change.

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::paintsBoxDecorations):
(WebCore::RenderLayerBacking::paintsChildRenderers):
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
(WebCore::descendantLayerPaintsIntoAncestor):
(WebCore::RenderLayerBacking::paintsNonDirectCompositedBoxDecoration): Deleted.
(WebCore::RenderLayerBacking::paintsChildren): Deleted.

  • rendering/RenderLayerBacking.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r213404 r213405  
     12017-03-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Clean up some RenderLayerBacking code
     4        https://bugs.webkit.org/show_bug.cgi?id=169160
     5
     6        Reviewed by Dean Jackson.
     7
     8        Modern loops in descendantLayerPaintsIntoAncestor().
     9
     10        Rename RenderLayerBacking::paintsChildren() to RenderLayerBacking::paintsChildRenderers() to clarify that
     11        it refers to renderers, not RenderLayers.
     12
     13        Rename RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() to RenderLayerBacking::paintsBoxDecorations().
     14        "Paints" already implies non-composited.
     15
     16        No behavior change.
     17
     18        * rendering/RenderLayerBacking.cpp:
     19        (WebCore::RenderLayerBacking::updateDrawsContent):
     20        (WebCore::RenderLayerBacking::paintsBoxDecorations):
     21        (WebCore::RenderLayerBacking::paintsChildRenderers):
     22        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
     23        (WebCore::descendantLayerPaintsIntoAncestor):
     24        (WebCore::RenderLayerBacking::paintsNonDirectCompositedBoxDecoration): Deleted.
     25        (WebCore::RenderLayerBacking::paintsChildren): Deleted.
     26        * rendering/RenderLayerBacking.h:
     27
    1282017-03-03  Simon Fraser  <simon.fraser@apple.com>
    229
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r212776 r213405  
    12721272        m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent);
    12731273
    1274         bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || paintsChildren());
     1274        bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || paintsChildRenderers());
    12751275        m_scrollingContentsLayer->setDrawsContent(hasScrollingPaintedContent);
    12761276        return;
     
    18611861}
    18621862
    1863 bool RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() const
     1863bool RenderLayerBacking::paintsBoxDecorations() const
    18641864{
    18651865    if (!m_owningLayer.hasVisibleBoxDecorations())
     
    18691869}
    18701870
    1871 bool RenderLayerBacking::paintsChildren() const
     1871bool RenderLayerBacking::paintsChildRenderers() const
    18721872{
    18731873    if (m_owningLayer.hasVisibleContent() && m_owningLayer.hasNonEmptyChildRenderers())
     
    19081908        return false;
    19091909
    1910     if (paintsNonDirectCompositedBoxDecoration() || paintsChildren())
     1910    if (paintsBoxDecorations() || paintsChildRenderers())
    19111911        return false;
    19121912
     
    19551955#endif
    19561956
    1957     if (Vector<RenderLayer*>* normalFlowList = parent.normalFlowList()) {
    1958         size_t listSize = normalFlowList->size();
    1959         for (size_t i = 0; i < listSize; ++i) {
    1960             RenderLayer* curLayer = normalFlowList->at(i);
    1961             if (!compositedWithOwnBackingStore(*curLayer)
    1962                 && (curLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*curLayer)))
     1957    if (auto* normalFlowList = parent.normalFlowList()) {
     1958        for (auto* childLayer : *normalFlowList) {
     1959            if (!compositedWithOwnBackingStore(*childLayer) && (childLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*childLayer)))
    19631960                return true;
    19641961        }
     
    19701967
    19711968        // Use the m_hasCompositingDescendant bit to optimize?
    1972         if (Vector<RenderLayer*>* negZOrderList = parent.negZOrderList()) {
    1973             size_t listSize = negZOrderList->size();
    1974             for (size_t i = 0; i < listSize; ++i) {
    1975                 RenderLayer* curLayer = negZOrderList->at(i);
    1976                 if (!compositedWithOwnBackingStore(*curLayer)
    1977                     && (curLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*curLayer)))
     1969        if (auto* negZOrderList = parent.negZOrderList()) {
     1970            for (auto* childLayer : *negZOrderList) {
     1971                if (!compositedWithOwnBackingStore(*childLayer) && (childLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*childLayer)))
    19781972                    return true;
    19791973            }
    19801974        }
    19811975
    1982         if (Vector<RenderLayer*>* posZOrderList = parent.posZOrderList()) {
    1983             size_t listSize = posZOrderList->size();
    1984             for (size_t i = 0; i < listSize; ++i) {
    1985                 RenderLayer* curLayer = posZOrderList->at(i);
    1986                 if (!compositedWithOwnBackingStore(*curLayer)
    1987                     && (curLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*curLayer)))
     1976        if (auto* posZOrderList = parent.posZOrderList()) {
     1977            for (auto* childLayer : *posZOrderList) {
     1978                if (!compositedWithOwnBackingStore(*childLayer) && (childLayer->isVisuallyNonEmpty() || descendantLayerPaintsIntoAncestor(*childLayer)))
    19881979                    return true;
    19891980            }
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r211662 r213405  
    310310    bool isMainFrameRenderViewLayer() const;
    311311   
    312     bool paintsNonDirectCompositedBoxDecoration() const;
    313     bool paintsChildren() const;
     312    bool paintsBoxDecorations() const;
     313    bool paintsChildRenderers() const;
    314314
    315315    // Returns true if this compositing layer has no visible content.
Note: See TracChangeset for help on using the changeset viewer.