⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245170 in webkit


Ignore:
Timestamp:
May 9, 2019, 10:18:02 PM (7 years ago)
Author:
Simon Fraser
Message:

Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
https://bugs.webkit.org/show_bug.cgi?id=197561
<rdar://problem/50445998>

Reviewed by Antti Koivisto.
Source/WebCore:

This change introduces the concept of layers that share backing store for compositing. A layer
which is sharing its backing store first paints itself, and then some set of layers which come
later in paint order in the same stacking context. This reduces the composited layer count in
some overflow scrolling scenarios, thereby also simplifying the scrolling tree.

A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
painting root so that positioning and clipping just work.

Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
We track the last layer which was composited in paint order as a shared candidate. If a later layer
would composite for overlap (and no other reasons), then we allow it to share with the candidate
if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
in the same stacking context.

isComposited() returns false for sharing layers, but they are like composited layers in that
they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
and repaints in shared layers have to be directed to their shared layer, hence
changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().

The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
TemporaryClipRects in that case.

Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html

compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
compositing/shared-backing/partial-compositing-update.html
compositing/shared-backing/partial-compositing-update2.html
compositing/shared-backing/remove-sharing-layer.html
compositing/shared-backing/sharing-cached-clip-rects.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
(WebCore::RenderLayer::setBackingProviderLayer):
(WebCore::RenderLayer::disconnectFromBackingProviderLayer):
(WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
(WebCore::RenderLayer::clippingRootForPainting const):
(WebCore::RenderLayer::clipToRect):
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::updateClipRects):
(WebCore::RenderLayer::clipCrossesPaintingBoundary const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::inContainingBlockChain): Deleted.

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

(WebCore::RenderLayerBacking::willBeDestroyed):
(WebCore::clearBackingSharingLayerProviders):
(WebCore::RenderLayerBacking::setBackingSharingLayers):
(WebCore::RenderLayerBacking::removeBackingSharingLayer):
(WebCore::RenderLayerBacking::clearBackingSharingLayers):
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):

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

(WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
(WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
(WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
(WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::backingProviderLayerCanIncludeLayer):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::layerWillBeRemoved):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):

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

LayoutTests:

New tests for backing sharing, and new baselines of tests whose behavior is changed.

Scrolling tree tests that would be invalidate by sharing are changed to defeat sharing by adding
compositing layers early in stacking order.

  • TestExpectations:
  • compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
  • compositing/layer-creation/overflow-scroll-overlap-expected.txt:
  • compositing/layer-creation/overflow-scroll-overlap.html:
  • compositing/overflow/scrolling-content-clip-to-viewport.html:
  • compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
  • compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
  • compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html: Added.
  • compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html: Added.
  • compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html.
  • compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html: Added.
  • compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html: Added.
  • compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html: Added.
  • compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
  • compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html: Added.
  • compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
  • compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html: Added.
  • compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip-expected.html: Added.
  • compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-clipping-expected.html: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-clipping.html: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-repaint-expected.txt: Added.
  • compositing/shared-backing/overflow-scroll/shared-layer-repaint.html: Added.
  • compositing/shared-backing/partial-compositing-update-expected.txt: Added.
  • compositing/shared-backing/partial-compositing-update.html: Added.
  • compositing/shared-backing/partial-compositing-update2-expected.txt: Added.
  • compositing/shared-backing/partial-compositing-update2.html: Added.
  • compositing/shared-backing/remove-sharing-layer-expected.txt: Added.
  • compositing/shared-backing/remove-sharing-layer.html: Added.
  • compositing/shared-backing/sharing-cached-clip-rects-expected.txt: Added.
  • compositing/shared-backing/sharing-cached-clip-rects.html: Added.
  • platform/ios-wk2/TestExpectations:
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt: Added.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt: Added.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt: Added.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt: Added.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt: Added.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
  • platform/ios-wk2/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
  • platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
  • platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
  • platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
  • platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
  • platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
  • platform/mac-wk2/TestExpectations:
  • platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
  • platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
  • scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html:
  • scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
  • scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html:
Location:
trunk
Files:
39 added
36 edited
7 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245162 r245170  
     12019-05-09  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
     4        https://bugs.webkit.org/show_bug.cgi?id=197561
     5        <rdar://problem/50445998>
     6
     7        Reviewed by Antti Koivisto.
     8       
     9        New tests for backing sharing, and new baselines of tests whose behavior is changed.
     10
     11        Scrolling tree tests that would be invalidate by sharing are changed to defeat sharing by adding
     12        compositing layers early in stacking order.
     13
     14        * TestExpectations:
     15        * compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
     16        * compositing/layer-creation/overflow-scroll-overlap-expected.txt:
     17        * compositing/layer-creation/overflow-scroll-overlap.html:
     18        * compositing/overflow/scrolling-content-clip-to-viewport.html:
     19        * compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
     20        * compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
     21        * compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html: Added.
     22        * compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt: Added.
     23        * compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html: Added.
     24        * compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt: Added.
     25        * compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html.
     26        * compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt: Added.
     27        * compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html: Added.
     28        * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt: Added.
     29        * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html: Added.
     30        * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt: Added.
     31        * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html: Added.
     32        * compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
     33        * compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html: Added.
     34        * compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
     35        * compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html: Added.
     36        * compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip-expected.html: Added.
     37        * compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html: Added.
     38        * compositing/shared-backing/overflow-scroll/shared-layer-clipping-expected.html: Added.
     39        * compositing/shared-backing/overflow-scroll/shared-layer-clipping.html: Added.
     40        * compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds-expected.txt: Added.
     41        * compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html: Added.
     42        * compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking-expected.txt: Added.
     43        * compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html: Added.
     44        * compositing/shared-backing/overflow-scroll/shared-layer-repaint-expected.txt: Added.
     45        * compositing/shared-backing/overflow-scroll/shared-layer-repaint.html: Added.
     46        * compositing/shared-backing/partial-compositing-update-expected.txt: Added.
     47        * compositing/shared-backing/partial-compositing-update.html: Added.
     48        * compositing/shared-backing/partial-compositing-update2-expected.txt: Added.
     49        * compositing/shared-backing/partial-compositing-update2.html: Added.
     50        * compositing/shared-backing/remove-sharing-layer-expected.txt: Added.
     51        * compositing/shared-backing/remove-sharing-layer.html: Added.
     52        * compositing/shared-backing/sharing-cached-clip-rects-expected.txt: Added.
     53        * compositing/shared-backing/sharing-cached-clip-rects.html: Added.
     54        * platform/ios-wk2/TestExpectations:
     55        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
     56        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt: Added.
     57        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt: Added.
     58        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt: Added.
     59        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt: Added.
     60        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping-expected.txt: Added.
     61        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
     62        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt: Copied from LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt.
     63        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
     64        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
     65        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
     66        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
     67        * platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
     68        * platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
     69        * platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
     70        * platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
     71        * platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
     72        * platform/mac-wk2/TestExpectations:
     73        * platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
     74        * platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
     75        * scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
     76        * scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html:
     77        * scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
     78        * scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html:
     79        * scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
     80        * scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html:
     81        * scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
     82        * scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html:
     83
    1842019-05-09  Daniel Bates  <dabates@apple.com>
    285
  • trunk/LayoutTests/TestExpectations

    r245085 r245170  
    5959editing/pasteboard/mac [ Skip ]
    6060fast/media/ios [ Skip ]
     61
     62# Requires async overflow scrolling
     63compositing/shared-backing/overflow-scroll [ Skip ]
    6164
    6265# WebKit2 only.
  • trunk/LayoutTests/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt

    r245085 r245170  
    1212      (bounds 785.00 2618.00)
    1313      (contentsOpaque 1)
    14       (children 6
     14      (children 3
    1515        (GraphicsLayer
    1616          (position 21.00 21.00)
     
    2424        (GraphicsLayer
    2525          (offsetFromRenderer width=0 height=100)
    26           (position 28.00 20.00)
    27           (bounds 200.00 200.00)
    28           (children 1
    29             (GraphicsLayer
    30               (offsetFromRenderer width=0 height=100)
    31               (bounds 110.00 200.00)
    32               (contentsOpaque 1)
    33               (drawsContent 1)
    34             )
    35           )
    36         )
    37         (GraphicsLayer
    38           (offsetFromRenderer width=-5 height=-145)
    39           (position 28.00 20.00)
    40           (bounds 200.00 200.00)
    41           (children 1
    42             (GraphicsLayer
    43               (position 5.00 145.00)
    44               (bounds 144.00 24.00)
    45               (drawsContent 1)
    46             )
    47           )
    48         )
    49         (GraphicsLayer
    50           (offsetFromRenderer width=0 height=100)
    5126          (position 28.00 250.00)
    5227          (bounds 185.00 200.00)
     
    5429            (GraphicsLayer
    5530              (offsetFromRenderer width=0 height=100)
    56               (bounds 110.00 200.00)
    57               (contentsOpaque 1)
    58               (drawsContent 1)
    59             )
    60           )
    61         )
    62         (GraphicsLayer
    63           (offsetFromRenderer width=-5 height=-145)
    64           (position 28.00 250.00)
    65           (bounds 185.00 200.00)
    66           (children 1
    67             (GraphicsLayer
    68               (position 5.00 145.00)
    69               (bounds 144.00 24.00)
     31              (bounds 149.00 200.00)
    7032              (drawsContent 1)
    7133            )
  • trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap-expected.txt

    r245085 r245170  
    66      (bounds 800.00 600.00)
    77      (contentsOpaque 1)
    8       (children 3
     8      (children 2
    99        (GraphicsLayer
    1010          (position 8.00 8.00)
     
    1616          (drawsContent 1)
    1717        )
    18         (GraphicsLayer
    19           (offsetFromRenderer width=-20 height=-45)
    20           (position 23.00 23.00)
    21           (bounds 285.00 200.00)
    22           (children 1
    23             (GraphicsLayer
    24               (position 20.00 45.00)
    25               (bounds 210.00 100.00)
    26               (contentsOpaque 1)
    27             )
    28           )
    29         )
    3018      )
    3119    )
  • trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap.html

    r245085 r245170  
    5353          testRunner.notifyDone();
    5454        }
    55       }, 150);
     55      }, 0);
    5656    }
    5757   
  • trunk/LayoutTests/compositing/overflow/scrolling-content-clip-to-viewport.html

    r245085 r245170  
    2424      background: silver;
    2525      border: 2px solid blue;
    26       z-index: 0;
     26      transform: translateZ(0);
    2727    }
    2828  </style>
  • trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt

    r245085 r245170  
    77      (bounds 800.00 600.00)
    88      (contentsOpaque 1)
    9       (children 4
     9      (children 3
    1010        (GraphicsLayer
    1111          (position 8.00 8.00)
     
    2727                )
    2828              )
    29             )
    30           )
    31         )
    32         (GraphicsLayer
    33           (offsetFromRenderer width=-250 height=0)
    34           (position 10.00 10.00)
    35           (bounds 400.00 204.00)
    36           (children 1
    37             (GraphicsLayer
    38               (position 250.00 0.00)
    39               (bounds 150.00 200.00)
    40               (contentsOpaque 1)
    4129            )
    4230          )
  • trunk/LayoutTests/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt

    r245169 r245170  
     1relativeabsolute
    12(GraphicsLayer
    23  (anchor 0.00 0.00)
     
    89      (children 1
    910        (GraphicsLayer
    10           (bounds 320.00 340.00)
     11          (position 28.00 20.00)
     12          (bounds 304.00 304.00)
     13          (drawsContent 1)
    1114          (children 1
    1215            (GraphicsLayer
    13               (bounds 320.00 340.00)
     16              (offsetFromRenderer width=2 height=2)
     17              (position 2.00 2.00)
     18              (bounds 285.00 285.00)
    1419              (children 1
    1520                (GraphicsLayer
     21                  (offsetFromRenderer width=2 height=2)
    1622                  (anchor 0.00 0.00)
    17                   (bounds 320.00 1224.00)
     23                  (bounds 285.00 682.00)
    1824                  (drawsContent 1)
    1925                )
  • trunk/LayoutTests/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html

    r245169 r245170  
    22<html>
    33<head>
    4     <title>Nested absolutes in stacking-context overflow: need two 'stationary' nodes</title>
    54    <style>
    6         .scrollcontent {
    7             height: 500px;
    8         }
    95        .scroller {
    106            margin: 20px;
    11             overflow: scroll;
     7            width: 300px;
    128            height: 300px;
    13             width: 300px;
     9            overflow: auto;
    1410            border: 2px solid black;
    15             opacity: 0.9;
     11            opacity: 0.8;
    1612        }
    1713
    1814        .absolute {
    19             position:absolute;
     15            position: absolute;
     16            width: 100px;
     17            height: 100px;
     18            top: 100px;
    2019            left: 50px;
     20            padding: 20px;
     21            background-color: silver;
     22        }
     23       
     24        .clipping {
     25            overflow: hidden;
     26        }
     27
     28        .inner {
    2129            top: 50px;
    2230            width: 100px;
    2331            height: 100px;
    24             background: gray;
    25             border: 2px solid green;
    26         }
    27    
    28         .inner {
    29             left: 25px;
    30             top: 25px;
    31             width: 200px;
     32            background-color: blue;
    3233        }
    3334
    34         .scrollcontent {
     35        .spacer {
    3536            height: 500px;
    3637            background-image: repeating-linear-gradient(white, silver 200px);
     
    4344        window.addEventListener('load', () => {
    4445            if (window.internals)
    45                 document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
     46                document.getElementById('layers').textContent = internals.layerTreeAsText(document);
    4647        }, false);
    4748    </script>
     
    4950<body>
    5051    <div class="scroller">
    51         <div class="absolute">abs
    52             <div class="inner absolute">abs</div>
     52        <div class="clipping absolute">
     53            <div class="inner absolute"></div>
    5354        </div>
    54         <div class="scrollcontent"></div>
     55        <div class="spacer"></div>
    5556    </div>
    56 <pre id="tree"></pre>
     57<pre id="layers"></pre>
    5758</body>
    5859</html>
     60
  • trunk/LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt

    r245169 r245170  
     1relative
    12(GraphicsLayer
    23  (anchor 0.00 0.00)
     
    89      (children 1
    910        (GraphicsLayer
    10           (bounds 320.00 340.00)
     11          (position 28.00 20.00)
     12          (bounds 324.00 324.00)
     13          (drawsContent 1)
    1114          (children 1
    1215            (GraphicsLayer
    13               (bounds 320.00 340.00)
     16              (offsetFromRenderer width=2 height=2)
     17              (position 2.00 2.00)
     18              (bounds 305.00 305.00)
    1419              (children 1
    1520                (GraphicsLayer
     21                  (offsetFromRenderer width=2 height=2)
    1622                  (anchor 0.00 0.00)
    17                   (bounds 320.00 1224.00)
     23                  (bounds 414.00 374.00)
    1824                  (drawsContent 1)
    1925                )
  • trunk/LayoutTests/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt

    r245169 r245170  
     1Relative foreground
    12(GraphicsLayer
    23  (anchor 0.00 0.00)
     
    89      (children 1
    910        (GraphicsLayer
    10           (bounds 320.00 340.00)
     11          (position 8.00 8.00)
     12          (bounds 304.00 304.00)
     13          (drawsContent 1)
    1114          (children 1
    1215            (GraphicsLayer
    13               (bounds 320.00 340.00)
     16              (offsetFromRenderer width=2 height=2)
     17              (position 2.00 2.00)
     18              (bounds 285.00 285.00)
    1419              (children 1
    1520                (GraphicsLayer
     21                  (offsetFromRenderer width=2 height=2)
    1622                  (anchor 0.00 0.00)
    17                   (bounds 320.00 1224.00)
     23                  (bounds 285.00 364.00)
    1824                  (drawsContent 1)
    1925                )
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r245085 r245170  
    88
    99compositing/ios [ Pass ]
     10compositing/shared-backing/overflow-scroll [ Pass ]
    1011fast/device-orientation [ Pass ]
    1112fast/history/ios [ Pass ]
     
    10761077
    10771078fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html [ Pass Failure ]
     1079webkit.org/b/197694 fast/scrolling/ios/overflow-scroll-overlap-4.html [ Failure ]
    10781080
    10791081webkit.org/b/157589 fast/text-autosizing/ios/text-autosizing-after-back.html [ Pass Timeout ]
  • trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt

    r245169 r245170  
     1relativeabsolute
    12(GraphicsLayer
    23  (anchor 0.00 0.00)
     
    89      (children 1
    910        (GraphicsLayer
    10           (bounds 320.00 340.00)
     11          (position 28.00 20.00)
     12          (bounds 304.00 304.00)
     13          (drawsContent 1)
    1114          (children 1
    1215            (GraphicsLayer
    13               (bounds 320.00 340.00)
     16              (offsetFromRenderer width=2 height=2)
     17              (position 2.00 2.00)
     18              (bounds 300.00 300.00)
    1419              (children 1
    1520                (GraphicsLayer
     21                  (offsetFromRenderer width=2 height=2)
    1622                  (anchor 0.00 0.00)
    17                   (bounds 320.00 1224.00)
     23                  (bounds 300.00 684.00)
    1824                  (drawsContent 1)
    1925                )
  • trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll-expected.txt

    r245169 r245170  
     1relative
    12(GraphicsLayer
    23  (anchor 0.00 0.00)
     
    89      (children 1
    910        (GraphicsLayer
    10           (bounds 320.00 340.00)
     11          (position 28.00 20.00)
     12          (bounds 324.00 324.00)
     13          (drawsContent 1)
    1114          (children 1
    1215            (GraphicsLayer
    13               (bounds 320.00 340.00)
     16              (offsetFromRenderer width=2 height=2)
     17              (position 2.00 2.00)
     18              (bounds 320.00 320.00)
    1419              (children 1
    1520                (GraphicsLayer
     21                  (offsetFromRenderer width=2 height=2)
    1622                  (anchor 0.00 0.00)
    17                   (bounds 320.00 1224.00)
     23                  (bounds 414.00 374.00)
    1824                  (drawsContent 1)
    1925                )
  • trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content-expected.txt

    r245169 r245170  
     1Relative foreground
    12(GraphicsLayer
    23  (anchor 0.00 0.00)
     
    89      (children 1
    910        (GraphicsLayer
    10           (bounds 320.00 340.00)
     11          (position 8.00 8.00)
     12          (bounds 304.00 304.00)
     13          (drawsContent 1)
    1114          (children 1
    1215            (GraphicsLayer
    13               (bounds 320.00 340.00)
     16              (offsetFromRenderer width=2 height=2)
     17              (position 2.00 2.00)
     18              (bounds 300.00 300.00)
    1419              (children 1
    1520                (GraphicsLayer
     21                  (offsetFromRenderer width=2 height=2)
    1622                  (anchor 0.00 0.00)
    17                   (bounds 320.00 1224.00)
     23                  (bounds 300.00 364.00)
    1824                  (drawsContent 1)
    1925                )
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt

    r245085 r245170  
    1 absabs
     1abs
     2abs
    23
    34(Frame scrolling node
     
    1415  (max layout viewport origin (0,0))
    1516  (behavior for fixed 0)
    16   (children 3
     17  (children 5
    1718    (Overflow scrolling node
    1819      (scrollable area size 300 300)
    19       (contents size 381 500)
     20      (contents size 381 530)
    2021      (parent relative scrollable rect at (30,35) size 300x300)
    2122      (scrollable area parameters
     
    2930    (Positioned node
    3031      (layout constraints
     32        (layer-position-at-last-layout (10,10))
     33        (positioning-behavior moves))
     34      (related overflow nodes 1)
     35    )
     36    (Positioned node
     37      (layout constraints
    3138        (layer-position-at-last-layout (50,50))
     39        (positioning-behavior moves))
     40      (related overflow nodes 1)
     41    )
     42    (Positioned node
     43      (layout constraints
     44        (layer-position-at-last-layout (62,82))
    3245        (positioning-behavior moves))
    3346      (related overflow nodes 1)
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt

    r245085 r245170  
    1 absabs
     1abs
     2abs
    23
    34(Frame scrolling node
     
    1415  (max layout viewport origin (0,0))
    1516  (behavior for fixed 0)
    16   (children 4
     17  (children 7
    1718    (Overflow scrolling node
    1819      (scrollable area size 300 300)
    19       (contents size 300 526)
     20      (contents size 300 556)
    2021      (parent relative scrollable rect at (30,22) size 300x300)
    2122      (scrollable area parameters
     
    2829    (Positioned node
    2930      (layout constraints
    30         (layer-position-at-last-layout (0,0))
     31        (layer-position-at-last-layout (10,10))
    3132        (positioning-behavior moves))
    3233      (related overflow nodes 1)
     
    3435    (Positioned node
    3536      (layout constraints
    36         (layer-position-at-last-layout (53,53))
     37        (layer-position-at-last-layout (0,30))
    3738        (positioning-behavior moves))
    3839      (related overflow nodes 1)
     
    4041    (Positioned node
    4142      (layout constraints
    42         (layer-position-at-last-layout (80,80))
     43        (layer-position-at-last-layout (13,43))
     44        (positioning-behavior moves))
     45      (related overflow nodes 1)
     46    )
     47    (Positioned node
     48      (layout constraints
     49        (layer-position-at-last-layout (53,83))
     50        (positioning-behavior moves))
     51      (related overflow nodes 1)
     52    )
     53    (Positioned node
     54      (layout constraints
     55        (layer-position-at-last-layout (65,115))
     56        (positioning-behavior moves))
     57      (related overflow nodes 1)
     58    )
     59    (Positioned node
     60      (layout constraints
     61        (layer-position-at-last-layout (80,110))
    4362        (positioning-behavior moves))
    4463      (related overflow nodes 1)
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245085 r245170  
    1 absabs
     1abs
     2abs
    23
    34(Frame scrolling node
     
    1718    (Overflow scrolling node
    1819      (scrollable area size 300 300)
    19       (contents size 300 500)
     20      (contents size 300 530)
    2021      (parent relative scrollable rect at (30,22) size 300x300)
    2122      (scrollable area parameters
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt

    r245085 r245170  
    2727  (max layout viewport origin (0,229))
    2828  (behavior for fixed 0)
    29   (children 12
     29  (children 19
    3030    (Overflow scrolling node
    3131      (scrollable area size 220 170)
     
    4141    (Positioned node
    4242      (layout constraints
    43         (layer-position-at-last-layout (10,30))
     43        (layer-position-at-last-layout (20,40))
    4444        (positioning-behavior moves))
    4545      (related overflow nodes 1)
     
    4747    (Positioned node
    4848      (layout constraints
    49         (layer-position-at-last-layout (10,50))
     49        (layer-position-at-last-layout (10,60))
     50        (positioning-behavior moves))
     51      (related overflow nodes 1)
     52    )
     53    (Positioned node
     54      (layout constraints
     55        (layer-position-at-last-layout (10,80))
    5056        (positioning-behavior moves))
    5157      (related overflow nodes 1)
     
    6470    (Positioned node
    6571      (layout constraints
    66         (layer-position-at-last-layout (10,30))
     72        (layer-position-at-last-layout (20,40))
     73        (positioning-behavior moves))
     74      (related overflow nodes 1)
     75    )
     76    (Positioned node
     77      (layout constraints
     78        (layer-position-at-last-layout (10,60))
    6779        (positioning-behavior moves))
    6880      (related overflow nodes 1)
     
    7991        (has enabled vertical scrollbar 1))
    8092    )
     93    (Positioned node
     94      (layout constraints
     95        (layer-position-at-last-layout (20,40))
     96        (positioning-behavior moves))
     97      (related overflow nodes 1)
     98    )
    8199    (Overflow scrolling node
    82100      (scrollable area size 220 170)
     
    89107        (vertical scrollbar mode 0)
    90108        (has enabled vertical scrollbar 1))
     109    )
     110    (Positioned node
     111      (layout constraints
     112        (layer-position-at-last-layout (20,40))
     113        (positioning-behavior moves))
     114      (related overflow nodes 1)
    91115    )
    92116    (Overflow scrolling node
     
    103127    (Positioned node
    104128      (layout constraints
    105         (layer-position-at-last-layout (10,30))
     129        (layer-position-at-last-layout (20,40))
    106130        (positioning-behavior moves))
    107131      (related overflow nodes 1)
     
    109133    (Positioned node
    110134      (layout constraints
    111         (layer-position-at-last-layout (110,50))
     135        (layer-position-at-last-layout (10,60))
     136        (positioning-behavior moves))
     137      (related overflow nodes 1)
     138    )
     139    (Positioned node
     140      (layout constraints
     141        (layer-position-at-last-layout (20,90))
     142        (positioning-behavior moves))
     143      (related overflow nodes 1)
     144    )
     145    (Positioned node
     146      (layout constraints
     147        (layer-position-at-last-layout (110,110))
    112148        (positioning-behavior moves))
    113149      (related overflow nodes 1)
     
    126162    (Positioned node
    127163      (layout constraints
    128         (layer-position-at-last-layout (10,30))
     164        (layer-position-at-last-layout (20,40))
     165        (positioning-behavior moves))
     166      (related overflow nodes 1)
     167    )
     168    (Positioned node
     169      (layout constraints
     170        (layer-position-at-last-layout (10,60))
    129171        (positioning-behavior moves))
    130172      (related overflow nodes 1)
     
    132174        (Positioned node
    133175          (layout constraints
    134             (layer-position-at-last-layout (79,20))
     176            (layer-position-at-last-layout (79,50))
    135177            (positioning-behavior stationary))
    136178          (related overflow nodes 1)
  • trunk/LayoutTests/platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt

    r245085 r245170  
    1212      (bounds 800.00 2618.00)
    1313      (contentsOpaque 1)
    14       (children 6
     14      (children 3
    1515        (GraphicsLayer
    1616          (position 21.00 21.00)
     
    2424        (GraphicsLayer
    2525          (offsetFromRenderer width=0 height=100)
    26           (position 28.00 20.00)
    27           (bounds 200.00 200.00)
    28           (children 1
    29             (GraphicsLayer
    30               (offsetFromRenderer width=0 height=100)
    31               (bounds 110.00 200.00)
    32               (contentsOpaque 1)
    33               (drawsContent 1)
    34             )
    35           )
    36         )
    37         (GraphicsLayer
    38           (offsetFromRenderer width=-5 height=-145)
    39           (position 28.00 20.00)
    40           (bounds 200.00 200.00)
    41           (children 1
    42             (GraphicsLayer
    43               (offsetFromRenderer width=0 height=-1)
    44               (position 5.00 144.00)
    45               (bounds 144.00 25.00)
    46               (drawsContent 1)
    47             )
    48           )
    49         )
    50         (GraphicsLayer
    51           (offsetFromRenderer width=0 height=100)
    5226          (position 28.00 250.00)
    5327          (bounds 185.00 200.00)
     
    5529            (GraphicsLayer
    5630              (offsetFromRenderer width=0 height=100)
    57               (bounds 110.00 200.00)
    58               (contentsOpaque 1)
    59               (drawsContent 1)
    60             )
    61           )
    62         )
    63         (GraphicsLayer
    64           (offsetFromRenderer width=-5 height=-145)
    65           (position 28.00 250.00)
    66           (bounds 185.00 200.00)
    67           (children 1
    68             (GraphicsLayer
    69               (offsetFromRenderer width=0 height=-1)
    70               (position 5.00 144.00)
    71               (bounds 144.00 25.00)
     31              (bounds 149.00 200.00)
    7232              (drawsContent 1)
    7333            )
  • trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt

    r245085 r245170  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 2.00)
    22       (children 6
     22      (children 4
    2323        (GraphicsLayer
    2424          (position 8.00 102.00)
     
    4949        )
    5050        (GraphicsLayer
    51           (position 9.00 91.00)
    52           (bounds 100.00 20.00)
    53           (visible rect 0.00, 0.00 100.00 x 20.00)
    54           (coverage rect 0.00, 0.00 100.00 x 20.00)
    55           (intersects coverage rect 1)
    56           (contentsScale 2.00)
    57           (children 1
    58             (GraphicsLayer
    59               (bounds 100.00 20.00)
    60               (drawsContent 1)
    61               (visible rect 0.00, 0.00 100.00 x 20.00)
    62               (coverage rect 0.00, 0.00 100.00 x 20.00)
    63               (intersects coverage rect 1)
    64               (contentsScale 2.00)
    65             )
    66           )
    67         )
    68         (GraphicsLayer
    69           (position 8.00 134.00)
    70           (bounds 102.00 22.00)
     51          (offsetFromRenderer width=-17 height=0)
     52          (position -9.00 134.00)
     53          (bounds 816.00 22.00)
    7154          (drawsContent 1)
    72           (visible rect 0.00, 0.00 102.00 x 22.00)
    73           (coverage rect -8.00, -134.00 800.00 x 600.00)
    74           (intersects coverage rect 1)
    75           (contentsScale 2.00)
    76         )
    77         (GraphicsLayer
    78           (offsetFromRenderer width=-9 height=0)
    79           (position 0.00 135.00)
    80           (bounds 807.00 20.00)
    81           (drawsContent 1)
    82           (visible rect 0.00, 0.00 800.00 x 20.00)
    83           (coverage rect 0.00, -135.00 800.00 x 600.00)
     55          (visible rect 9.00, 0.00 800.00 x 22.00)
     56          (coverage rect 9.00, -134.00 800.00 x 600.00)
    8457          (intersects coverage rect 1)
    8558          (contentsScale 2.00)
  • trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt

    r245085 r245170  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 2.00)
    22       (children 6
     22      (children 4
    2323        (GraphicsLayer
    2424          (position 8.00 102.00)
     
    4949        )
    5050        (GraphicsLayer
    51           (position 9.00 91.00)
    52           (bounds 100.00 20.00)
    53           (visible rect 0.00, 0.00 100.00 x 20.00)
    54           (coverage rect 0.00, 0.00 100.00 x 20.00)
    55           (intersects coverage rect 1)
    56           (contentsScale 2.00)
    57           (children 1
    58             (GraphicsLayer
    59               (bounds 100.00 20.00)
    60               (drawsContent 1)
    61               (visible rect 0.00, 0.00 100.00 x 20.00)
    62               (coverage rect 0.00, 0.00 100.00 x 20.00)
    63               (intersects coverage rect 1)
    64               (contentsScale 2.00)
    65             )
    66           )
    67         )
    68         (GraphicsLayer
    6951          (position 8.00 134.00)
    70           (bounds 102.00 22.00)
     52          (bounds 799.00 22.00)
    7153          (drawsContent 1)
    72           (visible rect 0.00, 0.00 102.00 x 22.00)
     54          (visible rect 0.00, 0.00 792.00 x 22.00)
    7355          (coverage rect -8.00, -134.00 800.00 x 600.00)
    74           (intersects coverage rect 1)
    75           (contentsScale 2.00)
    76         )
    77         (GraphicsLayer
    78           (position 9.00 135.00)
    79           (bounds 798.00 20.00)
    80           (drawsContent 1)
    81           (visible rect 0.00, 0.00 791.00 x 20.00)
    82           (coverage rect -9.00, -135.00 800.00 x 600.00)
    8356          (intersects coverage rect 1)
    8457          (contentsScale 2.00)
  • trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt

    r245085 r245170  
    1616                  (anchor 0.00 0.00)
    1717                  (bounds 320.00 1224.00)
    18                   (drawsContent 1)
     18                  (children 1
     19                    (GraphicsLayer
     20                      (position 10.00 10.00)
     21                      (bounds 284.00 1204.00)
     22                      (contentsOpaque 1)
     23                      (drawsContent 1)
     24                    )
     25                  )
    1926                )
    2027              )
  • trunk/LayoutTests/platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt

    r245085 r245170  
     1(GraphicsLayer
     2  (anchor 0.00 0.00)
     3  (bounds 800.00 600.00)
     4  (children 1
     5    (GraphicsLayer
     6      (bounds 800.00 600.00)
     7      (contentsOpaque 1)
     8      (children 1
     9        (GraphicsLayer
     10          (offsetFromRenderer width=-10 height=-10)
     11          (bounds 305.00 325.00)
     12          (children 1
     13            (GraphicsLayer
     14              (position 10.00 10.00)
     15              (bounds 284.00 1204.00)
     16              (contentsOpaque 1)
     17              (drawsContent 1)
     18            )
     19          )
     20        )
     21      )
     22    )
     23  )
     24)
    125
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r245085 r245170  
    66#//////////////////////////////////////////////////////////////////////////////////////////
    77
     8compositing/shared-backing/overflow-scroll [ Pass ]
    89editing/find [ Pass ]
    910editing/undo-manager [ Pass ]
  • trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt

    r245085 r245170  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 1.00)
    22       (children 6
     22      (children 4
    2323        (GraphicsLayer
    2424          (position 8.00 96.00)
     
    4949        )
    5050        (GraphicsLayer
    51           (position 9.00 87.00)
    52           (bounds 100.00 18.00)
    53           (visible rect 0.00, 0.00 100.00 x 18.00)
    54           (coverage rect 0.00, 0.00 100.00 x 18.00)
    55           (intersects coverage rect 1)
    56           (contentsScale 1.00)
    57           (children 1
    58             (GraphicsLayer
    59               (bounds 100.00 18.00)
    60               (drawsContent 1)
    61               (visible rect 0.00, 0.00 100.00 x 18.00)
    62               (coverage rect 0.00, 0.00 100.00 x 18.00)
    63               (intersects coverage rect 1)
    64               (contentsScale 1.00)
    65             )
    66           )
    67         )
    68         (GraphicsLayer
    69           (position 8.00 128.00)
    70           (bounds 102.00 20.00)
     51          (offsetFromRenderer width=-16 height=0)
     52          (position -8.00 128.00)
     53          (bounds 815.00 20.00)
    7154          (drawsContent 1)
    72           (visible rect 0.00, 0.00 102.00 x 20.00)
    73           (coverage rect -8.00, -128.00 800.00 x 585.00)
    74           (intersects coverage rect 1)
    75           (contentsScale 1.00)
    76         )
    77         (GraphicsLayer
    78           (offsetFromRenderer width=-9 height=0)
    79           (position 0.00 129.00)
    80           (bounds 807.00 18.00)
    81           (drawsContent 1)
    82           (visible rect 0.00, 0.00 800.00 x 18.00)
    83           (coverage rect 0.00, -129.00 800.00 x 585.00)
     55          (visible rect 8.00, 0.00 800.00 x 20.00)
     56          (coverage rect 8.00, -128.00 800.00 x 585.00)
    8457          (intersects coverage rect 1)
    8558          (contentsScale 1.00)
  • trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt

    r245085 r245170  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 1.00)
    22       (children 6
     22      (children 4
    2323        (GraphicsLayer
    2424          (position 8.00 96.00)
     
    4949        )
    5050        (GraphicsLayer
    51           (position 9.00 87.00)
    52           (bounds 100.00 18.00)
    53           (visible rect 0.00, 0.00 100.00 x 18.00)
    54           (coverage rect 0.00, 0.00 100.00 x 18.00)
    55           (intersects coverage rect 1)
    56           (contentsScale 1.00)
    57           (children 1
    58             (GraphicsLayer
    59               (bounds 100.00 18.00)
    60               (drawsContent 1)
    61               (visible rect 0.00, 0.00 100.00 x 18.00)
    62               (coverage rect 0.00, 0.00 100.00 x 18.00)
    63               (intersects coverage rect 1)
    64               (contentsScale 1.00)
    65             )
    66           )
    67         )
    68         (GraphicsLayer
    6951          (position 8.00 128.00)
    70           (bounds 102.00 20.00)
     52          (bounds 799.00 20.00)
    7153          (drawsContent 1)
    72           (visible rect 0.00, 0.00 102.00 x 20.00)
     54          (visible rect 0.00, 0.00 792.00 x 20.00)
    7355          (coverage rect -8.00, -128.00 800.00 x 585.00)
    74           (intersects coverage rect 1)
    75           (contentsScale 1.00)
    76         )
    77         (GraphicsLayer
    78           (position 9.00 129.00)
    79           (bounds 798.00 18.00)
    80           (drawsContent 1)
    81           (visible rect 0.00, 0.00 791.00 x 18.00)
    82           (coverage rect -9.00, -129.00 800.00 x 585.00)
    8356          (intersects coverage rect 1)
    8457          (contentsScale 1.00)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt

    r245085 r245170  
    1 absabs
     1abs
     2abs
    23
    34(Frame scrolling node
     
    1415  (max layout viewport origin (0,0))
    1516  (behavior for fixed 0)
    16   (children 3
     17  (children 5
    1718    (Overflow scrolling node
    1819      (scrollable area size 285 285)
    19       (contents size 381 500)
     20      (contents size 381 530)
    2021      (parent relative scrollable rect at (30,35) size 285x285)
    2122      (scrollable area parameters
     
    2930    (Positioned node
    3031      (layout constraints
     32        (layer-position-at-last-layout (10,10))
     33        (positioning-behavior moves))
     34      (related overflow nodes 1)
     35    )
     36    (Positioned node
     37      (layout constraints
    3138        (layer-position-at-last-layout (50,50))
     39        (positioning-behavior moves))
     40      (related overflow nodes 1)
     41    )
     42    (Positioned node
     43      (layout constraints
     44        (layer-position-at-last-layout (62,80))
    3245        (positioning-behavior moves))
    3346      (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html

    r245085 r245170  
    3636            background-image: repeating-linear-gradient(white, silver 200px);
    3737        }
     38       
     39        .sharing-preventer {
     40            transform: translateZ(0);
     41            margin: 10px;
     42            width: 10px;
     43            height: 10px;
     44        }
    3845    </style>
    3946    <script>
     
    4956<body>
    5057    <div class="scroller">
     58        <div class="sharing-preventer"></div>
    5159        <div class="absolute">abs
     60            <div class="sharing-preventer"></div>
    5261            <div class="inner absolute">abs</div>
    5362        </div>
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt

    r245085 r245170  
    1 absabs
     1abs
     2abs
    23
    34(Frame scrolling node
     
    1415  (max layout viewport origin (0,0))
    1516  (behavior for fixed 0)
    16   (children 4
     17  (children 7
    1718    (Overflow scrolling node
    1819      (scrollable area size 285 285)
    19       (contents size 285 526)
     20      (contents size 285 556)
    2021      (parent relative scrollable rect at (30,22) size 285x285)
    2122      (scrollable area parameters
     
    2829    (Positioned node
    2930      (layout constraints
    30         (layer-position-at-last-layout (0,0))
     31        (layer-position-at-last-layout (10,10))
    3132        (positioning-behavior moves))
    3233      (related overflow nodes 1)
     
    3435    (Positioned node
    3536      (layout constraints
    36         (layer-position-at-last-layout (53,53))
     37        (layer-position-at-last-layout (0,30))
    3738        (positioning-behavior moves))
    3839      (related overflow nodes 1)
     
    4041    (Positioned node
    4142      (layout constraints
    42         (layer-position-at-last-layout (80,80))
     43        (layer-position-at-last-layout (13,43))
     44        (positioning-behavior moves))
     45      (related overflow nodes 1)
     46    )
     47    (Positioned node
     48      (layout constraints
     49        (layer-position-at-last-layout (53,83))
     50        (positioning-behavior moves))
     51      (related overflow nodes 1)
     52    )
     53    (Positioned node
     54      (layout constraints
     55        (layer-position-at-last-layout (65,113))
     56        (positioning-behavior moves))
     57      (related overflow nodes 1)
     58    )
     59    (Positioned node
     60      (layout constraints
     61        (layer-position-at-last-layout (80,110))
    4362        (positioning-behavior moves))
    4463      (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html

    r245085 r245170  
    4141            background-image: repeating-linear-gradient(white, silver 200px);
    4242        }
     43
     44        .sharing-preventer {
     45            transform: translateZ(0);
     46            margin: 10px;
     47            width: 10px;
     48            height: 10px;
     49        }
    4350    </style>
    4451    <script>
     
    5562
    5663    <div class="scroller">
     64        <div class="sharing-preventer"></div>
    5765        <div class="relative">
     66            <div class="sharing-preventer"></div>
    5867            <div class="absolute">abs
     68                <div class="sharing-preventer"></div>
    5969                <div class="inner absolute">abs</div>
    6070            </div>
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245085 r245170  
    1 absabs
     1abs
     2abs
    23
    34(Frame scrolling node
     
    1718    (Overflow scrolling node
    1819      (scrollable area size 285 285)
    19       (contents size 285 500)
     20      (contents size 285 530)
    2021      (parent relative scrollable rect at (30,22) size 285x285)
    2122      (scrollable area parameters
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html

    r245085 r245170  
    3636            background-image: repeating-linear-gradient(white, silver 200px);
    3737        }
     38
     39        .sharing-preventer {
     40            transform: translateZ(0);
     41            margin: 10px;
     42            width: 10px;
     43            height: 10px;
     44        }
    3845    </style>
    3946    <script>
     
    4956<body>
    5057    <div class="scroller">
     58        <div class="sharing-preventer"></div>
    5159        <div class="absolute">abs
     60            <div class="sharing-preventer"></div>
    5261            <div class="inner absolute">abs</div>
    5362        </div>
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt

    r245085 r245170  
    2828  (max layout viewport origin (0,229))
    2929  (behavior for fixed 0)
    30   (children 12
     30  (children 19
    3131    (Overflow scrolling node
    3232      (scrollable area size 205 155)
     
    4343    (Positioned node
    4444      (layout constraints
    45         (layer-position-at-last-layout (10,28))
     45        (layer-position-at-last-layout (20,38))
    4646        (positioning-behavior moves))
    4747      (related overflow nodes 1)
     
    4949    (Positioned node
    5050      (layout constraints
    51         (layer-position-at-last-layout (10,46))
     51        (layer-position-at-last-layout (10,58))
     52        (positioning-behavior moves))
     53      (related overflow nodes 1)
     54    )
     55    (Positioned node
     56      (layout constraints
     57        (layer-position-at-last-layout (10,76))
    5258        (positioning-behavior moves))
    5359      (related overflow nodes 1)
     
    6773    (Positioned node
    6874      (layout constraints
    69         (layer-position-at-last-layout (10,28))
     75        (layer-position-at-last-layout (20,38))
     76        (positioning-behavior moves))
     77      (related overflow nodes 1)
     78    )
     79    (Positioned node
     80      (layout constraints
     81        (layer-position-at-last-layout (10,58))
    7082        (positioning-behavior moves))
    7183      (related overflow nodes 1)
     
    8294        (has enabled vertical scrollbar 1))
    8395    )
     96    (Positioned node
     97      (layout constraints
     98        (layer-position-at-last-layout (20,38))
     99        (positioning-behavior moves))
     100      (related overflow nodes 1)
     101    )
    84102    (Overflow scrolling node
    85103      (scrollable area size 205 155)
     
    92110        (vertical scrollbar mode 0)
    93111        (has enabled vertical scrollbar 1))
     112    )
     113    (Positioned node
     114      (layout constraints
     115        (layer-position-at-last-layout (20,38))
     116        (positioning-behavior moves))
     117      (related overflow nodes 1)
    94118    )
    95119    (Overflow scrolling node
     
    107131    (Positioned node
    108132      (layout constraints
    109         (layer-position-at-last-layout (10,28))
     133        (layer-position-at-last-layout (20,38))
    110134        (positioning-behavior moves))
    111135      (related overflow nodes 1)
     
    113137    (Positioned node
    114138      (layout constraints
    115         (layer-position-at-last-layout (110,46))
     139        (layer-position-at-last-layout (10,58))
     140        (positioning-behavior moves))
     141      (related overflow nodes 1)
     142    )
     143    (Positioned node
     144      (layout constraints
     145        (layer-position-at-last-layout (20,86))
     146        (positioning-behavior moves))
     147      (related overflow nodes 1)
     148    )
     149    (Positioned node
     150      (layout constraints
     151        (layer-position-at-last-layout (110,106))
    116152        (positioning-behavior moves))
    117153      (related overflow nodes 1)
     
    130166    (Positioned node
    131167      (layout constraints
    132         (layer-position-at-last-layout (10,28))
     168        (layer-position-at-last-layout (20,38))
     169        (positioning-behavior moves))
     170      (related overflow nodes 1)
     171    )
     172    (Positioned node
     173      (layout constraints
     174        (layer-position-at-last-layout (10,58))
    133175        (positioning-behavior moves))
    134176      (related overflow nodes 1)
     
    136178        (Positioned node
    137179          (layout constraints
    138             (layer-position-at-last-layout (79,18))
     180            (layer-position-at-last-layout (79,48))
    139181            (positioning-behavior stationary))
    140182          (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html

    r245085 r245170  
    4848            position: absolute;
    4949            left: 100px;
     50            transform: translateZ(0);
    5051        }
    5152
     
    5758        .scrolling-content {
    5859            height: 1000px;
     60        }
     61
     62        .sharing-preventer {
     63            transform: translateZ(0);
     64            margin: 10px;
     65            width: 10px;
     66            height: 10px;
    5967        }
    6068        </style>
     
    7785                <div class="scrolling-content">
    7886                    Scrolling content
     87                    <div class="sharing-preventer"></div>
    7988                    <div class="stacking">
    8089                        Stacking
     90                        <div class="sharing-preventer"></div>
    8191                        <div class="absolute box"></div>
    8292                    </div>
     
    8999                <div class="scrolling-content">
    90100                    Scrolling content
     101                    <div class="sharing-preventer"></div>
    91102                    <div class="containing">
    92103                        Containing
     104                        <div class="sharing-preventer"></div>
    93105                        <div class="absolute box"></div>
    94106                    </div>
     
    101113                <div class="scrolling-content">
    102114                    Scrolling content
     115                    <div class="sharing-preventer"></div>
    103116                    <div class="absolute box"></div>
    104117                </div>
     
    114127                        <div class="scrolling-content">
    115128                            Scrolling content
     129                            <div class="sharing-preventer"></div>
    116130                            <div class="absolute box"></div>
    117131                        </div>
     
    124138                <div class="scrolling-content">
    125139                    Scrolling content
     140                    <div class="sharing-preventer"></div>
    126141                    <div class="stacking">
    127142                        Stacking
    128143                        <div class="containing">
    129144                            Containing
     145                            <div class="sharing-preventer"></div>
    130146                            <div class="absolute box"></div>
    131147                        </div>
     
    138154                <div class="scrolling-content">
    139155                    Scrolling content
     156                    <div class="sharing-preventer"></div>
    140157                    <div class="containing">
    141158                        Containing
    142159                        <div class="stacking">
    143160                            Stacking
     161                            <div class="sharing-preventer"></div>
    144162                            <div class="absolute box"></div>
    145163                        </div>
  • trunk/Source/WebCore/ChangeLog

    r245162 r245170  
     12019-05-09  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
     4        https://bugs.webkit.org/show_bug.cgi?id=197561
     5        <rdar://problem/50445998>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        This change introduces the concept of layers that share backing store for compositing. A layer
     10        which is sharing its backing store first paints itself, and then some set of layers which come
     11        later in paint order in the same stacking context. This reduces the composited layer count in
     12        some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
     13       
     14        A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
     15        paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
     16        painting root so that positioning and clipping just work.
     17       
     18        Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
     19        We track the last layer which was composited in paint order as a shared candidate. If a later layer
     20        would composite for overlap (and no other reasons), then we allow it to share with the candidate
     21        if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
     22        in the same stacking context.
     23       
     24        isComposited() returns false for sharing layers, but they are like composited layers in that
     25        they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
     26        and repaints in shared layers have to be directed to their shared layer, hence
     27        changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
     28       
     29        The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
     30        all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
     31        TemporaryClipRects in that case.
     32
     33        Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
     34               compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
     35               compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
     36               compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
     37               compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
     38               compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
     39               compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
     40               compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
     41               compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
     42               compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
     43               compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
     44               compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
     45               compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
     46               compositing/shared-backing/partial-compositing-update.html
     47               compositing/shared-backing/partial-compositing-update2.html
     48               compositing/shared-backing/remove-sharing-layer.html
     49               compositing/shared-backing/sharing-cached-clip-rects.html
     50
     51        * rendering/RenderLayer.cpp:
     52        (WebCore::RenderLayer::~RenderLayer):
     53        (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
     54        (WebCore::RenderLayer::setBackingProviderLayer):
     55        (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
     56        (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
     57        (WebCore::RenderLayer::clippingRootForPainting const):
     58        (WebCore::RenderLayer::clipToRect):
     59        (WebCore::RenderLayer::paintLayer):
     60        (WebCore::RenderLayer::updateClipRects):
     61        (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
     62        (WebCore::RenderLayer::calculateClipRects const):
     63        (WebCore::outputPaintOrderTreeLegend):
     64        (WebCore::outputPaintOrderTreeRecursive):
     65        (WebCore::inContainingBlockChain): Deleted.
     66        * rendering/RenderLayer.h:
     67        * rendering/RenderLayerBacking.cpp:
     68        (WebCore::RenderLayerBacking::willBeDestroyed):
     69        (WebCore::clearBackingSharingLayerProviders):
     70        (WebCore::RenderLayerBacking::setBackingSharingLayers):
     71        (WebCore::RenderLayerBacking::removeBackingSharingLayer):
     72        (WebCore::RenderLayerBacking::clearBackingSharingLayers):
     73        (WebCore::RenderLayerBacking::updateCompositedBounds):
     74        (WebCore::RenderLayerBacking::updateDrawsContent):
     75        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
     76        (WebCore::RenderLayerBacking::paintIntoLayer):
     77        (WebCore::RenderLayerBacking::paintContents):
     78        * rendering/RenderLayerBacking.h:
     79        * rendering/RenderLayerCompositor.cpp:
     80        (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
     81        (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
     82        (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
     83        (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
     84        (WebCore::RenderLayerCompositor::updateCompositingLayers):
     85        (WebCore::backingProviderLayerCanIncludeLayer):
     86        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
     87        (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
     88        (WebCore::RenderLayerCompositor::updateBacking):
     89        (WebCore::RenderLayerCompositor::layerWillBeRemoved):
     90        (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
     91        * rendering/RenderLayerCompositor.h:
     92        * rendering/RenderTreeAsText.cpp:
     93
    1942019-05-09  Daniel Bates  <dabates@apple.com>
    295
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r245085 r245170  
    367367    clearLayerFilters();
    368368
     369    if (paintsIntoProvidedBacking()) {
     370        auto* backingProviderLayer = this->backingProviderLayer();
     371        if (backingProviderLayer->backing())
     372            backingProviderLayer->backing()->removeBackingSharingLayer(*this);
     373    }
     374
    369375    // Child layers will be deleted by their corresponding render objects, so
    370376    // we don't need to delete them ourselves.
     
    16641670}
    16651671
     1672bool RenderLayer::ancestorLayerIsInContainingBlockChain(const RenderLayer& ancestor, const RenderLayer* checkLimit) const
     1673{
     1674    if (&ancestor == this)
     1675        return true;
     1676
     1677    for (const auto* currentBlock = renderer().containingBlock(); currentBlock && !is<RenderView>(*currentBlock); currentBlock = currentBlock->containingBlock()) {
     1678        auto* currLayer = currentBlock->layer();
     1679        if (currLayer == &ancestor)
     1680            return true;
     1681       
     1682        if (currLayer && currLayer == checkLimit)
     1683            return false;
     1684    }
     1685   
     1686    return false;
     1687}
     1688
    16661689RenderLayer* RenderLayer::enclosingAncestorForPosition(PositionType position) const
    16671690{
     
    17471770}
    17481771
     1772void RenderLayer::setBackingProviderLayer(RenderLayer* backingProvider)
     1773{
     1774    if (backingProvider == m_backingProviderLayer)
     1775        return;
     1776
     1777    if (!renderer().renderTreeBeingDestroyed())
     1778        clearClipRectsIncludingDescendants();
     1779
     1780    m_backingProviderLayer = makeWeakPtr(backingProvider);
     1781}
     1782
     1783void RenderLayer::disconnectFromBackingProviderLayer()
     1784{
     1785    if (!m_backingProviderLayer)
     1786        return;
     1787   
     1788    ASSERT(m_backingProviderLayer->isComposited());
     1789    if (m_backingProviderLayer->isComposited())
     1790        m_backingProviderLayer->backing()->removeBackingSharingLayer(*this);
     1791}
     1792
    17491793bool compositedWithOwnBackingStore(const RenderLayer& layer)
    17501794{
     
    17671811RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot includeSelf) const
    17681812{
    1769     if (includeSelf == IncludeSelf && compositedWithOwnBackingStore(*this))
    1770         return const_cast<RenderLayer*>(this);
     1813    auto repaintTargetForLayer = [](const RenderLayer& layer) -> RenderLayer* {
     1814        if (compositedWithOwnBackingStore(layer))
     1815            return const_cast<RenderLayer*>(&layer);
     1816       
     1817        if (layer.paintsIntoProvidedBacking())
     1818            return layer.backingProviderLayer();
     1819       
     1820        return nullptr;
     1821    };
     1822
     1823    RenderLayer* repaintTarget = nullptr;
     1824    if (includeSelf == IncludeSelf && (repaintTarget = repaintTargetForLayer(*this)))
     1825        return repaintTarget;
    17711826
    17721827    for (const RenderLayer* curr = paintOrderParent(); curr; curr = curr->paintOrderParent()) {
    1773         if (compositedWithOwnBackingStore(*curr))
    1774             return const_cast<RenderLayer*>(curr);
     1828        if ((repaintTarget = repaintTargetForLayer(*curr)))
     1829            return repaintTarget;
    17751830    }
    17761831         
     
    18541909        return const_cast<RenderLayer*>(this);
    18551910
     1911    if (paintsIntoProvidedBacking())
     1912        return backingProviderLayer();
     1913
    18561914    const RenderLayer* current = this;
    18571915    while (current) {
     
    18631921        if (current->transform() || compositedWithOwnBackingStore(*current))
    18641922            return const_cast<RenderLayer*>(current);
     1923
     1924        if (current->paintsIntoProvidedBacking())
     1925            return current->backingProviderLayer();
    18651926    }
    18661927
     
    39293990}
    39303991
    3931 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLayer)
    3932 {
    3933     if (startLayer == endLayer)
    3934         return true;
    3935     for (const auto* currentBlock = startLayer->renderer().containingBlock(); currentBlock && !is<RenderView>(*currentBlock); currentBlock = currentBlock->containingBlock()) {
    3936         if (currentBlock->layer() == endLayer)
    3937             return true;
    3938     }
    3939    
    3940     return false;
    3941 }
    3942 
    39433992void RenderLayer::clipToRect(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, const ClipRect& clipRect, BorderRadiusClippingRule rule)
    39443993{
     
    39594008        // containing block chain so we check that also.
    39604009        for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent(); layer; layer = layer->parent()) {
    3961             if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && inContainingBlockChain(this, layer)) {
     4010            if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && ancestorLayerIsInContainingBlockChain(*layer)) {
    39624011                LayoutRect adjustedClipRect = LayoutRect(toLayoutPoint(layer->offsetFromAncestor(paintingInfo.rootLayer, AdjustForColumns)), layer->size());
    39634012                adjustedClipRect.move(paintingInfo.subpixelOffset);
     
    40214070void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, OptionSet<PaintLayerFlag> paintFlags)
    40224071{
    4023     if (isComposited()) {
    4024         // The performingPaintInvalidation() painting pass goes through compositing layers,
    4025         // but we need to ensure that we don't cache clip rects computed with the wrong root in this case.
    4026         if (context.performingPaintInvalidation() || (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers))
    4027             paintFlags.add(PaintLayerTemporaryClipRects);
    4028         else if (!backing()->paintsIntoWindow()
    4029             && !backing()->paintsIntoCompositedAncestor()
    4030             && !shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection))
    4031             && !paintForFixedRootBackground(this, paintFlags)) {
    4032             // If this RenderLayer should paint into its backing, that will be done via RenderLayerBacking::paintIntoLayer().
     4072    auto shouldContinuePaint = [&] () {
     4073        return backing()->paintsIntoWindow()
     4074            || backing()->paintsIntoCompositedAncestor()
     4075            || shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection))
     4076            || paintForFixedRootBackground(this, paintFlags);
     4077    };
     4078
     4079    auto paintsIntoDifferentCompositedDestination = [&]() {
     4080        if (paintsIntoProvidedBacking())
     4081            return true;
     4082   
     4083        if (isComposited() && !shouldContinuePaint())
     4084            return true;
     4085
     4086        return false;
     4087    };
     4088   
     4089    if (paintsIntoDifferentCompositedDestination()) {
     4090        if (!context.performingPaintInvalidation() && !(paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers))
    40334091            return;
    4034         }
    4035     } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
     4092
     4093        paintFlags.add(PaintLayerTemporaryClipRects);
     4094    }
     4095
     4096    if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
    40364097        // Don't paint out-of-view viewport constrained layers (when doing prepainting) because they will never be visible
    40374098        // unless their position or viewport size is changed.
     
    54415502    // examine the parent. We want to cache clip rects with us as the root.
    54425503    if (auto* parentLayer = (clipRectsContext.rootLayer != this ? parent() : nullptr))
    5443         parentClipRects = parentLayer->updateClipRects(clipRectsContext);
     5504        parentClipRects = this->parentClipRects(clipRectsContext);
    54445505
    54455506    auto clipRects = ClipRects::create();
     
    54605521        return nullptr;
    54615522    return m_clipRectsCache->getClipRects(context.clipRectsType, context.respectOverflowClip);
     5523}
     5524
     5525bool RenderLayer::clipCrossesPaintingBoundary() const
     5526{
     5527    return parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers) != enclosingPaginationLayer(IncludeCompositedPaginatedLayers)
     5528        || parent()->enclosingCompositingLayerForRepaint() != enclosingCompositingLayerForRepaint();
    54625529}
    54635530
     
    54845551            ClipRectsContext parentContext(clipRectsContext);
    54855552            parentContext.overlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize; // FIXME: why?
     5553           
     5554            if (clipCrossesPaintingBoundary())
     5555                parentContext.clipRectsType = TemporaryClipRects;
     5556
    54865557            parentLayer->calculateClipRects(parentContext, clipRects);
    54875558        }
     
    55355606    ASSERT(parent());
    55365607
    5537     if (clipRectsContext.clipRectsType == TemporaryClipRects) {
     5608    auto temporaryParentClipRects = [&](const ClipRectsContext& clipContext) {
    55385609        auto parentClipRects = ClipRects::create();
    5539         parent()->calculateClipRects(clipRectsContext, parentClipRects);
     5610        parent()->calculateClipRects(clipContext, parentClipRects);
    55405611        return parentClipRects;
     5612    };
     5613
     5614    if (clipRectsContext.clipRectsType == TemporaryClipRects)
     5615        return temporaryParentClipRects(clipRectsContext);
     5616
     5617    if (clipCrossesPaintingBoundary()) {
     5618        ClipRectsContext tempClipRectsContext(clipRectsContext);
     5619        tempClipRectsContext.clipRectsType = TemporaryClipRects;
     5620        return temporaryParentClipRects(tempClipRectsContext);
    55415621    }
    55425622
     
    55585638{
    55595639    ASSERT(parent());
    5560     auto computeParentRects = [&] {
    5561         if (clipRectsContext.clipRectsType == TemporaryClipRects)
    5562             return parentClipRects(clipRectsContext);
    5563         // If we cross into a different composition/pagination context, then we can't rely on the cache since the root layer differs.
    5564         bool crossesPaginationBoundary = parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers) != enclosingPaginationLayer(IncludeCompositedPaginatedLayers);
    5565         bool crossesCompositingBoundary = parent()->enclosingCompositingLayerForRepaint() != enclosingCompositingLayerForRepaint();
    5566         if (!crossesPaginationBoundary && !crossesCompositingBoundary)
    5567             return parentClipRects(clipRectsContext);
    5568 
    5569         ClipRectsContext tempContext(clipRectsContext);
    5570         tempContext.clipRectsType = TemporaryClipRects;
    5571         return parentClipRects(tempContext);
    5572     };
    5573    
    5574     auto parentRects = computeParentRects();
     5640    auto parentRects = parentClipRects(clipRectsContext);
    55755641    ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer().style().position());
    55765642    RenderView& view = renderer().view();
     
    59456011
    59466012    auto computeLayersUnion = [this, &unionBounds, flags, descendantFlags] (const RenderLayer& childLayer) {
    5947         if (!(flags & IncludeCompositedDescendants) && childLayer.isComposited())
     6013        if (!(flags & IncludeCompositedDescendants) && (childLayer.isComposited() || childLayer.paintsIntoProvidedBacking()))
    59486014            return;
    59496015        LayoutRect childBounds = childLayer.calculateLayerBounds(this, childLayer.offsetFromAncestor(this), descendantFlags);
     
    67926858{
    67936859    stream.nextLine();
    6794     stream << "(S)tacking Context/(F)orced SC/O(P)portunistic SC, (N)ormal flow only, (O)verflow clip, (A)lpha (opacity or mask), has (B)lend mode, (I)solates blending, (T)ransform-ish, (F)ilter, Fi(X)ed position, (C)omposited, (c)omposited descendant, (s)scrolling ancestor\n"
     6860    stream << "(S)tacking Context/(F)orced SC/O(P)portunistic SC, (N)ormal flow only, (O)verflow clip, (A)lpha (opacity or mask), has (B)lend mode, (I)solates blending, (T)ransform-ish, (F)ilter, Fi(X)ed position, (C)omposited, (P)rovides backing/uses (p)rovided backing, (c)omposited descendant, (s)scrolling ancestor\n"
    67956861        "Dirty (z)-lists, Dirty (n)ormal flow lists\n"
    67966862        "Traversal needs: requirements (t)raversal on descendants, (b)acking or hierarchy traversal on descendants, (r)equirements traversal on all descendants, requirements traversal on all (s)ubsequent layers, (h)ierarchy traversal on all descendants, update of paint (o)rder children\n"
     
    68186884    stream << (layer.renderer().isFixedPositioned() ? "X" : "-");
    68196885    stream << (layer.isComposited() ? "C" : "-");
     6886    stream << ((layer.isComposited() && layer.backing()->hasBackingSharingLayers()) ? "P" : (layer.paintsIntoProvidedBacking() ? "p" : "-"));
    68206887    stream << (layer.hasCompositingDescendant() ? "c" : "-");
    68216888    stream << (layer.hasCompositedScrollingAncestor() ? "s" : "-");
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r245085 r245170  
    604604    bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerDescendant; }
    605605
     606    bool ancestorLayerIsInContainingBlockChain(const RenderLayer& ancestor, const RenderLayer* checkLimit = nullptr) const;
     607
    606608    // Gets the nearest enclosing positioned ancestor layer (also includes
    607609    // the <html> layer and the root layer).
     
    702704    LayoutRect localClipRect(bool& clipExceedsBounds) const; // Returns the background clip rect of the layer in the local coordinate space.
    703705
     706    bool clipCrossesPaintingBoundary() const;
     707
    704708    // Pass offsetFromRoot if known.
    705709    bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot, const LayoutRect* cachedBoundingBox = nullptr) const;
     
    813817    bool hasCompositingDescendant() const { return m_hasCompositingDescendant; }
    814818    bool hasCompositedMask() const;
     819
     820    // If non-null, a non-ancestor composited layer that this layer paints into (it is sharing its backing store with this layer).
     821    RenderLayer* backingProviderLayer() const { return m_backingProviderLayer.get(); }
     822    void setBackingProviderLayer(RenderLayer*);
     823    void disconnectFromBackingProviderLayer();
     824
     825    bool paintsIntoProvidedBacking() const { return !!m_backingProviderLayer; }
    815826
    816827    RenderLayerBacking* backing() const { return m_backing.get(); }
     
    12581269    RenderLayer* m_last { nullptr };
    12591270
     1271    WeakPtr<RenderLayer> m_backingProviderLayer;
     1272
    12601273    // For layers that establish stacking contexts, m_posZOrderList holds a sorted list of all the
    12611274    // descendant layers within the stacking context that have z-indices of 0 or greater
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r245085 r245170  
    260260    ASSERT(m_owningLayer.backing() == this);
    261261    compositor().removeFromScrollCoordinatedLayers(m_owningLayer);
     262
     263    LOG(Compositing, "RenderLayer(backing) %p willBeDestroyed", &m_owningLayer);
     264
     265    clearBackingSharingLayers();
    262266}
    263267
     
    266270    if (layer && layer->type() == GraphicsLayer::Type::Normal && layer->tiledBacking())
    267271        compositor().layerTiledBackingUsageChanged(layer, false);
     272}
     273
     274static void clearBackingSharingLayerProviders(Vector<WeakPtr<RenderLayer>>& sharingLayers)
     275{
     276    for (auto& layerWeakPtr : sharingLayers) {
     277        if (!layerWeakPtr)
     278            continue;
     279        layerWeakPtr->setBackingProviderLayer(nullptr);
     280    }
     281}
     282
     283void RenderLayerBacking::setBackingSharingLayers(Vector<WeakPtr<RenderLayer>>&& sharingLayers)
     284{
     285    if (m_backingSharingLayers == sharingLayers) {
     286        sharingLayers.clear();
     287        return;
     288    }
     289
     290    clearBackingSharingLayerProviders(m_backingSharingLayers);
     291    m_backingSharingLayers = WTFMove(sharingLayers);
     292    for (auto& layerWeakPtr : m_backingSharingLayers)
     293        layerWeakPtr->setBackingProviderLayer(&m_owningLayer);
     294}
     295
     296void RenderLayerBacking::removeBackingSharingLayer(RenderLayer& layer)
     297{
     298    LOG(Compositing, "RenderLayer %p removeBackingSharingLayer %p", &m_owningLayer, &layer);
     299
     300    layer.setBackingProviderLayer(nullptr);
     301    m_backingSharingLayers.removeAll(&layer);
     302}
     303
     304void RenderLayerBacking::clearBackingSharingLayers()
     305{
     306    LOG(Compositing, "RenderLayer %p clearBackingSharingLayers", &m_owningLayer);
     307
     308    clearBackingSharingLayerProviders(m_backingSharingLayers);
     309    m_backingSharingLayers.clear();
    268310}
    269311
     
    607649bool RenderLayerBacking::updateCompositedBounds()
    608650{
    609     LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, LayoutSize(), RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
     651    LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, { }, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
    610652    // Clip to the size of the document or enclosing overflow-scroll layer.
    611653    // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
     
    629671        layerBounds.intersect(clippingBounds);
    630672    }
    631    
     673
     674    for (auto& layerWeakPtr : m_backingSharingLayers) {
     675        auto* boundsRootLayer = &m_owningLayer;
     676        ASSERT(layerWeakPtr->isDescendantOf(m_owningLayer));
     677        auto offset = layerWeakPtr->offsetFromAncestor(&m_owningLayer);
     678        auto bounds = layerWeakPtr->calculateLayerBounds(boundsRootLayer, offset, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
     679        layerBounds.unite(bounds);
     680    }
     681
    632682    // If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
    633683    // then we need to ensure that the compositing layer has non-zero size so that we can apply
     
    13981448        m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent);
    13991449
    1400         bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent());
     1450        bool hasScrollingPaintedContent = hasBackingSharingLayers() || (m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent()));
    14011451        m_scrolledContentsLayer->setDrawsContent(hasScrollingPaintedContent);
    14021452        return;
     
    21322182{
    21332183    if (m_owningLayer.isRenderViewLayer())
     2184        return false;
     2185
     2186    if (hasBackingSharingLayers())
    21342187        return false;
    21352188
     
    26042657#endif
    26052658
    2606     FrameView::PaintingState paintingState;
    2607     if (m_owningLayer.isRenderViewLayer())
    2608         renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState);
    2609 
    2610     RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer);
    2611 
    2612     m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags);
    2613 
    2614     if (m_owningLayer.containsDirtyOverlayScrollbars())
    2615         m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
    2616 
    2617     if (m_owningLayer.isRenderViewLayer())
    2618         renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState);
     2659    auto paintOneLayer = [&](RenderLayer& layer, OptionSet<RenderLayer::PaintLayerFlag> paintFlags) {
     2660        InspectorInstrumentation::willPaint(layer.renderer());
     2661
     2662        FrameView::PaintingState paintingState;
     2663        if (layer.isRenderViewLayer())
     2664            renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState);
     2665
     2666        RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer);
     2667
     2668        layer.paintLayerContents(context, paintingInfo, paintFlags);
     2669
     2670        if (layer.containsDirtyOverlayScrollbars())
     2671            layer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
     2672
     2673        if (layer.isRenderViewLayer())
     2674            renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState);
     2675
     2676        ASSERT(!m_owningLayer.m_usedTransparency);
     2677
     2678        InspectorInstrumentation::didPaint(layer.renderer(), paintDirtyRect);
     2679    };
     2680
     2681    paintOneLayer(m_owningLayer, paintFlags);
     2682   
     2683    // FIXME: Need to check m_foregroundLayer, masking etc. webkit.org/b/197565.
     2684    GraphicsLayer* destinationForSharingLayers = m_scrolledContentsLayer ? m_scrolledContentsLayer.get() : m_graphicsLayer.get();
     2685
     2686    if (graphicsLayer == destinationForSharingLayers) {
     2687        OptionSet<RenderLayer::PaintLayerFlag> sharingLayerPaintFlags = {
     2688            RenderLayer::PaintLayerPaintingCompositingBackgroundPhase,
     2689            RenderLayer::PaintLayerPaintingCompositingForegroundPhase };
     2690
     2691        if (paintingPhase & GraphicsLayerPaintOverflowContents)
     2692            sharingLayerPaintFlags.add(RenderLayer::PaintLayerPaintingOverflowContents);
     2693
     2694        for (auto& layerWeakPtr : m_backingSharingLayers)
     2695            paintOneLayer(*layerWeakPtr, sharingLayerPaintFlags);
     2696    }
    26192697
    26202698    compositor().didPaintBacking(this);
    2621 
    2622     ASSERT(!m_owningLayer.m_usedTransparency);
    26232699}
    26242700
     
    26482724        || graphicsLayer == m_childClippingMaskLayer.get()
    26492725        || graphicsLayer == m_scrolledContentsLayer.get()) {
    2650         InspectorInstrumentation::willPaint(renderer());
    26512726
    26522727        if (!(paintingPhase & GraphicsLayerPaintOverflowContents))
     
    26622737
    26632738        paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase);
    2664 
    2665         InspectorInstrumentation::didPaint(renderer(), dirtyRect);
    26662739    } else if (graphicsLayer == layerForHorizontalScrollbar()) {
    26672740        paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect);
     
    26702743    } else if (graphicsLayer == layerForScrollCorner()) {
    26712744        const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect();
    2672         context.save();
     2745        GraphicsContextStateSaver stateSaver(context);
    26732746        context.translate(-scrollCornerAndResizer.location());
    26742747        LayoutRect transformedClip = LayoutRect(clip);
     
    26762749        m_owningLayer.paintScrollCorner(context, IntPoint(), snappedIntRect(transformedClip));
    26772750        m_owningLayer.paintResizer(context, IntPoint(), transformedClip);
    2678         context.restore();
    26792751    }
    26802752#ifndef NDEBUG
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r245085 r245170  
    7070    RenderLayer& owningLayer() const { return m_owningLayer; }
    7171
     72    // Included layers are non-z-order descendant layers that are painted into this backing.
     73    const Vector<WeakPtr<RenderLayer>>& backingSharingLayers() const { return m_backingSharingLayers; }
     74    void setBackingSharingLayers(Vector<WeakPtr<RenderLayer>>&&);
     75
     76    bool hasBackingSharingLayers() const { return !m_backingSharingLayers.isEmpty(); }
     77
     78    void removeBackingSharingLayer(RenderLayer&);
     79    void clearBackingSharingLayers();
     80
    7281    void updateConfigurationAfterStyleChange();
    7382
     
    388397    RenderLayer& m_owningLayer;
    389398
     399    // A list other layers that paint into this backing store, later than m_owningLayer in paint order.
     400    Vector<WeakPtr<RenderLayer>> m_backingSharingLayers;
     401
    390402    RefPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context.
    391403    RefPtr<GraphicsLayer> m_contentsContainmentLayer; // Only used if we have a background layer; takes the transform.
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r245147 r245170  
    233233    }
    234234   
    235     CompositingState(const CompositingState& other)
    236         : compositingAncestor(other.compositingAncestor)
    237         , subtreeIsCompositing(other.subtreeIsCompositing)
    238         , testingOverlap(other.testingOverlap)
    239         , fullPaintOrderTraversalRequired(other.fullPaintOrderTraversalRequired)
    240         , descendantsRequireCompositingUpdate(other.descendantsRequireCompositingUpdate)
    241         , ancestorHasTransformAnimation(other.ancestorHasTransformAnimation)
     235    CompositingState stateForPaintOrderChildren(RenderLayer& layer) const
     236    {
     237        UNUSED_PARAM(layer);
     238        CompositingState childState(compositingAncestor);
     239        if (layer.isStackingContext())
     240            childState.stackingContextAncestor = &layer;
     241        else
     242            childState.stackingContextAncestor = stackingContextAncestor;
     243
     244        childState.subtreeIsCompositing = false;
     245        childState.testingOverlap = testingOverlap;
     246        childState.fullPaintOrderTraversalRequired = fullPaintOrderTraversalRequired;
     247        childState.descendantsRequireCompositingUpdate = descendantsRequireCompositingUpdate;
     248        childState.ancestorHasTransformAnimation = ancestorHasTransformAnimation;
    242249#if ENABLE(CSS_COMPOSITING)
    243         , hasNotIsolatedCompositedBlendingDescendants(other.hasNotIsolatedCompositedBlendingDescendants)
     250        childState.hasNotIsolatedCompositedBlendingDescendants = false; // FIXME: should this only be reset for stacking contexts?
    244251#endif
    245252#if ENABLE(TREE_DEBUGGING)
    246         , depth(other.depth + 1)
    247 #endif
     253        childState.depth = depth + 1;
     254#endif
     255        return childState;
     256    }
     257
     258    void propagateStateFromChildren(const CompositingState& childState)
    248259    {
    249     }
    250    
     260        // Subsequent layers in the parent stacking context also need to composite.
     261        subtreeIsCompositing |= childState.subtreeIsCompositing;
     262        fullPaintOrderTraversalRequired |= childState.fullPaintOrderTraversalRequired;
     263    }
     264
     265    void propagateStateFromChildrenForUnchangedSubtree(const CompositingState& childState)
     266    {
     267        subtreeIsCompositing |= childState.subtreeIsCompositing;
     268    }
     269
    251270    RenderLayer* compositingAncestor;
     271    RenderLayer* stackingContextAncestor { nullptr };
    252272    bool subtreeIsCompositing { false };
    253273    bool testingOverlap { true };
     
    261281    int depth { 0 };
    262282#endif
     283};
     284
     285struct RenderLayerCompositor::BackingSharingState {
     286    RenderLayer* backingProviderCandidate { nullptr };
     287    RenderLayer* backingProviderStackingContext { nullptr };
     288    Vector<WeakPtr<RenderLayer>> backingSharingLayers;
     289
     290    void resetBackingProviderCandidate(RenderLayer* candidateLayer = nullptr, RenderLayer* candidateStackingContext = nullptr)
     291    {
     292        if (!backingSharingLayers.isEmpty()) {
     293            ASSERT(backingProviderCandidate);
     294            backingProviderCandidate->backing()->setBackingSharingLayers(WTFMove(backingSharingLayers));
     295        }
     296        backingProviderCandidate = candidateLayer;
     297        backingProviderStackingContext = candidateLayer ? candidateStackingContext : nullptr;
     298    }
    263299};
    264300
     
    766802    if (updateRoot->hasDescendantNeedingCompositingRequirementsTraversal() || updateRoot->needsCompositingRequirementsTraversal()) {
    767803        CompositingState compositingState(updateRoot);
     804        BackingSharingState backingSharingState;
    768805        OverlapMap overlapMap;
    769806
    770807        bool descendantHas3DTransform = false;
    771         computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, descendantHas3DTransform);
     808        computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, backingSharingState, descendantHas3DTransform);
    772809    }
    773810
     
    822859}
    823860
    824 void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform)
    825 {
    826     if (!layer.hasDescendantNeedingCompositingRequirementsTraversal() && !layer.needsCompositingRequirementsTraversal() && !compositingState.fullPaintOrderTraversalRequired && !compositingState.descendantsRequireCompositingUpdate) {
    827         traverseUnchangedSubtree(ancestorLayer, layer, overlapMap, compositingState, descendantHas3DTransform);
     861static bool backingProviderLayerCanIncludeLayer(const RenderLayer& sharedLayer, const RenderLayer& layer)
     862{
     863    return layer.ancestorLayerIsInContainingBlockChain(sharedLayer);
     864}
     865
     866void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform)
     867{
     868    if (!layer.hasDescendantNeedingCompositingRequirementsTraversal()
     869        && !layer.needsCompositingRequirementsTraversal()
     870        && !compositingState.fullPaintOrderTraversalRequired
     871        && !compositingState.descendantsRequireCompositingUpdate) {
     872        traverseUnchangedSubtree(ancestorLayer, layer, overlapMap, compositingState, backingSharingState, descendantHas3DTransform);
    828873        return;
    829874    }
    830875
    831876#if ENABLE(TREE_DEBUGGING)
    832     LOG(Compositing, "%*p computeCompositingRequirements", 12 + compositingState.depth * 2, &layer);
     877    LOG(Compositing, "%*p %s computeCompositingRequirements (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, layer.isNormalFlowOnly() ? "n" : "s", backingSharingState.backingProviderCandidate);
    833878#endif
    834879
     
    841886
    842887    layer.setHasCompositingDescendant(false);
     888    layer.setBackingProviderLayer(nullptr);
    843889
    844890    // We updated compositing for direct reasons in layerStyleChanged(). Here, check for compositing that can only be evaluated after layout.
     
    862908
    863909    RenderLayer::IndirectCompositingReason compositingReason = compositingState.subtreeIsCompositing ? RenderLayer::IndirectCompositingReason::Stacking : RenderLayer::IndirectCompositingReason::None;
     910    bool layerPaintsIntoProvidedBacking = false;
    864911
    865912    // If we know for sure the layer is going to be composited, don't bother looking it up in the overlap map
    866913    if (!willBeComposited && !overlapMap.isEmpty() && compositingState.testingOverlap) {
    867914        computeExtent(overlapMap, layer, layerExtent);
     915
    868916        // If we're testing for overlap, we only need to composite if we overlap something that is already composited.
    869         compositingReason = overlapMap.overlapsLayers(layerExtent.bounds) ? RenderLayer::IndirectCompositingReason::Overlap : RenderLayer::IndirectCompositingReason::None;
     917        if (overlapMap.overlapsLayers(layerExtent.bounds)) {
     918            if (backingSharingState.backingProviderCandidate && backingProviderLayerCanIncludeLayer(*backingSharingState.backingProviderCandidate, layer)) {
     919                backingSharingState.backingSharingLayers.append(makeWeakPtr(layer));
     920                LOG(Compositing, " layer %p can share with %p", &layer, backingSharingState.backingProviderCandidate);
     921                compositingReason = RenderLayer::IndirectCompositingReason::None;
     922                layerPaintsIntoProvidedBacking = true;
     923            } else
     924                compositingReason = RenderLayer::IndirectCompositingReason::Overlap;
     925        } else
     926            compositingReason = RenderLayer::IndirectCompositingReason::None;
    870927    }
    871928
     
    889946    // a compositing layer among them, so start by inheriting the compositing
    890947    // ancestor with subtreeIsCompositing set to false.
    891     CompositingState childState(compositingState);
    892     childState.subtreeIsCompositing = false;
    893 #if ENABLE(CSS_COMPOSITING)
    894     childState.hasNotIsolatedCompositedBlendingDescendants = false;
    895 #endif
     948    CompositingState childState = compositingState.stateForPaintOrderChildren(layer);
     949
     950    auto layerWillComposite = [&](bool postDescendants = false) {
     951        // This layer now acts as the ancestor for kids.
     952        childState.compositingAncestor = &layer;
     953        overlapMap.pushCompositingContainer();
     954       
     955        if (postDescendants) {
     956            childState.subtreeIsCompositing = true;
     957            addToOverlapMapRecursive(overlapMap, layer);
     958        }
     959
     960        // This layer is going to be composited, so children can safely ignore the fact that there's an
     961        // animation running behind this layer, meaning they can rely on the overlap map testing again.
     962        childState.testingOverlap = true;
     963        willBeComposited = true;
     964
     965        layerPaintsIntoProvidedBacking = false;
     966        layer.disconnectFromBackingProviderLayer();
     967        backingSharingState.backingSharingLayers.removeAll(&layer);
     968    };
    896969
    897970    if (willBeComposited) {
    898971        // Tell the parent it has compositing descendants.
    899972        compositingState.subtreeIsCompositing = true;
    900         // This layer now acts as the ancestor for kids.
    901         childState.compositingAncestor = &layer;
    902 
    903         overlapMap.pushCompositingContainer();
    904         // This layer is going to be composited, so children can safely ignore the fact that there's an
    905         // animation running behind this layer, meaning they can rely on the overlap map testing again.
    906         childState.testingOverlap = true;
     973       
     974        layerWillComposite();
    907975
    908976        computeExtent(overlapMap, layer, layerExtent);
     
    910978        // Too hard to compute animated bounds if both us and some ancestor is animating transform.
    911979        layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation;
     980
     981        // Compositing for any reason disables backing sharing.
     982        LOG_WITH_STREAM(Compositing, stream << &layer << " is compositing - flushing sharing to " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     983        backingSharingState.resetBackingProviderCandidate();
    912984    }
    913985
     
    919991
    920992    for (auto* childLayer : layer.negativeZOrderLayers()) {
    921         computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     993        computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    922994
    923995        // If we have to make a layer for this child, make one now so we can have a contents layer
     
    926998            // make layer compositing
    927999            layer.setIndirectCompositingReason(RenderLayer::IndirectCompositingReason::BackgroundLayer);
    928             childState.compositingAncestor = &layer;
    929             overlapMap.pushCompositingContainer();
    930             // This layer is going to be composited, so children can safely ignore the fact that there's an
    931             // animation running behind this layer, meaning they can rely on the overlap map testing again
    932             childState.testingOverlap = true;
    933             willBeComposited = true;
     1000            layerWillComposite();
    9341001        }
    9351002    }
    9361003   
    9371004    for (auto* childLayer : layer.normalFlowLayers())
    938         computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1005        computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    9391006
    9401007    for (auto* childLayer : layer.positiveZOrderLayers())
    941         computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1008        computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    9421009
    9431010    // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled).
     
    9681035    RenderLayer::IndirectCompositingReason indirectCompositingReason;
    9691036    if (!willBeComposited && canBeComposited(layer)
    970         && requiresCompositingForIndirectReason(layer.renderer(), compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {
     1037        && requiresCompositingForIndirectReason(layer, compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, layerPaintsIntoProvidedBacking, indirectCompositingReason)) {
    9711038        layer.setIndirectCompositingReason(indirectCompositingReason);
    972         childState.compositingAncestor = &layer;
    973         childState.subtreeIsCompositing = true;
    974         overlapMap.pushCompositingContainer();
    975         addToOverlapMapRecursive(overlapMap, layer);
    976         willBeComposited = true;
     1039        layerWillComposite(true);
    9771040    }
    9781041   
     
    9941057        compositingState.testingOverlap = false;
    9951058   
    996     if (isCompositedClippingLayer) {
    997         if (!willBeComposited) {
    998             childState.compositingAncestor = &layer;
    999             childState.subtreeIsCompositing = true;
    1000             overlapMap.pushCompositingContainer();
    1001             addToOverlapMapRecursive(overlapMap, layer);
    1002             willBeComposited = true;
    1003         }
    1004     }
     1059    if (isCompositedClippingLayer & !willBeComposited)
     1060        layerWillComposite(true);
    10051061
    10061062#if ENABLE(CSS_COMPOSITING)
     
    10241080    }
    10251081
    1026     // Subsequent layers in the parent stacking context also need to composite.
    1027     compositingState.subtreeIsCompositing |= childState.subtreeIsCompositing;
    1028     compositingState.fullPaintOrderTraversalRequired |= childState.fullPaintOrderTraversalRequired;
     1082    compositingState.propagateStateFromChildren(childState);
    10291083
    10301084    ASSERT(willBeComposited == needsToBeComposited(layer, queryData));
     
    10381092        // The composited bounds of enclosing layers depends on which descendants are composited, so they need a geometry update.
    10391093        layer.setNeedsCompositingGeometryUpdateOnAncestors();
     1094    } else if (layer.isComposited())
     1095        layer.backing()->clearBackingSharingLayers();
     1096
     1097    if (backingSharingState.backingProviderCandidate && &layer == backingSharingState.backingProviderStackingContext) {
     1098        LOG_WITH_STREAM(Compositing, stream << &layer << " popping stacking context " << backingSharingState.backingProviderStackingContext << ", flushing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1099        backingSharingState.resetBackingProviderCandidate();
     1100    } else if (!backingSharingState.backingProviderCandidate && layer.isComposited()) {
     1101        LOG_WITH_STREAM(Compositing, stream << &layer << " compositing - sharing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1102        // Flush out any earlier candidate in this stacking context. This layer becomes a candidate.
     1103        backingSharingState.resetBackingProviderCandidate(&layer, compositingState.stackingContextAncestor);
    10401104    }
    10411105
     
    10521116
    10531117#if ENABLE(TREE_DEBUGGING)
    1054     LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d", 12 + compositingState.depth * 2, &layer, willBeComposited);
     1118    LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, willBeComposited, backingSharingState.backingProviderCandidate);
    10551119#endif
    10561120
     
    10611125
    10621126// We have to traverse unchanged layers to fill in the overlap map.
    1063 void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform)
     1127void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform)
    10641128{
    10651129    ASSERT(!compositingState.fullPaintOrderTraversalRequired);
     
    10871151        computeExtent(overlapMap, layer, layerExtent);
    10881152
    1089     CompositingState childState(compositingState);
    1090     childState.subtreeIsCompositing = false;
    1091 #if ENABLE(CSS_COMPOSITING)
    1092     childState.hasNotIsolatedCompositedBlendingDescendants = false;
    1093 #endif
     1153    if (layer.paintsIntoProvidedBacking()) {
     1154        ASSERT(backingSharingState.backingProviderCandidate);
     1155        ASSERT(backingProviderLayerCanIncludeLayer(*backingSharingState.backingProviderCandidate, layer));
     1156        backingSharingState.backingSharingLayers.append(makeWeakPtr(layer));
     1157    }
     1158
     1159    CompositingState childState = compositingState.stateForPaintOrderChildren(layer);
    10941160
    10951161    if (layerIsComposited) {
     
    11081174        // Too hard to compute animated bounds if both us and some ancestor is animating transform.
    11091175        layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation;
     1176
     1177        // Compositing for any reason disables backing sharing.
     1178        LOG_WITH_STREAM(Compositing, stream << "tus: " << &layer << " is compositing - flushing sharing to " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1179        backingSharingState.resetBackingProviderCandidate();
    11101180    }
    11111181
     
    11171187
    11181188    for (auto* childLayer : layer.negativeZOrderLayers()) {
    1119         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1189        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    11201190        if (childState.subtreeIsCompositing)
    11211191            ASSERT(layerIsComposited);
     
    11231193   
    11241194    for (auto* childLayer : layer.normalFlowLayers())
    1125         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1195        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    11261196
    11271197    for (auto* childLayer : layer.positiveZOrderLayers())
    1128         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1198        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    11291199
    11301200    // All layers (even ones that aren't being composited) need to get added to
     
    11361206        addToOverlapMap(overlapMap, layer, layerExtent);
    11371207
    1138     // Subsequent layers in the parent stacking context also need to composite.
    1139     if (childState.subtreeIsCompositing)
    1140         compositingState.subtreeIsCompositing = true;
     1208    compositingState.propagateStateFromChildrenForUnchangedSubtree(childState);
    11411209
    11421210    // Set the flag to say that this layer has compositing children.
     
    11631231    if (childState.compositingAncestor == &layer && !layer.isRenderViewLayer())
    11641232        overlapMap.popCompositingContainer();
     1233
     1234    if (layer.isComposited())
     1235        layer.backing()->clearBackingSharingLayers();
     1236
     1237    if (backingSharingState.backingProviderCandidate && &layer == backingSharingState.backingProviderStackingContext) {
     1238        LOG_WITH_STREAM(Compositing, stream << &layer << " tus: popping stacking context " << backingSharingState.backingProviderStackingContext << ", flushing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1239        backingSharingState.resetBackingProviderCandidate();
     1240    } else if (!backingSharingState.backingProviderCandidate && layer.isComposited()) {
     1241        LOG_WITH_STREAM(Compositing, stream << &layer << " tus: compositing - sharing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1242        // Flush out any earlier candidate in this stacking context. This layer becomes a candidate.
     1243        backingSharingState.resetBackingProviderCandidate(&layer, compositingState.stackingContextAncestor);
     1244    }
    11651245
    11661246    descendantHas3DTransform |= anyDescendantHas3DTransform || layer.has3DTransform();
     
    15821662
    15831663    if (backingRequired == BackingRequired::Yes) {
     1664        layer.disconnectFromBackingProviderLayer();
     1665
    15841666        enableCompositingMode();
    15851667       
     
    17341816void RenderLayerCompositor::layerWillBeRemoved(RenderLayer& parent, RenderLayer& child)
    17351817{
    1736     if (!child.isComposited() || parent.renderer().renderTreeBeingDestroyed())
     1818    if (parent.renderer().renderTreeBeingDestroyed())
    17371819        return;
    17381820
    1739     repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits?
     1821    if (child.isComposited())
     1822        repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits?
     1823    else if (child.paintsIntoProvidedBacking()) {
     1824        auto* backingProviderLayer = child.backingProviderLayer();
     1825        // FIXME: Optimize this repaint.
     1826        backingProviderLayer->setBackingNeedsRepaint();
     1827        backingProviderLayer->backing()->removeBackingSharingLayer(child);
     1828    } else
     1829        return;
    17401830
    17411831    child.setNeedsCompositingLayerConnection();
     
    28002890
    28012891// FIXME: why doesn't this handle the clipping cases?
    2802 bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const
    2803 {
    2804     auto& layer = *renderer.layer();
    2805 
     2892bool RenderLayerCompositor::requiresCompositingForIndirectReason(const RenderLayer& layer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, bool paintsIntoProvidedBacking, RenderLayer::IndirectCompositingReason& reason) const
     2893{
    28062894    // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented
    28072895    // via compositing so that they also apply to those composited descendants.
     2896    auto& renderer = layer.renderer();
    28082897    if (hasCompositedDescendants && (layer.isolatesCompositedBlending() || layer.transform() || renderer.createsGroup() || renderer.hasReflection())) {
    28092898        reason = RenderLayer::IndirectCompositingReason::GraphicalEffect;
     
    28252914    }
    28262915
    2827     if (renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {
     2916    if (!paintsIntoProvidedBacking && renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {
    28282917        if (layerContainingBlockCrossesCoordinatedScrollingBoundary(layer, *compositingAncestor)) {
    28292918            reason = RenderLayer::IndirectCompositingReason::OverflowScrollPositioning;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r245085 r245170  
    370370    class OverlapMap;
    371371    struct CompositingState;
     372    struct BackingSharingState;
    372373    struct OverlapExtent;
    373374
     
    411412    void updateCompositingLayersTimerFired();
    412413
    413     void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, bool& descendantHas3DTransform);
    414     void traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, bool& descendantHas3DTransform);
     414    void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, BackingSharingState&, bool& descendantHas3DTransform);
     415    void traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, BackingSharingState&, bool& descendantHas3DTransform);
    415416
    416417    enum class UpdateLevel {
     
    477478    bool requiresCompositingForOverflowScrolling(const RenderLayer&, RequiresCompositingData&) const;
    478479    bool requiresCompositingForEditableImage(RenderLayerModelObject&) const;
    479     bool requiresCompositingForIndirectReason(RenderLayerModelObject&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;
     480    bool requiresCompositingForIndirectReason(const RenderLayer&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, bool paintsIntoProvidedBacking, RenderLayer::IndirectCompositingReason&) const;
    480481
    481482    static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer&, const RenderLayer& compositedAncestor);
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r245085 r245170  
    655655            ts << " (composited, bounds=" << layer.backing()->compositedBounds() << ", drawsContent=" << layer.backing()->graphicsLayer()->drawsContent()
    656656                << ", paints into ancestor=" << layer.backing()->paintsIntoCompositedAncestor() << ")";
    657         }
     657        } else if (layer.paintsIntoProvidedBacking())
     658            ts << " (shared backing of " << layer.backingProviderLayer() << ")";
    658659    }
    659660
Note: See TracChangeset for help on using the changeset viewer.