Changeset 245058 in webkit


Ignore:
Timestamp:
May 8, 2019 10:21:52 AM (5 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
37 edited
7 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245057 r245058  
     12019-05-08  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-08  Wenson Hsieh  <wenson_hsieh@apple.com>
    285
  • trunk/LayoutTests/TestExpectations

    r245004 r245058  
    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

    r225897 r245058  
    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

    r225897 r245058  
    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

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

    r244628 r245058  
    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

    r244628 r245058  
    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

    r245057 r245058  
     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

    r245057 r245058  
    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

    r245057 r245058  
     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

    r245057 r245058  
     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

    r245010 r245058  
    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

    r245057 r245058  
     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

    r245057 r245058  
     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

    r245057 r245058  
     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

    r244215 r245058  
    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

    r244215 r245058  
    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

    r244215 r245058  
    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

    r243211 r245058  
    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

    r243349 r245058  
    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

    r225897 r245058  
    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

    r223799 r245058  
    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

    r244628 r245058  
    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/TestExpectations

    r245053 r245058  
    692692webkit.org/b/172384 fast/hidpi/hidpi-long-page-with-inset-element.html [ Skip ]
    693693
     694webkit.org/b/197695 [ Debug ] fast/hidpi/video-controls-in-hidpi.html [ Skip ]
     695
    694696webkit.org/b/194309 media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html [ Pass Failure ]
    695697
  • trunk/LayoutTests/platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt

    r243361 r245058  
     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

    r245025 r245058  
    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

    r225897 r245058  
    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

    r183300 r245058  
    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

    r244215 r245058  
    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

    r244215 r245058  
    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

    r244215 r245058  
    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

    r244215 r245058  
    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

    r244215 r245058  
    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

    r244215 r245058  
    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

    r243314 r245058  
    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

    r243347 r245058  
    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

    r245056 r245058  
     12019-05-08  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-08  Brent Fulgham  <bfulgham@apple.com>
    295
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r245019 r245058  
    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    clearClipRectsIncludingDescendants();
     1778    m_backingProviderLayer = makeWeakPtr(backingProvider);
     1779}
     1780
     1781void RenderLayer::disconnectFromBackingProviderLayer()
     1782{
     1783    if (!m_backingProviderLayer)
     1784        return;
     1785   
     1786    ASSERT(m_backingProviderLayer->isComposited());
     1787    if (m_backingProviderLayer->isComposited())
     1788        m_backingProviderLayer->backing()->removeBackingSharingLayer(*this);
     1789}
     1790
    17491791bool compositedWithOwnBackingStore(const RenderLayer& layer)
    17501792{
     
    17671809RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot includeSelf) const
    17681810{
    1769     if (includeSelf == IncludeSelf && compositedWithOwnBackingStore(*this))
    1770         return const_cast<RenderLayer*>(this);
     1811    auto repaintTargetForLayer = [](const RenderLayer& layer) -> RenderLayer* {
     1812        if (compositedWithOwnBackingStore(layer))
     1813            return const_cast<RenderLayer*>(&layer);
     1814       
     1815        if (layer.paintsIntoProvidedBacking())
     1816            return layer.backingProviderLayer();
     1817       
     1818        return nullptr;
     1819    };
     1820
     1821    RenderLayer* repaintTarget = nullptr;
     1822    if (includeSelf == IncludeSelf && (repaintTarget = repaintTargetForLayer(*this)))
     1823        return repaintTarget;
    17711824
    17721825    for (const RenderLayer* curr = paintOrderParent(); curr; curr = curr->paintOrderParent()) {
    1773         if (compositedWithOwnBackingStore(*curr))
    1774             return const_cast<RenderLayer*>(curr);
     1826        if ((repaintTarget = repaintTargetForLayer(*curr)))
     1827            return repaintTarget;
    17751828    }
    17761829         
     
    18541907        return const_cast<RenderLayer*>(this);
    18551908
     1909    if (paintsIntoProvidedBacking())
     1910        return backingProviderLayer();
     1911
    18561912    const RenderLayer* current = this;
    18571913    while (current) {
     
    18631919        if (current->transform() || compositedWithOwnBackingStore(*current))
    18641920            return const_cast<RenderLayer*>(current);
     1921
     1922        if (current->paintsIntoProvidedBacking())
     1923            return current->backingProviderLayer();
    18651924    }
    18661925
     
    39293988}
    39303989
    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 
    39433990void RenderLayer::clipToRect(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, const ClipRect& clipRect, BorderRadiusClippingRule rule)
    39443991{
     
    39594006        // containing block chain so we check that also.
    39604007        for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent(); layer; layer = layer->parent()) {
    3961             if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && inContainingBlockChain(this, layer)) {
     4008            if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && ancestorLayerIsInContainingBlockChain(*layer)) {
    39624009                LayoutRect adjustedClipRect = LayoutRect(toLayoutPoint(layer->offsetFromAncestor(paintingInfo.rootLayer, AdjustForColumns)), layer->size());
    39634010                adjustedClipRect.move(paintingInfo.subpixelOffset);
     
    40214068void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, OptionSet<PaintLayerFlag> paintFlags)
    40224069{
    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().
     4070    auto shouldContinuePaint = [&] () {
     4071        return backing()->paintsIntoWindow()
     4072            || backing()->paintsIntoCompositedAncestor()
     4073            || shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection))
     4074            || paintForFixedRootBackground(this, paintFlags);
     4075    };
     4076
     4077    auto paintsIntoDifferentCompositedDestination = [&]() {
     4078        if (paintsIntoProvidedBacking())
     4079            return true;
     4080   
     4081        if (isComposited() && !shouldContinuePaint())
     4082            return true;
     4083
     4084        return false;
     4085    };
     4086   
     4087    if (paintsIntoDifferentCompositedDestination()) {
     4088        if (!context.performingPaintInvalidation() && !(paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers))
    40334089            return;
    4034         }
    4035     } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
     4090
     4091        paintFlags.add(PaintLayerTemporaryClipRects);
     4092    }
     4093
     4094    if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
    40364095        // Don't paint out-of-view viewport constrained layers (when doing prepainting) because they will never be visible
    40374096        // unless their position or viewport size is changed.
     
    54415500    // examine the parent. We want to cache clip rects with us as the root.
    54425501    if (auto* parentLayer = (clipRectsContext.rootLayer != this ? parent() : nullptr))
    5443         parentClipRects = parentLayer->updateClipRects(clipRectsContext);
     5502        parentClipRects = this->parentClipRects(clipRectsContext);
    54445503
    54455504    auto clipRects = ClipRects::create();
     
    54605519        return nullptr;
    54615520    return m_clipRectsCache->getClipRects(context.clipRectsType, context.respectOverflowClip);
     5521}
     5522
     5523bool RenderLayer::clipCrossesPaintingBoundary() const
     5524{
     5525    return parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers) != enclosingPaginationLayer(IncludeCompositedPaginatedLayers)
     5526        || parent()->enclosingCompositingLayerForRepaint() != enclosingCompositingLayerForRepaint();
    54625527}
    54635528
     
    54845549            ClipRectsContext parentContext(clipRectsContext);
    54855550            parentContext.overlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize; // FIXME: why?
     5551           
     5552            if (clipCrossesPaintingBoundary())
     5553                parentContext.clipRectsType = TemporaryClipRects;
     5554
    54865555            parentLayer->calculateClipRects(parentContext, clipRects);
    54875556        }
     
    55355604    ASSERT(parent());
    55365605
    5537     if (clipRectsContext.clipRectsType == TemporaryClipRects) {
     5606    auto temporaryParentClipRects = [&](const ClipRectsContext& clipContext) {
    55385607        auto parentClipRects = ClipRects::create();
    5539         parent()->calculateClipRects(clipRectsContext, parentClipRects);
     5608        parent()->calculateClipRects(clipContext, parentClipRects);
    55405609        return parentClipRects;
     5610    };
     5611
     5612    if (clipRectsContext.clipRectsType == TemporaryClipRects)
     5613        return temporaryParentClipRects(clipRectsContext);
     5614
     5615    if (clipCrossesPaintingBoundary()) {
     5616        ClipRectsContext tempClipRectsContext(clipRectsContext);
     5617        tempClipRectsContext.clipRectsType = TemporaryClipRects;
     5618        return temporaryParentClipRects(tempClipRectsContext);
    55415619    }
    55425620
     
    55585636{
    55595637    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();
     5638    auto parentRects = parentClipRects(clipRectsContext);
    55755639    ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer().style().position());
    55765640    RenderView& view = renderer().view();
     
    59456009
    59466010    auto computeLayersUnion = [this, &unionBounds, flags, descendantFlags] (const RenderLayer& childLayer) {
    5947         if (!(flags & IncludeCompositedDescendants) && childLayer.isComposited())
     6011        if (!(flags & IncludeCompositedDescendants) && (childLayer.isComposited() || childLayer.paintsIntoProvidedBacking()))
    59486012            return;
    59496013        LayoutRect childBounds = childLayer.calculateLayerBounds(this, childLayer.offsetFromAncestor(this), descendantFlags);
     
    67926856{
    67936857    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"
     6858    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"
    67956859        "Dirty (z)-lists, Dirty (n)ormal flow lists\n"
    67966860        "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"
     
    68186882    stream << (layer.renderer().isFixedPositioned() ? "X" : "-");
    68196883    stream << (layer.isComposited() ? "C" : "-");
     6884    stream << ((layer.isComposited() && layer.backing()->hasBackingSharingLayers()) ? "P" : (layer.paintsIntoProvidedBacking() ? "p" : "-"));
    68206885    stream << (layer.hasCompositingDescendant() ? "c" : "-");
    68216886    stream << (layer.hasCompositedScrollingAncestor() ? "s" : "-");
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r245019 r245058  
    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

    r244800 r245058  
    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    layer.clearClipRectsIncludingDescendants(PaintingClipRects);
     302    m_backingSharingLayers.removeAll(&layer);
     303}
     304
     305void RenderLayerBacking::clearBackingSharingLayers()
     306{
     307    LOG(Compositing, "RenderLayer %p clearBackingSharingLayers", &m_owningLayer);
     308
     309    clearBackingSharingLayerProviders(m_backingSharingLayers);
     310    m_backingSharingLayers.clear();
    268311}
    269312
     
    607650bool RenderLayerBacking::updateCompositedBounds()
    608651{
    609     LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, LayoutSize(), RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
     652    LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, { }, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
    610653    // Clip to the size of the document or enclosing overflow-scroll layer.
    611654    // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
     
    629672        layerBounds.intersect(clippingBounds);
    630673    }
    631    
     674
     675    for (auto& layerWeakPtr : m_backingSharingLayers) {
     676        auto* boundsRootLayer = &m_owningLayer;
     677        ASSERT(layerWeakPtr->isDescendantOf(m_owningLayer));
     678        auto offset = layerWeakPtr->offsetFromAncestor(&m_owningLayer);
     679        auto bounds = layerWeakPtr->calculateLayerBounds(boundsRootLayer, offset, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
     680        layerBounds.unite(bounds);
     681    }
     682
    632683    // If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
    633684    // then we need to ensure that the compositing layer has non-zero size so that we can apply
     
    13981449        m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent);
    13991450
    1400         bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent());
     1451        bool hasScrollingPaintedContent = hasBackingSharingLayers() || (m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent()));
    14011452        m_scrolledContentsLayer->setDrawsContent(hasScrollingPaintedContent);
    14021453        return;
     
    21322183{
    21332184    if (m_owningLayer.isRenderViewLayer())
     2185        return false;
     2186
     2187    if (hasBackingSharingLayers())
    21342188        return false;
    21352189
     
    26042658#endif
    26052659
    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);
     2660    auto paintOneLayer = [&](RenderLayer& layer, OptionSet<RenderLayer::PaintLayerFlag> paintFlags) {
     2661        InspectorInstrumentation::willPaint(layer.renderer());
     2662
     2663        FrameView::PaintingState paintingState;
     2664        if (layer.isRenderViewLayer())
     2665            renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState);
     2666
     2667        RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer);
     2668
     2669        layer.paintLayerContents(context, paintingInfo, paintFlags);
     2670
     2671        if (layer.containsDirtyOverlayScrollbars())
     2672            layer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
     2673
     2674        if (layer.isRenderViewLayer())
     2675            renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState);
     2676
     2677        ASSERT(!m_owningLayer.m_usedTransparency);
     2678
     2679        InspectorInstrumentation::didPaint(layer.renderer(), paintDirtyRect);
     2680    };
     2681
     2682    paintOneLayer(m_owningLayer, paintFlags);
     2683   
     2684    // FIXME: Need to check m_foregroundLayer, masking etc. webkit.org/b/197565.
     2685    GraphicsLayer* destinationForSharingLayers = m_scrolledContentsLayer ? m_scrolledContentsLayer.get() : m_graphicsLayer.get();
     2686
     2687    if (graphicsLayer == destinationForSharingLayers) {
     2688        OptionSet<RenderLayer::PaintLayerFlag> sharingLayerPaintFlags = {
     2689            RenderLayer::PaintLayerPaintingCompositingBackgroundPhase,
     2690            RenderLayer::PaintLayerPaintingCompositingForegroundPhase };
     2691
     2692        if (paintingPhase & GraphicsLayerPaintOverflowContents)
     2693            sharingLayerPaintFlags.add(RenderLayer::PaintLayerPaintingOverflowContents);
     2694
     2695        for (auto& layerWeakPtr : m_backingSharingLayers)
     2696            paintOneLayer(*layerWeakPtr, sharingLayerPaintFlags);
     2697    }
    26192698
    26202699    compositor().didPaintBacking(this);
    2621 
    2622     ASSERT(!m_owningLayer.m_usedTransparency);
    26232700}
    26242701
     
    26482725        || graphicsLayer == m_childClippingMaskLayer.get()
    26492726        || graphicsLayer == m_scrolledContentsLayer.get()) {
    2650         InspectorInstrumentation::willPaint(renderer());
    26512727
    26522728        if (!(paintingPhase & GraphicsLayerPaintOverflowContents))
     
    26622738
    26632739        paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase);
    2664 
    2665         InspectorInstrumentation::didPaint(renderer(), dirtyRect);
    26662740    } else if (graphicsLayer == layerForHorizontalScrollbar()) {
    26672741        paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect);
     
    26702744    } else if (graphicsLayer == layerForScrollCorner()) {
    26712745        const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect();
    2672         context.save();
     2746        GraphicsContextStateSaver stateSaver(context);
    26732747        context.translate(-scrollCornerAndResizer.location());
    26742748        LayoutRect transformedClip = LayoutRect(clip);
     
    26762750        m_owningLayer.paintScrollCorner(context, IntPoint(), snappedIntRect(transformedClip));
    26772751        m_owningLayer.paintResizer(context, IntPoint(), transformedClip);
    2678         context.restore();
    26792752    }
    26802753#ifndef NDEBUG
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r243151 r245058  
    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

    r244837 r245058  
    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).
     
    9621029    RenderLayer::IndirectCompositingReason indirectCompositingReason;
    9631030    if (!willBeComposited && canBeComposited(layer)
    964         && requiresCompositingForIndirectReason(layer.renderer(), compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {
     1031        && requiresCompositingForIndirectReason(layer, compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, layerPaintsIntoProvidedBacking, indirectCompositingReason)) {
    9651032        layer.setIndirectCompositingReason(indirectCompositingReason);
    966         childState.compositingAncestor = &layer;
    967         childState.subtreeIsCompositing = true;
    968         overlapMap.pushCompositingContainer();
    969         addToOverlapMapRecursive(overlapMap, layer);
    970         willBeComposited = true;
     1033        layerWillComposite(true);
    9711034    }
    9721035   
     
    9881051        compositingState.testingOverlap = false;
    9891052   
    990     if (isCompositedClippingLayer) {
    991         if (!willBeComposited) {
    992             childState.compositingAncestor = &layer;
    993             childState.subtreeIsCompositing = true;
    994             overlapMap.pushCompositingContainer();
    995             addToOverlapMapRecursive(overlapMap, layer);
    996             willBeComposited = true;
    997         }
    998     }
     1053    if (isCompositedClippingLayer & !willBeComposited)
     1054        layerWillComposite(true);
    9991055
    10001056#if ENABLE(CSS_COMPOSITING)
     
    10181074    }
    10191075
    1020     // Subsequent layers in the parent stacking context also need to composite.
    1021     compositingState.subtreeIsCompositing |= childState.subtreeIsCompositing;
    1022     compositingState.fullPaintOrderTraversalRequired |= childState.fullPaintOrderTraversalRequired;
     1076    compositingState.propagateStateFromChildren(childState);
    10231077
    10241078    ASSERT(willBeComposited == needsToBeComposited(layer, queryData));
     
    10321086        // The composited bounds of enclosing layers depends on which descendants are composited, so they need a geometry update.
    10331087        layer.setNeedsCompositingGeometryUpdateOnAncestors();
     1088    } else if (layer.isComposited())
     1089        layer.backing()->clearBackingSharingLayers();
     1090
     1091    if (backingSharingState.backingProviderCandidate && &layer == backingSharingState.backingProviderStackingContext) {
     1092        LOG_WITH_STREAM(Compositing, stream << &layer << " popping stacking context " << backingSharingState.backingProviderStackingContext << ", flushing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1093        backingSharingState.resetBackingProviderCandidate();
     1094    } else if (!backingSharingState.backingProviderCandidate && layer.isComposited()) {
     1095        LOG_WITH_STREAM(Compositing, stream << &layer << " compositing - sharing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1096        // Flush out any earlier candidate in this stacking context. This layer becomes a candidate.
     1097        backingSharingState.resetBackingProviderCandidate(&layer, compositingState.stackingContextAncestor);
    10341098    }
    10351099
     
    10461110
    10471111#if ENABLE(TREE_DEBUGGING)
    1048     LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d", 12 + compositingState.depth * 2, &layer, willBeComposited);
     1112    LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, willBeComposited, backingSharingState.backingProviderCandidate);
    10491113#endif
    10501114
     
    10551119
    10561120// We have to traverse unchanged layers to fill in the overlap map.
    1057 void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform)
     1121void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform)
    10581122{
    10591123    ASSERT(!compositingState.fullPaintOrderTraversalRequired);
     
    10811145        computeExtent(overlapMap, layer, layerExtent);
    10821146
    1083     CompositingState childState(compositingState);
    1084     childState.subtreeIsCompositing = false;
    1085 #if ENABLE(CSS_COMPOSITING)
    1086     childState.hasNotIsolatedCompositedBlendingDescendants = false;
    1087 #endif
     1147    if (layer.paintsIntoProvidedBacking()) {
     1148        ASSERT(backingSharingState.backingProviderCandidate);
     1149        ASSERT(backingProviderLayerCanIncludeLayer(*backingSharingState.backingProviderCandidate, layer));
     1150        backingSharingState.backingSharingLayers.append(makeWeakPtr(layer));
     1151    }
     1152
     1153    CompositingState childState = compositingState.stateForPaintOrderChildren(layer);
    10881154
    10891155    if (layerIsComposited) {
     
    11021168        // Too hard to compute animated bounds if both us and some ancestor is animating transform.
    11031169        layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation;
     1170
     1171        // Compositing for any reason disables backing sharing.
     1172        LOG_WITH_STREAM(Compositing, stream << "tus: " << &layer << " is compositing - flushing sharing to " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1173        backingSharingState.resetBackingProviderCandidate();
    11041174    }
    11051175
     
    11111181
    11121182    for (auto* childLayer : layer.negativeZOrderLayers()) {
    1113         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1183        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    11141184        if (childState.subtreeIsCompositing)
    11151185            ASSERT(layerIsComposited);
     
    11171187   
    11181188    for (auto* childLayer : layer.normalFlowLayers())
    1119         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1189        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    11201190
    11211191    for (auto* childLayer : layer.positiveZOrderLayers())
    1122         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
     1192        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
    11231193
    11241194    // All layers (even ones that aren't being composited) need to get added to
     
    11301200        addToOverlapMap(overlapMap, layer, layerExtent);
    11311201
    1132     // Subsequent layers in the parent stacking context also need to composite.
    1133     if (childState.subtreeIsCompositing)
    1134         compositingState.subtreeIsCompositing = true;
     1202    compositingState.propagateStateFromChildrenForUnchangedSubtree(childState);
    11351203
    11361204    // Set the flag to say that this layer has compositing children.
     
    11571225    if (childState.compositingAncestor == &layer && !layer.isRenderViewLayer())
    11581226        overlapMap.popCompositingContainer();
     1227
     1228    if (layer.isComposited())
     1229        layer.backing()->clearBackingSharingLayers();
     1230
     1231    if (backingSharingState.backingProviderCandidate && &layer == backingSharingState.backingProviderStackingContext) {
     1232        LOG_WITH_STREAM(Compositing, stream << &layer << " tus: popping stacking context " << backingSharingState.backingProviderStackingContext << ", flushing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1233        backingSharingState.resetBackingProviderCandidate();
     1234    } else if (!backingSharingState.backingProviderCandidate && layer.isComposited()) {
     1235        LOG_WITH_STREAM(Compositing, stream << &layer << " tus: compositing - sharing candidate " << backingSharingState.backingProviderCandidate << " with " << backingSharingState.backingSharingLayers.size() << " sharing layers");
     1236        // Flush out any earlier candidate in this stacking context. This layer becomes a candidate.
     1237        backingSharingState.resetBackingProviderCandidate(&layer, compositingState.stackingContextAncestor);
     1238    }
    11591239
    11601240    descendantHas3DTransform |= anyDescendantHas3DTransform || layer.has3DTransform();
     
    15761656
    15771657    if (backingRequired == BackingRequired::Yes) {
     1658        layer.disconnectFromBackingProviderLayer();
     1659
    15781660        enableCompositingMode();
    15791661       
     
    17281810void RenderLayerCompositor::layerWillBeRemoved(RenderLayer& parent, RenderLayer& child)
    17291811{
    1730     if (!child.isComposited() || parent.renderer().renderTreeBeingDestroyed())
     1812    if (parent.renderer().renderTreeBeingDestroyed())
    17311813        return;
    17321814
    1733     repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits?
     1815    if (child.isComposited())
     1816        repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits?
     1817    else if (child.paintsIntoProvidedBacking()) {
     1818        auto* backingProviderLayer = child.backingProviderLayer();
     1819        // FIXME: Optimize this repaint.
     1820        backingProviderLayer->setBackingNeedsRepaint();
     1821        backingProviderLayer->backing()->removeBackingSharingLayer(child);
     1822    } else
     1823        return;
    17341824
    17351825    child.setNeedsCompositingLayerConnection();
     
    27942884
    27952885// FIXME: why doesn't this handle the clipping cases?
    2796 bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const
    2797 {
    2798     auto& layer = *renderer.layer();
    2799 
     2886bool RenderLayerCompositor::requiresCompositingForIndirectReason(const RenderLayer& layer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, bool paintsIntoProvidedBacking, RenderLayer::IndirectCompositingReason& reason) const
     2887{
    28002888    // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented
    28012889    // via compositing so that they also apply to those composited descendants.
     2890    auto& renderer = layer.renderer();
    28022891    if (hasCompositedDescendants && (layer.isolatesCompositedBlending() || layer.transform() || renderer.createsGroup() || renderer.hasReflection())) {
    28032892        reason = RenderLayer::IndirectCompositingReason::GraphicalEffect;
     
    28192908    }
    28202909
    2821     if (renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {
     2910    if (!paintsIntoProvidedBacking && renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {
    28222911        if (layerContainingBlockCrossesCoordinatedScrollingBoundary(layer, *compositingAncestor)) {
    28232912            reason = RenderLayer::IndirectCompositingReason::OverflowScrollPositioning;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r244837 r245058  
    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

    r244599 r245058  
    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.