Changeset 245085 in webkit


Ignore:
Timestamp:
May 8, 2019 6:18:19 PM (5 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r245058.

Causes crashes under ASan / GuardMalloc

Reverted changeset:

"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
https://trac.webkit.org/changeset/245058

Location:
trunk
Files:
2 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245077 r245085  
     12019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r245058.
     4
     5        Causes crashes under ASan / GuardMalloc
     6
     7        Reverted changeset:
     8
     9        "Implement backing-sharing in compositing layers, allowing
     10        overlap layers to paint into the backing store of another
     11        layer"
     12        https://bugs.webkit.org/show_bug.cgi?id=197561
     13        https://trac.webkit.org/changeset/245058
     14
    1152019-05-08  Tim Horton  <timothy_horton@apple.com>
    216
  • trunk/LayoutTests/TestExpectations

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

    r245058 r245085  
    1212      (bounds 785.00 2618.00)
    1313      (contentsOpaque 1)
    14       (children 3
     14      (children 6
    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)
    2651          (position 28.00 250.00)
    2752          (bounds 185.00 200.00)
     
    2954            (GraphicsLayer
    3055              (offsetFromRenderer width=0 height=100)
    31               (bounds 149.00 200.00)
     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)
    3270              (drawsContent 1)
    3371            )
  • trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap-expected.txt

    r245058 r245085  
    66      (bounds 800.00 600.00)
    77      (contentsOpaque 1)
    8       (children 2
     8      (children 3
    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        )
    1830      )
    1931    )
  • trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap.html

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

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

    r245058 r245085  
    77      (bounds 800.00 600.00)
    88      (contentsOpaque 1)
    9       (children 3
     9      (children 4
    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)
    2941            )
    3042          )
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r245058 r245085  
    88
    99compositing/ios [ Pass ]
    10 compositing/shared-backing/overflow-scroll [ Pass ]
    1110fast/device-orientation [ Pass ]
    1211fast/history/ios [ Pass ]
     
    10771076
    10781077fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html [ Pass Failure ]
    1079 webkit.org/b/197694 fast/scrolling/ios/overflow-scroll-overlap-4.html [ Failure ]
    10801078
    10811079webkit.org/b/157589 fast/text-autosizing/ios/text-autosizing-after-back.html [ Pass Timeout ]
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt

    r245058 r245085  
    1 abs
    2 abs
     1absabs
    32
    43(Frame scrolling node
     
    1514  (max layout viewport origin (0,0))
    1615  (behavior for fixed 0)
    17   (children 5
     16  (children 3
    1817    (Overflow scrolling node
    1918      (scrollable area size 300 300)
    20       (contents size 381 530)
     19      (contents size 381 500)
    2120      (parent relative scrollable rect at (30,35) size 300x300)
    2221      (scrollable area parameters
     
    3029    (Positioned node
    3130      (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
    3831        (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))
    4532        (positioning-behavior moves))
    4633      (related overflow nodes 1)
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt

    r245058 r245085  
    1 abs
    2 abs
     1absabs
    32
    43(Frame scrolling node
     
    1514  (max layout viewport origin (0,0))
    1615  (behavior for fixed 0)
    17   (children 7
     16  (children 4
    1817    (Overflow scrolling node
    1918      (scrollable area size 300 300)
    20       (contents size 300 556)
     19      (contents size 300 526)
    2120      (parent relative scrollable rect at (30,22) size 300x300)
    2221      (scrollable area parameters
     
    2928    (Positioned node
    3029      (layout constraints
    31         (layer-position-at-last-layout (10,10))
     30        (layer-position-at-last-layout (0,0))
    3231        (positioning-behavior moves))
    3332      (related overflow nodes 1)
     
    3534    (Positioned node
    3635      (layout constraints
    37         (layer-position-at-last-layout (0,30))
     36        (layer-position-at-last-layout (53,53))
    3837        (positioning-behavior moves))
    3938      (related overflow nodes 1)
     
    4140    (Positioned node
    4241      (layout constraints
    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))
     42        (layer-position-at-last-layout (80,80))
    6243        (positioning-behavior moves))
    6344      (related overflow nodes 1)
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245058 r245085  
    1 abs
    2 abs
     1absabs
    32
    43(Frame scrolling node
     
    1817    (Overflow scrolling node
    1918      (scrollable area size 300 300)
    20       (contents size 300 530)
     19      (contents size 300 500)
    2120      (parent relative scrollable rect at (30,22) size 300x300)
    2221      (scrollable area parameters
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt

    r245058 r245085  
    2727  (max layout viewport origin (0,229))
    2828  (behavior for fixed 0)
    29   (children 19
     29  (children 12
    3030    (Overflow scrolling node
    3131      (scrollable area size 220 170)
     
    4141    (Positioned node
    4242      (layout constraints
    43         (layer-position-at-last-layout (20,40))
     43        (layer-position-at-last-layout (10,30))
    4444        (positioning-behavior moves))
    4545      (related overflow nodes 1)
     
    4747    (Positioned node
    4848      (layout constraints
    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))
     49        (layer-position-at-last-layout (10,50))
    5650        (positioning-behavior moves))
    5751      (related overflow nodes 1)
     
    7064    (Positioned node
    7165      (layout constraints
    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))
     66        (layer-position-at-last-layout (10,30))
    7967        (positioning-behavior moves))
    8068      (related overflow nodes 1)
     
    9179        (has enabled vertical scrollbar 1))
    9280    )
    93     (Positioned node
    94       (layout constraints
    95         (layer-position-at-last-layout (20,40))
    96         (positioning-behavior moves))
    97       (related overflow nodes 1)
    98     )
    9981    (Overflow scrolling node
    10082      (scrollable area size 220 170)
     
    10789        (vertical scrollbar mode 0)
    10890        (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)
    11591    )
    11692    (Overflow scrolling node
     
    127103    (Positioned node
    128104      (layout constraints
    129         (layer-position-at-last-layout (20,40))
     105        (layer-position-at-last-layout (10,30))
    130106        (positioning-behavior moves))
    131107      (related overflow nodes 1)
     
    133109    (Positioned node
    134110      (layout constraints
    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))
     111        (layer-position-at-last-layout (110,50))
    148112        (positioning-behavior moves))
    149113      (related overflow nodes 1)
     
    162126    (Positioned node
    163127      (layout constraints
    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))
     128        (layer-position-at-last-layout (10,30))
    171129        (positioning-behavior moves))
    172130      (related overflow nodes 1)
     
    174132        (Positioned node
    175133          (layout constraints
    176             (layer-position-at-last-layout (79,50))
     134            (layer-position-at-last-layout (79,20))
    177135            (positioning-behavior stationary))
    178136          (related overflow nodes 1)
  • trunk/LayoutTests/platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt

    r245058 r245085  
    1212      (bounds 800.00 2618.00)
    1313      (contentsOpaque 1)
    14       (children 3
     14      (children 6
    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)
    2652          (position 28.00 250.00)
    2753          (bounds 185.00 200.00)
     
    2955            (GraphicsLayer
    3056              (offsetFromRenderer width=0 height=100)
    31               (bounds 149.00 200.00)
     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)
    3272              (drawsContent 1)
    3373            )
  • trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt

    r245058 r245085  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 2.00)
    22       (children 4
     22      (children 6
    2323        (GraphicsLayer
    2424          (position 8.00 102.00)
     
    4949        )
    5050        (GraphicsLayer
    51           (offsetFromRenderer width=-17 height=0)
    52           (position -9.00 134.00)
    53           (bounds 816.00 22.00)
     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)
    5471          (drawsContent 1)
    55           (visible rect 9.00, 0.00 800.00 x 22.00)
    56           (coverage rect 9.00, -134.00 800.00 x 600.00)
     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)
    5784          (intersects coverage rect 1)
    5885          (contentsScale 2.00)
  • trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt

    r245058 r245085  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 2.00)
    22       (children 4
     22      (children 6
    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
    5169          (position 8.00 134.00)
    52           (bounds 799.00 22.00)
     70          (bounds 102.00 22.00)
    5371          (drawsContent 1)
    54           (visible rect 0.00, 0.00 792.00 x 22.00)
     72          (visible rect 0.00, 0.00 102.00 x 22.00)
    5573          (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)
    5683          (intersects coverage rect 1)
    5784          (contentsScale 2.00)
  • trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt

    r245058 r245085  
    1616                  (anchor 0.00 0.00)
    1717                  (bounds 320.00 1224.00)
    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                   )
     18                  (drawsContent 1)
    2619                )
    2720              )
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

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

    r245058 r245085  
    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 )
    251
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

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

    r245058 r245085  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 1.00)
    22       (children 4
     22      (children 6
    2323        (GraphicsLayer
    2424          (position 8.00 96.00)
     
    4949        )
    5050        (GraphicsLayer
    51           (offsetFromRenderer width=-16 height=0)
    52           (position -8.00 128.00)
    53           (bounds 815.00 20.00)
     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)
    5471          (drawsContent 1)
    55           (visible rect 8.00, 0.00 800.00 x 20.00)
    56           (coverage rect 8.00, -128.00 800.00 x 585.00)
     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)
    5784          (intersects coverage rect 1)
    5885          (contentsScale 1.00)
  • trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt

    r245058 r245085  
    2020      (intersects coverage rect 1)
    2121      (contentsScale 1.00)
    22       (children 4
     22      (children 6
    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
    5169          (position 8.00 128.00)
    52           (bounds 799.00 20.00)
     70          (bounds 102.00 20.00)
    5371          (drawsContent 1)
    54           (visible rect 0.00, 0.00 792.00 x 20.00)
     72          (visible rect 0.00, 0.00 102.00 x 20.00)
    5573          (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)
    5683          (intersects coverage rect 1)
    5784          (contentsScale 1.00)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt

    r245058 r245085  
    1 abs
    2 abs
     1absabs
    32
    43(Frame scrolling node
     
    1514  (max layout viewport origin (0,0))
    1615  (behavior for fixed 0)
    17   (children 5
     16  (children 3
    1817    (Overflow scrolling node
    1918      (scrollable area size 285 285)
    20       (contents size 381 530)
     19      (contents size 381 500)
    2120      (parent relative scrollable rect at (30,35) size 285x285)
    2221      (scrollable area parameters
     
    3029    (Positioned node
    3130      (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
    3831        (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))
    4532        (positioning-behavior moves))
    4633      (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html

    r245058 r245085  
    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         }
    4538    </style>
    4639    <script>
     
    5649<body>
    5750    <div class="scroller">
    58         <div class="sharing-preventer"></div>
    5951        <div class="absolute">abs
    60             <div class="sharing-preventer"></div>
    6152            <div class="inner absolute">abs</div>
    6253        </div>
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt

    r245058 r245085  
    1 abs
    2 abs
     1absabs
    32
    43(Frame scrolling node
     
    1514  (max layout viewport origin (0,0))
    1615  (behavior for fixed 0)
    17   (children 7
     16  (children 4
    1817    (Overflow scrolling node
    1918      (scrollable area size 285 285)
    20       (contents size 285 556)
     19      (contents size 285 526)
    2120      (parent relative scrollable rect at (30,22) size 285x285)
    2221      (scrollable area parameters
     
    2928    (Positioned node
    3029      (layout constraints
    31         (layer-position-at-last-layout (10,10))
     30        (layer-position-at-last-layout (0,0))
    3231        (positioning-behavior moves))
    3332      (related overflow nodes 1)
     
    3534    (Positioned node
    3635      (layout constraints
    37         (layer-position-at-last-layout (0,30))
     36        (layer-position-at-last-layout (53,53))
    3837        (positioning-behavior moves))
    3938      (related overflow nodes 1)
     
    4140    (Positioned node
    4241      (layout constraints
    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))
     42        (layer-position-at-last-layout (80,80))
    6243        (positioning-behavior moves))
    6344      (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html

    r245058 r245085  
    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         }
    5043    </style>
    5144    <script>
     
    6255
    6356    <div class="scroller">
    64         <div class="sharing-preventer"></div>
    6557        <div class="relative">
    66             <div class="sharing-preventer"></div>
    6758            <div class="absolute">abs
    68                 <div class="sharing-preventer"></div>
    6959                <div class="inner absolute">abs</div>
    7060            </div>
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245058 r245085  
    1 abs
    2 abs
     1absabs
    32
    43(Frame scrolling node
     
    1817    (Overflow scrolling node
    1918      (scrollable area size 285 285)
    20       (contents size 285 530)
     19      (contents size 285 500)
    2120      (parent relative scrollable rect at (30,22) size 285x285)
    2221      (scrollable area parameters
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html

    r245058 r245085  
    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         }
    4538    </style>
    4639    <script>
     
    5649<body>
    5750    <div class="scroller">
    58         <div class="sharing-preventer"></div>
    5951        <div class="absolute">abs
    60             <div class="sharing-preventer"></div>
    6152            <div class="inner absolute">abs</div>
    6253        </div>
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt

    r245058 r245085  
    2828  (max layout viewport origin (0,229))
    2929  (behavior for fixed 0)
    30   (children 19
     30  (children 12
    3131    (Overflow scrolling node
    3232      (scrollable area size 205 155)
     
    4343    (Positioned node
    4444      (layout constraints
    45         (layer-position-at-last-layout (20,38))
     45        (layer-position-at-last-layout (10,28))
    4646        (positioning-behavior moves))
    4747      (related overflow nodes 1)
     
    4949    (Positioned node
    5050      (layout constraints
    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))
     51        (layer-position-at-last-layout (10,46))
    5852        (positioning-behavior moves))
    5953      (related overflow nodes 1)
     
    7367    (Positioned node
    7468      (layout constraints
    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))
     69        (layer-position-at-last-layout (10,28))
    8270        (positioning-behavior moves))
    8371      (related overflow nodes 1)
     
    9482        (has enabled vertical scrollbar 1))
    9583    )
    96     (Positioned node
    97       (layout constraints
    98         (layer-position-at-last-layout (20,38))
    99         (positioning-behavior moves))
    100       (related overflow nodes 1)
    101     )
    10284    (Overflow scrolling node
    10385      (scrollable area size 205 155)
     
    11092        (vertical scrollbar mode 0)
    11193        (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)
    11894    )
    11995    (Overflow scrolling node
     
    131107    (Positioned node
    132108      (layout constraints
    133         (layer-position-at-last-layout (20,38))
     109        (layer-position-at-last-layout (10,28))
    134110        (positioning-behavior moves))
    135111      (related overflow nodes 1)
     
    137113    (Positioned node
    138114      (layout constraints
    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))
     115        (layer-position-at-last-layout (110,46))
    152116        (positioning-behavior moves))
    153117      (related overflow nodes 1)
     
    166130    (Positioned node
    167131      (layout constraints
    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))
     132        (layer-position-at-last-layout (10,28))
    175133        (positioning-behavior moves))
    176134      (related overflow nodes 1)
     
    178136        (Positioned node
    179137          (layout constraints
    180             (layer-position-at-last-layout (79,48))
     138            (layer-position-at-last-layout (79,18))
    181139            (positioning-behavior stationary))
    182140          (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html

    r245058 r245085  
    4848            position: absolute;
    4949            left: 100px;
    50             transform: translateZ(0);
    5150        }
    5251
     
    5857        .scrolling-content {
    5958            height: 1000px;
    60         }
    61 
    62         .sharing-preventer {
    63             transform: translateZ(0);
    64             margin: 10px;
    65             width: 10px;
    66             height: 10px;
    6759        }
    6860        </style>
     
    8577                <div class="scrolling-content">
    8678                    Scrolling content
    87                     <div class="sharing-preventer"></div>
    8879                    <div class="stacking">
    8980                        Stacking
    90                         <div class="sharing-preventer"></div>
    9181                        <div class="absolute box"></div>
    9282                    </div>
     
    9989                <div class="scrolling-content">
    10090                    Scrolling content
    101                     <div class="sharing-preventer"></div>
    10291                    <div class="containing">
    10392                        Containing
    104                         <div class="sharing-preventer"></div>
    10593                        <div class="absolute box"></div>
    10694                    </div>
     
    113101                <div class="scrolling-content">
    114102                    Scrolling content
    115                     <div class="sharing-preventer"></div>
    116103                    <div class="absolute box"></div>
    117104                </div>
     
    127114                        <div class="scrolling-content">
    128115                            Scrolling content
    129                             <div class="sharing-preventer"></div>
    130116                            <div class="absolute box"></div>
    131117                        </div>
     
    138124                <div class="scrolling-content">
    139125                    Scrolling content
    140                     <div class="sharing-preventer"></div>
    141126                    <div class="stacking">
    142127                        Stacking
    143128                        <div class="containing">
    144129                            Containing
    145                             <div class="sharing-preventer"></div>
    146130                            <div class="absolute box"></div>
    147131                        </div>
     
    154138                <div class="scrolling-content">
    155139                    Scrolling content
    156                     <div class="sharing-preventer"></div>
    157140                    <div class="containing">
    158141                        Containing
    159142                        <div class="stacking">
    160143                            Stacking
    161                             <div class="sharing-preventer"></div>
    162144                            <div class="absolute box"></div>
    163145                        </div>
  • trunk/Source/WebCore/ChangeLog

    r245082 r245085  
     12019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r245058.
     4
     5        Causes crashes under ASan / GuardMalloc
     6
     7        Reverted changeset:
     8
     9        "Implement backing-sharing in compositing layers, allowing
     10        overlap layers to paint into the backing store of another
     11        layer"
     12        https://bugs.webkit.org/show_bug.cgi?id=197561
     13        https://trac.webkit.org/changeset/245058
     14
    1152019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r245058 r245085  
    367367    clearLayerFilters();
    368368
    369     if (paintsIntoProvidedBacking()) {
    370         auto* backingProviderLayer = this->backingProviderLayer();
    371         if (backingProviderLayer->backing())
    372             backingProviderLayer->backing()->removeBackingSharingLayer(*this);
    373     }
    374 
    375369    // Child layers will be deleted by their corresponding render objects, so
    376370    // we don't need to delete them ourselves.
     
    16701664}
    16711665
    1672 bool 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 
    16891666RenderLayer* RenderLayer::enclosingAncestorForPosition(PositionType position) const
    16901667{
     
    17701747}
    17711748
    1772 void RenderLayer::setBackingProviderLayer(RenderLayer* backingProvider)
    1773 {
    1774     if (backingProvider == m_backingProviderLayer)
    1775         return;
    1776 
    1777     clearClipRectsIncludingDescendants();
    1778     m_backingProviderLayer = makeWeakPtr(backingProvider);
    1779 }
    1780 
    1781 void 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 
    17911749bool compositedWithOwnBackingStore(const RenderLayer& layer)
    17921750{
     
    18091767RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot includeSelf) const
    18101768{
    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;
     1769    if (includeSelf == IncludeSelf && compositedWithOwnBackingStore(*this))
     1770        return const_cast<RenderLayer*>(this);
    18241771
    18251772    for (const RenderLayer* curr = paintOrderParent(); curr; curr = curr->paintOrderParent()) {
    1826         if ((repaintTarget = repaintTargetForLayer(*curr)))
    1827             return repaintTarget;
     1773        if (compositedWithOwnBackingStore(*curr))
     1774            return const_cast<RenderLayer*>(curr);
    18281775    }
    18291776         
     
    19071854        return const_cast<RenderLayer*>(this);
    19081855
    1909     if (paintsIntoProvidedBacking())
    1910         return backingProviderLayer();
    1911 
    19121856    const RenderLayer* current = this;
    19131857    while (current) {
     
    19191863        if (current->transform() || compositedWithOwnBackingStore(*current))
    19201864            return const_cast<RenderLayer*>(current);
    1921 
    1922         if (current->paintsIntoProvidedBacking())
    1923             return current->backingProviderLayer();
    19241865    }
    19251866
     
    39883929}
    39893930
     3931static 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
    39903943void RenderLayer::clipToRect(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, const ClipRect& clipRect, BorderRadiusClippingRule rule)
    39913944{
     
    40063959        // containing block chain so we check that also.
    40073960        for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent(); layer; layer = layer->parent()) {
    4008             if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && ancestorLayerIsInContainingBlockChain(*layer)) {
     3961            if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && inContainingBlockChain(this, layer)) {
    40093962                LayoutRect adjustedClipRect = LayoutRect(toLayoutPoint(layer->offsetFromAncestor(paintingInfo.rootLayer, AdjustForColumns)), layer->size());
    40103963                adjustedClipRect.move(paintingInfo.subpixelOffset);
     
    40684021void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, OptionSet<PaintLayerFlag> paintFlags)
    40694022{
    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))
     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().
    40894033            return;
    4090 
    4091         paintFlags.add(PaintLayerTemporaryClipRects);
    4092     }
    4093 
    4094     if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
     4034        }
     4035    } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
    40954036        // Don't paint out-of-view viewport constrained layers (when doing prepainting) because they will never be visible
    40964037        // unless their position or viewport size is changed.
     
    55005441    // examine the parent. We want to cache clip rects with us as the root.
    55015442    if (auto* parentLayer = (clipRectsContext.rootLayer != this ? parent() : nullptr))
    5502         parentClipRects = this->parentClipRects(clipRectsContext);
     5443        parentClipRects = parentLayer->updateClipRects(clipRectsContext);
    55035444
    55045445    auto clipRects = ClipRects::create();
     
    55195460        return nullptr;
    55205461    return m_clipRectsCache->getClipRects(context.clipRectsType, context.respectOverflowClip);
    5521 }
    5522 
    5523 bool RenderLayer::clipCrossesPaintingBoundary() const
    5524 {
    5525     return parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers) != enclosingPaginationLayer(IncludeCompositedPaginatedLayers)
    5526         || parent()->enclosingCompositingLayerForRepaint() != enclosingCompositingLayerForRepaint();
    55275462}
    55285463
     
    55495484            ClipRectsContext parentContext(clipRectsContext);
    55505485            parentContext.overlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize; // FIXME: why?
    5551            
    5552             if (clipCrossesPaintingBoundary())
    5553                 parentContext.clipRectsType = TemporaryClipRects;
    5554 
    55555486            parentLayer->calculateClipRects(parentContext, clipRects);
    55565487        }
     
    56045535    ASSERT(parent());
    56055536
    5606     auto temporaryParentClipRects = [&](const ClipRectsContext& clipContext) {
     5537    if (clipRectsContext.clipRectsType == TemporaryClipRects) {
    56075538        auto parentClipRects = ClipRects::create();
    5608         parent()->calculateClipRects(clipContext, parentClipRects);
     5539        parent()->calculateClipRects(clipRectsContext, parentClipRects);
    56095540        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);
    56195541    }
    56205542
     
    56365558{
    56375559    ASSERT(parent());
    5638     auto parentRects = parentClipRects(clipRectsContext);
     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();
    56395575    ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer().style().position());
    56405576    RenderView& view = renderer().view();
     
    60095945
    60105946    auto computeLayersUnion = [this, &unionBounds, flags, descendantFlags] (const RenderLayer& childLayer) {
    6011         if (!(flags & IncludeCompositedDescendants) && (childLayer.isComposited() || childLayer.paintsIntoProvidedBacking()))
     5947        if (!(flags & IncludeCompositedDescendants) && childLayer.isComposited())
    60125948            return;
    60135949        LayoutRect childBounds = childLayer.calculateLayerBounds(this, childLayer.offsetFromAncestor(this), descendantFlags);
     
    68566792{
    68576793    stream.nextLine();
    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"
     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"
    68596795        "Dirty (z)-lists, Dirty (n)ormal flow lists\n"
    68606796        "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"
     
    68826818    stream << (layer.renderer().isFixedPositioned() ? "X" : "-");
    68836819    stream << (layer.isComposited() ? "C" : "-");
    6884     stream << ((layer.isComposited() && layer.backing()->hasBackingSharingLayers()) ? "P" : (layer.paintsIntoProvidedBacking() ? "p" : "-"));
    68856820    stream << (layer.hasCompositingDescendant() ? "c" : "-");
    68866821    stream << (layer.hasCompositedScrollingAncestor() ? "s" : "-");
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r245058 r245085  
    604604    bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerDescendant; }
    605605
    606     bool ancestorLayerIsInContainingBlockChain(const RenderLayer& ancestor, const RenderLayer* checkLimit = nullptr) const;
    607 
    608606    // Gets the nearest enclosing positioned ancestor layer (also includes
    609607    // the <html> layer and the root layer).
     
    704702    LayoutRect localClipRect(bool& clipExceedsBounds) const; // Returns the background clip rect of the layer in the local coordinate space.
    705703
    706     bool clipCrossesPaintingBoundary() const;
    707 
    708704    // Pass offsetFromRoot if known.
    709705    bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot, const LayoutRect* cachedBoundingBox = nullptr) const;
     
    817813    bool hasCompositingDescendant() const { return m_hasCompositingDescendant; }
    818814    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; }
    826815
    827816    RenderLayerBacking* backing() const { return m_backing.get(); }
     
    12691258    RenderLayer* m_last { nullptr };
    12701259
    1271     WeakPtr<RenderLayer> m_backingProviderLayer;
    1272 
    12731260    // For layers that establish stacking contexts, m_posZOrderList holds a sorted list of all the
    12741261    // descendant layers within the stacking context that have z-indices of 0 or greater
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r245058 r245085  
    260260    ASSERT(m_owningLayer.backing() == this);
    261261    compositor().removeFromScrollCoordinatedLayers(m_owningLayer);
    262 
    263     LOG(Compositing, "RenderLayer(backing) %p willBeDestroyed", &m_owningLayer);
    264 
    265     clearBackingSharingLayers();
    266262}
    267263
     
    270266    if (layer && layer->type() == GraphicsLayer::Type::Normal && layer->tiledBacking())
    271267        compositor().layerTiledBackingUsageChanged(layer, false);
    272 }
    273 
    274 static void clearBackingSharingLayerProviders(Vector<WeakPtr<RenderLayer>>& sharingLayers)
    275 {
    276     for (auto& layerWeakPtr : sharingLayers) {
    277         if (!layerWeakPtr)
    278             continue;
    279         layerWeakPtr->setBackingProviderLayer(nullptr);
    280     }
    281 }
    282 
    283 void 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 
    296 void 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 
    305 void RenderLayerBacking::clearBackingSharingLayers()
    306 {
    307     LOG(Compositing, "RenderLayer %p clearBackingSharingLayers", &m_owningLayer);
    308 
    309     clearBackingSharingLayerProviders(m_backingSharingLayers);
    310     m_backingSharingLayers.clear();
    311268}
    312269
     
    650607bool RenderLayerBacking::updateCompositedBounds()
    651608{
    652     LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, { }, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
     609    LayoutRect layerBounds = m_owningLayer.calculateLayerBounds(&m_owningLayer, LayoutSize(), RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
    653610    // Clip to the size of the document or enclosing overflow-scroll layer.
    654611    // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
     
    672629        layerBounds.intersect(clippingBounds);
    673630    }
    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 
     631   
    683632    // If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
    684633    // then we need to ensure that the compositing layer has non-zero size so that we can apply
     
    14491398        m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent);
    14501399
    1451         bool hasScrollingPaintedContent = hasBackingSharingLayers() || (m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent()));
     1400        bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent());
    14521401        m_scrolledContentsLayer->setDrawsContent(hasScrollingPaintedContent);
    14531402        return;
     
    21832132{
    21842133    if (m_owningLayer.isRenderViewLayer())
    2185         return false;
    2186 
    2187     if (hasBackingSharingLayers())
    21882134        return false;
    21892135
     
    26582604#endif
    26592605
    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     }
     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);
    26982619
    26992620    compositor().didPaintBacking(this);
     2621
     2622    ASSERT(!m_owningLayer.m_usedTransparency);
    27002623}
    27012624
     
    27252648        || graphicsLayer == m_childClippingMaskLayer.get()
    27262649        || graphicsLayer == m_scrolledContentsLayer.get()) {
     2650        InspectorInstrumentation::willPaint(renderer());
    27272651
    27282652        if (!(paintingPhase & GraphicsLayerPaintOverflowContents))
     
    27382662
    27392663        paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase);
     2664
     2665        InspectorInstrumentation::didPaint(renderer(), dirtyRect);
    27402666    } else if (graphicsLayer == layerForHorizontalScrollbar()) {
    27412667        paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect);
     
    27442670    } else if (graphicsLayer == layerForScrollCorner()) {
    27452671        const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect();
    2746         GraphicsContextStateSaver stateSaver(context);
     2672        context.save();
    27472673        context.translate(-scrollCornerAndResizer.location());
    27482674        LayoutRect transformedClip = LayoutRect(clip);
     
    27502676        m_owningLayer.paintScrollCorner(context, IntPoint(), snappedIntRect(transformedClip));
    27512677        m_owningLayer.paintResizer(context, IntPoint(), transformedClip);
     2678        context.restore();
    27522679    }
    27532680#ifndef NDEBUG
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r245058 r245085  
    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 
    8172    void updateConfigurationAfterStyleChange();
    8273
     
    397388    RenderLayer& m_owningLayer;
    398389
    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 
    402390    RefPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context.
    403391    RefPtr<GraphicsLayer> m_contentsContainmentLayer; // Only used if we have a background layer; takes the transform.
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r245058 r245085  
    233233    }
    234234   
    235     CompositingState stateForPaintOrderChildren(RenderLayer& layer) const
     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)
     242#if ENABLE(CSS_COMPOSITING)
     243        , hasNotIsolatedCompositedBlendingDescendants(other.hasNotIsolatedCompositedBlendingDescendants)
     244#endif
     245#if ENABLE(TREE_DEBUGGING)
     246        , depth(other.depth + 1)
     247#endif
    236248    {
    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;
    249 #if ENABLE(CSS_COMPOSITING)
    250         childState.hasNotIsolatedCompositedBlendingDescendants = false; // FIXME: should this only be reset for stacking contexts?
    251 #endif
    252 #if ENABLE(TREE_DEBUGGING)
    253         childState.depth = depth + 1;
    254 #endif
    255         return childState;
    256     }
    257 
    258     void propagateStateFromChildren(const CompositingState& childState)
    259     {
    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 
     249    }
     250   
    270251    RenderLayer* compositingAncestor;
    271     RenderLayer* stackingContextAncestor { nullptr };
    272252    bool subtreeIsCompositing { false };
    273253    bool testingOverlap { true };
     
    281261    int depth { 0 };
    282262#endif
    283 };
    284 
    285 struct 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     }
    299263};
    300264
     
    802766    if (updateRoot->hasDescendantNeedingCompositingRequirementsTraversal() || updateRoot->needsCompositingRequirementsTraversal()) {
    803767        CompositingState compositingState(updateRoot);
    804         BackingSharingState backingSharingState;
    805768        OverlapMap overlapMap;
    806769
    807770        bool descendantHas3DTransform = false;
    808         computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, backingSharingState, descendantHas3DTransform);
     771        computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, descendantHas3DTransform);
    809772    }
    810773
     
    859822}
    860823
    861 static bool backingProviderLayerCanIncludeLayer(const RenderLayer& sharedLayer, const RenderLayer& layer)
    862 {
    863     return layer.ancestorLayerIsInContainingBlockChain(sharedLayer);
    864 }
    865 
    866 void 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);
     824void 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);
    873828        return;
    874829    }
    875830
    876831#if ENABLE(TREE_DEBUGGING)
    877     LOG(Compositing, "%*p %s computeCompositingRequirements (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, layer.isNormalFlowOnly() ? "n" : "s", backingSharingState.backingProviderCandidate);
     832    LOG(Compositing, "%*p computeCompositingRequirements", 12 + compositingState.depth * 2, &layer);
    878833#endif
    879834
     
    886841
    887842    layer.setHasCompositingDescendant(false);
    888     layer.setBackingProviderLayer(nullptr);
    889843
    890844    // We updated compositing for direct reasons in layerStyleChanged(). Here, check for compositing that can only be evaluated after layout.
     
    908862
    909863    RenderLayer::IndirectCompositingReason compositingReason = compositingState.subtreeIsCompositing ? RenderLayer::IndirectCompositingReason::Stacking : RenderLayer::IndirectCompositingReason::None;
    910     bool layerPaintsIntoProvidedBacking = false;
    911864
    912865    // If we know for sure the layer is going to be composited, don't bother looking it up in the overlap map
    913866    if (!willBeComposited && !overlapMap.isEmpty() && compositingState.testingOverlap) {
    914867        computeExtent(overlapMap, layer, layerExtent);
    915 
    916868        // If we're testing for overlap, we only need to composite if we overlap something that is already composited.
    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;
     869        compositingReason = overlapMap.overlapsLayers(layerExtent.bounds) ? RenderLayer::IndirectCompositingReason::Overlap : RenderLayer::IndirectCompositingReason::None;
    927870    }
    928871
     
    946889    // a compositing layer among them, so start by inheriting the compositing
    947890    // ancestor with subtreeIsCompositing set to false.
    948     CompositingState childState = compositingState.stateForPaintOrderChildren(layer);
    949 
    950     auto layerWillComposite = [&](bool postDescendants = false) {
     891    CompositingState childState(compositingState);
     892    childState.subtreeIsCompositing = false;
     893#if ENABLE(CSS_COMPOSITING)
     894    childState.hasNotIsolatedCompositedBlendingDescendants = false;
     895#endif
     896
     897    if (willBeComposited) {
     898        // Tell the parent it has compositing descendants.
     899        compositingState.subtreeIsCompositing = true;
    951900        // This layer now acts as the ancestor for kids.
    952901        childState.compositingAncestor = &layer;
     902
    953903        overlapMap.pushCompositingContainer();
    954        
    955         if (postDescendants) {
    956             childState.subtreeIsCompositing = true;
    957             addToOverlapMapRecursive(overlapMap, layer);
    958         }
    959 
    960904        // This layer is going to be composited, so children can safely ignore the fact that there's an
    961905        // animation running behind this layer, meaning they can rely on the overlap map testing again.
    962906        childState.testingOverlap = true;
    963         willBeComposited = true;
    964 
    965         layerPaintsIntoProvidedBacking = false;
    966         layer.disconnectFromBackingProviderLayer();
    967         backingSharingState.backingSharingLayers.removeAll(&layer);
    968     };
    969 
    970     if (willBeComposited) {
    971         // Tell the parent it has compositing descendants.
    972         compositingState.subtreeIsCompositing = true;
    973        
    974         layerWillComposite();
    975907
    976908        computeExtent(overlapMap, layer, layerExtent);
     
    978910        // Too hard to compute animated bounds if both us and some ancestor is animating transform.
    979911        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();
    984912    }
    985913
     
    991919
    992920    for (auto* childLayer : layer.negativeZOrderLayers()) {
    993         computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
     921        computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
    994922
    995923        // If we have to make a layer for this child, make one now so we can have a contents layer
     
    998926            // make layer compositing
    999927            layer.setIndirectCompositingReason(RenderLayer::IndirectCompositingReason::BackgroundLayer);
    1000             layerWillComposite();
     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;
    1001934        }
    1002935    }
    1003936   
    1004937    for (auto* childLayer : layer.normalFlowLayers())
    1005         computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
     938        computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
    1006939
    1007940    for (auto* childLayer : layer.positiveZOrderLayers())
    1008         computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
     941        computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
    1009942
    1010943    // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled).
     
    1029962    RenderLayer::IndirectCompositingReason indirectCompositingReason;
    1030963    if (!willBeComposited && canBeComposited(layer)
    1031         && requiresCompositingForIndirectReason(layer, compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, layerPaintsIntoProvidedBacking, indirectCompositingReason)) {
     964        && requiresCompositingForIndirectReason(layer.renderer(), compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {
    1032965        layer.setIndirectCompositingReason(indirectCompositingReason);
    1033         layerWillComposite(true);
     966        childState.compositingAncestor = &layer;
     967        childState.subtreeIsCompositing = true;
     968        overlapMap.pushCompositingContainer();
     969        addToOverlapMapRecursive(overlapMap, layer);
     970        willBeComposited = true;
    1034971    }
    1035972   
     
    1051988        compositingState.testingOverlap = false;
    1052989   
    1053     if (isCompositedClippingLayer & !willBeComposited)
    1054         layerWillComposite(true);
     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    }
    1055999
    10561000#if ENABLE(CSS_COMPOSITING)
     
    10741018    }
    10751019
    1076     compositingState.propagateStateFromChildren(childState);
     1020    // Subsequent layers in the parent stacking context also need to composite.
     1021    compositingState.subtreeIsCompositing |= childState.subtreeIsCompositing;
     1022    compositingState.fullPaintOrderTraversalRequired |= childState.fullPaintOrderTraversalRequired;
    10771023
    10781024    ASSERT(willBeComposited == needsToBeComposited(layer, queryData));
     
    10861032        // The composited bounds of enclosing layers depends on which descendants are composited, so they need a geometry update.
    10871033        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);
    10981034    }
    10991035
     
    11101046
    11111047#if ENABLE(TREE_DEBUGGING)
    1112     LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, willBeComposited, backingSharingState.backingProviderCandidate);
     1048    LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d", 12 + compositingState.depth * 2, &layer, willBeComposited);
    11131049#endif
    11141050
     
    11191055
    11201056// We have to traverse unchanged layers to fill in the overlap map.
    1121 void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform)
     1057void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform)
    11221058{
    11231059    ASSERT(!compositingState.fullPaintOrderTraversalRequired);
     
    11451081        computeExtent(overlapMap, layer, layerExtent);
    11461082
    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);
     1083    CompositingState childState(compositingState);
     1084    childState.subtreeIsCompositing = false;
     1085#if ENABLE(CSS_COMPOSITING)
     1086    childState.hasNotIsolatedCompositedBlendingDescendants = false;
     1087#endif
    11541088
    11551089    if (layerIsComposited) {
     
    11681102        // Too hard to compute animated bounds if both us and some ancestor is animating transform.
    11691103        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();
    11741104    }
    11751105
     
    11811111
    11821112    for (auto* childLayer : layer.negativeZOrderLayers()) {
    1183         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
     1113        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
    11841114        if (childState.subtreeIsCompositing)
    11851115            ASSERT(layerIsComposited);
     
    11871117   
    11881118    for (auto* childLayer : layer.normalFlowLayers())
    1189         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
     1119        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
    11901120
    11911121    for (auto* childLayer : layer.positiveZOrderLayers())
    1192         traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState, anyDescendantHas3DTransform);
     1122        traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform);
    11931123
    11941124    // All layers (even ones that aren't being composited) need to get added to
     
    12001130        addToOverlapMap(overlapMap, layer, layerExtent);
    12011131
    1202     compositingState.propagateStateFromChildrenForUnchangedSubtree(childState);
     1132    // Subsequent layers in the parent stacking context also need to composite.
     1133    if (childState.subtreeIsCompositing)
     1134        compositingState.subtreeIsCompositing = true;
    12031135
    12041136    // Set the flag to say that this layer has compositing children.
     
    12251157    if (childState.compositingAncestor == &layer && !layer.isRenderViewLayer())
    12261158        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     }
    12391159
    12401160    descendantHas3DTransform |= anyDescendantHas3DTransform || layer.has3DTransform();
     
    16561576
    16571577    if (backingRequired == BackingRequired::Yes) {
    1658         layer.disconnectFromBackingProviderLayer();
    1659 
    16601578        enableCompositingMode();
    16611579       
     
    18101728void RenderLayerCompositor::layerWillBeRemoved(RenderLayer& parent, RenderLayer& child)
    18111729{
    1812     if (parent.renderer().renderTreeBeingDestroyed())
     1730    if (!child.isComposited() || parent.renderer().renderTreeBeingDestroyed())
    18131731        return;
    18141732
    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;
     1733    repaintInCompositedAncestor(child, child.backing()->compositedBounds()); // FIXME: do via dirty bits?
    18241734
    18251735    child.setNeedsCompositingLayerConnection();
     
    28842794
    28852795// FIXME: why doesn't this handle the clipping cases?
    2886 bool RenderLayerCompositor::requiresCompositingForIndirectReason(const RenderLayer& layer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, bool paintsIntoProvidedBacking, RenderLayer::IndirectCompositingReason& reason) const
    2887 {
     2796bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const
     2797{
     2798    auto& layer = *renderer.layer();
     2799
    28882800    // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented
    28892801    // via compositing so that they also apply to those composited descendants.
    2890     auto& renderer = layer.renderer();
    28912802    if (hasCompositedDescendants && (layer.isolatesCompositedBlending() || layer.transform() || renderer.createsGroup() || renderer.hasReflection())) {
    28922803        reason = RenderLayer::IndirectCompositingReason::GraphicalEffect;
     
    29082819    }
    29092820
    2910     if (!paintsIntoProvidedBacking && renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {
     2821    if (renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {
    29112822        if (layerContainingBlockCrossesCoordinatedScrollingBoundary(layer, *compositingAncestor)) {
    29122823            reason = RenderLayer::IndirectCompositingReason::OverflowScrollPositioning;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r245058 r245085  
    370370    class OverlapMap;
    371371    struct CompositingState;
    372     struct BackingSharingState;
    373372    struct OverlapExtent;
    374373
     
    412411    void updateCompositingLayersTimerFired();
    413412
    414     void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, BackingSharingState&, bool& descendantHas3DTransform);
    415     void traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, BackingSharingState&, bool& descendantHas3DTransform);
     413    void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, bool& descendantHas3DTransform);
     414    void traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer&, OverlapMap&, CompositingState&, bool& descendantHas3DTransform);
    416415
    417416    enum class UpdateLevel {
     
    478477    bool requiresCompositingForOverflowScrolling(const RenderLayer&, RequiresCompositingData&) const;
    479478    bool requiresCompositingForEditableImage(RenderLayerModelObject&) const;
    480     bool requiresCompositingForIndirectReason(const RenderLayer&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, bool paintsIntoProvidedBacking, RenderLayer::IndirectCompositingReason&) const;
     479    bool requiresCompositingForIndirectReason(RenderLayerModelObject&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;
    481480
    482481    static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer&, const RenderLayer& compositedAncestor);
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

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