Changeset 245085 in webkit
- Timestamp:
- May 8, 2019 6:18:19 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245077 r245085 1 2019-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 1 15 2019-05-08 Tim Horton <timothy_horton@apple.com> 2 16 -
trunk/LayoutTests/TestExpectations
r245058 r245085 59 59 editing/pasteboard/mac [ Skip ] 60 60 fast/media/ios [ Skip ] 61 62 # Requires async overflow scrolling63 compositing/shared-backing/overflow-scroll [ Skip ]64 61 65 62 # WebKit2 only. -
trunk/LayoutTests/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt
r245058 r245085 12 12 (bounds 785.00 2618.00) 13 13 (contentsOpaque 1) 14 (children 314 (children 6 15 15 (GraphicsLayer 16 16 (position 21.00 21.00) … … 24 24 (GraphicsLayer 25 25 (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) 26 51 (position 28.00 250.00) 27 52 (bounds 185.00 200.00) … … 29 54 (GraphicsLayer 30 55 (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) 32 70 (drawsContent 1) 33 71 ) -
trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap-expected.txt
r245058 r245085 6 6 (bounds 800.00 600.00) 7 7 (contentsOpaque 1) 8 (children 28 (children 3 9 9 (GraphicsLayer 10 10 (position 8.00 8.00) … … 16 16 (drawsContent 1) 17 17 ) 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 ) 18 30 ) 19 31 ) -
trunk/LayoutTests/compositing/layer-creation/overflow-scroll-overlap.html
r245058 r245085 53 53 testRunner.notifyDone(); 54 54 } 55 }, 0);55 }, 150); 56 56 } 57 57 -
trunk/LayoutTests/compositing/overflow/scrolling-content-clip-to-viewport.html
r245058 r245085 24 24 background: silver; 25 25 border: 2px solid blue; 26 transform: translateZ(0);26 z-index: 0; 27 27 } 28 28 </style> -
trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt
r245058 r245085 7 7 (bounds 800.00 600.00) 8 8 (contentsOpaque 1) 9 (children 39 (children 4 10 10 (GraphicsLayer 11 11 (position 8.00 8.00) … … 27 27 ) 28 28 ) 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) 29 41 ) 30 42 ) -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r245058 r245085 8 8 9 9 compositing/ios [ Pass ] 10 compositing/shared-backing/overflow-scroll [ Pass ]11 10 fast/device-orientation [ Pass ] 12 11 fast/history/ios [ Pass ] … … 1077 1076 1078 1077 fast/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 ]1080 1078 1081 1079 webkit.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 1 absabs 3 2 4 3 (Frame scrolling node … … 15 14 (max layout viewport origin (0,0)) 16 15 (behavior for fixed 0) 17 (children 516 (children 3 18 17 (Overflow scrolling node 19 18 (scrollable area size 300 300) 20 (contents size 381 5 30)19 (contents size 381 500) 21 20 (parent relative scrollable rect at (30,35) size 300x300) 22 21 (scrollable area parameters … … 30 29 (Positioned node 31 30 (layout constraints 32 (layer-position-at-last-layout (10,10))33 (positioning-behavior moves))34 (related overflow nodes 1)35 )36 (Positioned node37 (layout constraints38 31 (layer-position-at-last-layout (50,50)) 39 (positioning-behavior moves))40 (related overflow nodes 1)41 )42 (Positioned node43 (layout constraints44 (layer-position-at-last-layout (62,82))45 32 (positioning-behavior moves)) 46 33 (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 1 absabs 3 2 4 3 (Frame scrolling node … … 15 14 (max layout viewport origin (0,0)) 16 15 (behavior for fixed 0) 17 (children 716 (children 4 18 17 (Overflow scrolling node 19 18 (scrollable area size 300 300) 20 (contents size 300 5 56)19 (contents size 300 526) 21 20 (parent relative scrollable rect at (30,22) size 300x300) 22 21 (scrollable area parameters … … 29 28 (Positioned node 30 29 (layout constraints 31 (layer-position-at-last-layout ( 10,10))30 (layer-position-at-last-layout (0,0)) 32 31 (positioning-behavior moves)) 33 32 (related overflow nodes 1) … … 35 34 (Positioned node 36 35 (layout constraints 37 (layer-position-at-last-layout ( 0,30))36 (layer-position-at-last-layout (53,53)) 38 37 (positioning-behavior moves)) 39 38 (related overflow nodes 1) … … 41 40 (Positioned node 42 41 (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)) 62 43 (positioning-behavior moves)) 63 44 (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 1 absabs 3 2 4 3 (Frame scrolling node … … 18 17 (Overflow scrolling node 19 18 (scrollable area size 300 300) 20 (contents size 300 5 30)19 (contents size 300 500) 21 20 (parent relative scrollable rect at (30,22) size 300x300) 22 21 (scrollable area parameters -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt
r245058 r245085 27 27 (max layout viewport origin (0,229)) 28 28 (behavior for fixed 0) 29 (children 1 929 (children 12 30 30 (Overflow scrolling node 31 31 (scrollable area size 220 170) … … 41 41 (Positioned node 42 42 (layout constraints 43 (layer-position-at-last-layout ( 20,40))43 (layer-position-at-last-layout (10,30)) 44 44 (positioning-behavior moves)) 45 45 (related overflow nodes 1) … … 47 47 (Positioned node 48 48 (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)) 56 50 (positioning-behavior moves)) 57 51 (related overflow nodes 1) … … 70 64 (Positioned node 71 65 (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)) 79 67 (positioning-behavior moves)) 80 68 (related overflow nodes 1) … … 91 79 (has enabled vertical scrollbar 1)) 92 80 ) 93 (Positioned node94 (layout constraints95 (layer-position-at-last-layout (20,40))96 (positioning-behavior moves))97 (related overflow nodes 1)98 )99 81 (Overflow scrolling node 100 82 (scrollable area size 220 170) … … 107 89 (vertical scrollbar mode 0) 108 90 (has enabled vertical scrollbar 1)) 109 )110 (Positioned node111 (layout constraints112 (layer-position-at-last-layout (20,40))113 (positioning-behavior moves))114 (related overflow nodes 1)115 91 ) 116 92 (Overflow scrolling node … … 127 103 (Positioned node 128 104 (layout constraints 129 (layer-position-at-last-layout ( 20,40))105 (layer-position-at-last-layout (10,30)) 130 106 (positioning-behavior moves)) 131 107 (related overflow nodes 1) … … 133 109 (Positioned node 134 110 (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)) 148 112 (positioning-behavior moves)) 149 113 (related overflow nodes 1) … … 162 126 (Positioned node 163 127 (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)) 171 129 (positioning-behavior moves)) 172 130 (related overflow nodes 1) … … 174 132 (Positioned node 175 133 (layout constraints 176 (layer-position-at-last-layout (79, 50))134 (layer-position-at-last-layout (79,20)) 177 135 (positioning-behavior stationary)) 178 136 (related overflow nodes 1) -
trunk/LayoutTests/platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt
r245058 r245085 12 12 (bounds 800.00 2618.00) 13 13 (contentsOpaque 1) 14 (children 314 (children 6 15 15 (GraphicsLayer 16 16 (position 21.00 21.00) … … 24 24 (GraphicsLayer 25 25 (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) 26 52 (position 28.00 250.00) 27 53 (bounds 185.00 200.00) … … 29 55 (GraphicsLayer 30 56 (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) 32 72 (drawsContent 1) 33 73 ) -
trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt
r245058 r245085 20 20 (intersects coverage rect 1) 21 21 (contentsScale 2.00) 22 (children 422 (children 6 23 23 (GraphicsLayer 24 24 (position 8.00 102.00) … … 49 49 ) 50 50 (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) 54 71 (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) 57 84 (intersects coverage rect 1) 58 85 (contentsScale 2.00) -
trunk/LayoutTests/platform/ios/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt
r245058 r245085 20 20 (intersects coverage rect 1) 21 21 (contentsScale 2.00) 22 (children 422 (children 6 23 23 (GraphicsLayer 24 24 (position 8.00 102.00) … … 49 49 ) 50 50 (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 51 69 (position 8.00 134.00) 52 (bounds 799.00 22.00)70 (bounds 102.00 22.00) 53 71 (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) 55 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 (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) 56 83 (intersects coverage rect 1) 57 84 (contentsScale 2.00) -
trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
r245058 r245085 16 16 (anchor 0.00 0.00) 17 17 (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) 26 19 ) 27 20 ) -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r245058 r245085 692 692 webkit.org/b/172384 fast/hidpi/hidpi-long-page-with-inset-element.html [ Skip ] 693 693 694 webkit.org/b/197695 [ Debug ] fast/hidpi/video-controls-in-hidpi.html [ Skip ]695 696 694 webkit.org/b/194309 media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html [ Pass Failure ] 697 695 -
trunk/LayoutTests/platform/mac-wk1/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
r245058 r245085 1 (GraphicsLayer2 (anchor 0.00 0.00)3 (bounds 800.00 600.00)4 (children 15 (GraphicsLayer6 (bounds 800.00 600.00)7 (contentsOpaque 1)8 (children 19 (GraphicsLayer10 (offsetFromRenderer width=-10 height=-10)11 (bounds 305.00 325.00)12 (children 113 (GraphicsLayer14 (position 10.00 10.00)15 (bounds 284.00 1204.00)16 (contentsOpaque 1)17 (drawsContent 1)18 )19 )20 )21 )22 )23 )24 )25 1 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r245059 r245085 6 6 #////////////////////////////////////////////////////////////////////////////////////////// 7 7 8 compositing/shared-backing/overflow-scroll [ Pass ]9 8 editing/find [ Pass ] 10 9 editing/undo-manager [ Pass ] -
trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt
r245058 r245085 20 20 (intersects coverage rect 1) 21 21 (contentsScale 1.00) 22 (children 422 (children 6 23 23 (GraphicsLayer 24 24 (position 8.00 96.00) … … 49 49 ) 50 50 (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) 54 71 (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) 57 84 (intersects coverage rect 1) 58 85 (contentsScale 1.00) -
trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt
r245058 r245085 20 20 (intersects coverage rect 1) 21 21 (contentsScale 1.00) 22 (children 422 (children 6 23 23 (GraphicsLayer 24 24 (position 8.00 96.00) … … 49 49 ) 50 50 (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 51 69 (position 8.00 128.00) 52 (bounds 799.00 20.00)70 (bounds 102.00 20.00) 53 71 (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) 55 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 (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) 56 83 (intersects coverage rect 1) 57 84 (contentsScale 1.00) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt
r245058 r245085 1 abs 2 abs 1 absabs 3 2 4 3 (Frame scrolling node … … 15 14 (max layout viewport origin (0,0)) 16 15 (behavior for fixed 0) 17 (children 516 (children 3 18 17 (Overflow scrolling node 19 18 (scrollable area size 285 285) 20 (contents size 381 5 30)19 (contents size 381 500) 21 20 (parent relative scrollable rect at (30,35) size 285x285) 22 21 (scrollable area parameters … … 30 29 (Positioned node 31 30 (layout constraints 32 (layer-position-at-last-layout (10,10))33 (positioning-behavior moves))34 (related overflow nodes 1)35 )36 (Positioned node37 (layout constraints38 31 (layer-position-at-last-layout (50,50)) 39 (positioning-behavior moves))40 (related overflow nodes 1)41 )42 (Positioned node43 (layout constraints44 (layer-position-at-last-layout (62,80))45 32 (positioning-behavior moves)) 46 33 (related overflow nodes 1) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
r245058 r245085 36 36 background-image: repeating-linear-gradient(white, silver 200px); 37 37 } 38 39 .sharing-preventer {40 transform: translateZ(0);41 margin: 10px;42 width: 10px;43 height: 10px;44 }45 38 </style> 46 39 <script> … … 56 49 <body> 57 50 <div class="scroller"> 58 <div class="sharing-preventer"></div>59 51 <div class="absolute">abs 60 <div class="sharing-preventer"></div>61 52 <div class="inner absolute">abs</div> 62 53 </div> -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt
r245058 r245085 1 abs 2 abs 1 absabs 3 2 4 3 (Frame scrolling node … … 15 14 (max layout viewport origin (0,0)) 16 15 (behavior for fixed 0) 17 (children 716 (children 4 18 17 (Overflow scrolling node 19 18 (scrollable area size 285 285) 20 (contents size 285 5 56)19 (contents size 285 526) 21 20 (parent relative scrollable rect at (30,22) size 285x285) 22 21 (scrollable area parameters … … 29 28 (Positioned node 30 29 (layout constraints 31 (layer-position-at-last-layout ( 10,10))30 (layer-position-at-last-layout (0,0)) 32 31 (positioning-behavior moves)) 33 32 (related overflow nodes 1) … … 35 34 (Positioned node 36 35 (layout constraints 37 (layer-position-at-last-layout ( 0,30))36 (layer-position-at-last-layout (53,53)) 38 37 (positioning-behavior moves)) 39 38 (related overflow nodes 1) … … 41 40 (Positioned node 42 41 (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)) 62 43 (positioning-behavior moves)) 63 44 (related overflow nodes 1) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
r245058 r245085 41 41 background-image: repeating-linear-gradient(white, silver 200px); 42 42 } 43 44 .sharing-preventer {45 transform: translateZ(0);46 margin: 10px;47 width: 10px;48 height: 10px;49 }50 43 </style> 51 44 <script> … … 62 55 63 56 <div class="scroller"> 64 <div class="sharing-preventer"></div>65 57 <div class="relative"> 66 <div class="sharing-preventer"></div>67 58 <div class="absolute">abs 68 <div class="sharing-preventer"></div>69 59 <div class="inner absolute">abs</div> 70 60 </div> -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt
r245058 r245085 1 abs 2 abs 1 absabs 3 2 4 3 (Frame scrolling node … … 18 17 (Overflow scrolling node 19 18 (scrollable area size 285 285) 20 (contents size 285 5 30)19 (contents size 285 500) 21 20 (parent relative scrollable rect at (30,22) size 285x285) 22 21 (scrollable area parameters -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
r245058 r245085 36 36 background-image: repeating-linear-gradient(white, silver 200px); 37 37 } 38 39 .sharing-preventer {40 transform: translateZ(0);41 margin: 10px;42 width: 10px;43 height: 10px;44 }45 38 </style> 46 39 <script> … … 56 49 <body> 57 50 <div class="scroller"> 58 <div class="sharing-preventer"></div>59 51 <div class="absolute">abs 60 <div class="sharing-preventer"></div>61 52 <div class="inner absolute">abs</div> 62 53 </div> -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt
r245058 r245085 28 28 (max layout viewport origin (0,229)) 29 29 (behavior for fixed 0) 30 (children 1 930 (children 12 31 31 (Overflow scrolling node 32 32 (scrollable area size 205 155) … … 43 43 (Positioned node 44 44 (layout constraints 45 (layer-position-at-last-layout ( 20,38))45 (layer-position-at-last-layout (10,28)) 46 46 (positioning-behavior moves)) 47 47 (related overflow nodes 1) … … 49 49 (Positioned node 50 50 (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)) 58 52 (positioning-behavior moves)) 59 53 (related overflow nodes 1) … … 73 67 (Positioned node 74 68 (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)) 82 70 (positioning-behavior moves)) 83 71 (related overflow nodes 1) … … 94 82 (has enabled vertical scrollbar 1)) 95 83 ) 96 (Positioned node97 (layout constraints98 (layer-position-at-last-layout (20,38))99 (positioning-behavior moves))100 (related overflow nodes 1)101 )102 84 (Overflow scrolling node 103 85 (scrollable area size 205 155) … … 110 92 (vertical scrollbar mode 0) 111 93 (has enabled vertical scrollbar 1)) 112 )113 (Positioned node114 (layout constraints115 (layer-position-at-last-layout (20,38))116 (positioning-behavior moves))117 (related overflow nodes 1)118 94 ) 119 95 (Overflow scrolling node … … 131 107 (Positioned node 132 108 (layout constraints 133 (layer-position-at-last-layout ( 20,38))109 (layer-position-at-last-layout (10,28)) 134 110 (positioning-behavior moves)) 135 111 (related overflow nodes 1) … … 137 113 (Positioned node 138 114 (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)) 152 116 (positioning-behavior moves)) 153 117 (related overflow nodes 1) … … 166 130 (Positioned node 167 131 (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)) 175 133 (positioning-behavior moves)) 176 134 (related overflow nodes 1) … … 178 136 (Positioned node 179 137 (layout constraints 180 (layer-position-at-last-layout (79, 48))138 (layer-position-at-last-layout (79,18)) 181 139 (positioning-behavior stationary)) 182 140 (related overflow nodes 1) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html
r245058 r245085 48 48 position: absolute; 49 49 left: 100px; 50 transform: translateZ(0);51 50 } 52 51 … … 58 57 .scrolling-content { 59 58 height: 1000px; 60 }61 62 .sharing-preventer {63 transform: translateZ(0);64 margin: 10px;65 width: 10px;66 height: 10px;67 59 } 68 60 </style> … … 85 77 <div class="scrolling-content"> 86 78 Scrolling content 87 <div class="sharing-preventer"></div>88 79 <div class="stacking"> 89 80 Stacking 90 <div class="sharing-preventer"></div>91 81 <div class="absolute box"></div> 92 82 </div> … … 99 89 <div class="scrolling-content"> 100 90 Scrolling content 101 <div class="sharing-preventer"></div>102 91 <div class="containing"> 103 92 Containing 104 <div class="sharing-preventer"></div>105 93 <div class="absolute box"></div> 106 94 </div> … … 113 101 <div class="scrolling-content"> 114 102 Scrolling content 115 <div class="sharing-preventer"></div>116 103 <div class="absolute box"></div> 117 104 </div> … … 127 114 <div class="scrolling-content"> 128 115 Scrolling content 129 <div class="sharing-preventer"></div>130 116 <div class="absolute box"></div> 131 117 </div> … … 138 124 <div class="scrolling-content"> 139 125 Scrolling content 140 <div class="sharing-preventer"></div>141 126 <div class="stacking"> 142 127 Stacking 143 128 <div class="containing"> 144 129 Containing 145 <div class="sharing-preventer"></div>146 130 <div class="absolute box"></div> 147 131 </div> … … 154 138 <div class="scrolling-content"> 155 139 Scrolling content 156 <div class="sharing-preventer"></div>157 140 <div class="containing"> 158 141 Containing 159 142 <div class="stacking"> 160 143 Stacking 161 <div class="sharing-preventer"></div>162 144 <div class="absolute box"></div> 163 145 </div> -
trunk/Source/WebCore/ChangeLog
r245082 r245085 1 2019-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 1 15 2019-05-08 Ryan Haddad <ryanhaddad@apple.com> 2 16 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r245058 r245085 367 367 clearLayerFilters(); 368 368 369 if (paintsIntoProvidedBacking()) {370 auto* backingProviderLayer = this->backingProviderLayer();371 if (backingProviderLayer->backing())372 backingProviderLayer->backing()->removeBackingSharingLayer(*this);373 }374 375 369 // Child layers will be deleted by their corresponding render objects, so 376 370 // we don't need to delete them ourselves. … … 1670 1664 } 1671 1665 1672 bool RenderLayer::ancestorLayerIsInContainingBlockChain(const RenderLayer& ancestor, const RenderLayer* checkLimit) const1673 {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 1689 1666 RenderLayer* RenderLayer::enclosingAncestorForPosition(PositionType position) const 1690 1667 { … … 1770 1747 } 1771 1748 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 1791 1749 bool compositedWithOwnBackingStore(const RenderLayer& layer) 1792 1750 { … … 1809 1767 RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot includeSelf) const 1810 1768 { 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); 1824 1771 1825 1772 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); 1828 1775 } 1829 1776 … … 1907 1854 return const_cast<RenderLayer*>(this); 1908 1855 1909 if (paintsIntoProvidedBacking())1910 return backingProviderLayer();1911 1912 1856 const RenderLayer* current = this; 1913 1857 while (current) { … … 1919 1863 if (current->transform() || compositedWithOwnBackingStore(*current)) 1920 1864 return const_cast<RenderLayer*>(current); 1921 1922 if (current->paintsIntoProvidedBacking())1923 return current->backingProviderLayer();1924 1865 } 1925 1866 … … 3988 3929 } 3989 3930 3931 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLayer) 3932 { 3933 if (startLayer == endLayer) 3934 return true; 3935 for (const auto* currentBlock = startLayer->renderer().containingBlock(); currentBlock && !is<RenderView>(*currentBlock); currentBlock = currentBlock->containingBlock()) { 3936 if (currentBlock->layer() == endLayer) 3937 return true; 3938 } 3939 3940 return false; 3941 } 3942 3990 3943 void RenderLayer::clipToRect(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, const ClipRect& clipRect, BorderRadiusClippingRule rule) 3991 3944 { … … 4006 3959 // containing block chain so we check that also. 4007 3960 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)) { 4009 3962 LayoutRect adjustedClipRect = LayoutRect(toLayoutPoint(layer->offsetFromAncestor(paintingInfo.rootLayer, AdjustForColumns)), layer->size()); 4010 3963 adjustedClipRect.move(paintingInfo.subpixelOffset); … … 4068 4021 void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, OptionSet<PaintLayerFlag> paintFlags) 4069 4022 { 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(). 4089 4033 return; 4090 4091 paintFlags.add(PaintLayerTemporaryClipRects); 4092 } 4093 4094 if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) { 4034 } 4035 } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) { 4095 4036 // Don't paint out-of-view viewport constrained layers (when doing prepainting) because they will never be visible 4096 4037 // unless their position or viewport size is changed. … … 5500 5441 // examine the parent. We want to cache clip rects with us as the root. 5501 5442 if (auto* parentLayer = (clipRectsContext.rootLayer != this ? parent() : nullptr)) 5502 parentClipRects = this->parentClipRects(clipRectsContext);5443 parentClipRects = parentLayer->updateClipRects(clipRectsContext); 5503 5444 5504 5445 auto clipRects = ClipRects::create(); … … 5519 5460 return nullptr; 5520 5461 return m_clipRectsCache->getClipRects(context.clipRectsType, context.respectOverflowClip); 5521 }5522 5523 bool RenderLayer::clipCrossesPaintingBoundary() const5524 {5525 return parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers) != enclosingPaginationLayer(IncludeCompositedPaginatedLayers)5526 || parent()->enclosingCompositingLayerForRepaint() != enclosingCompositingLayerForRepaint();5527 5462 } 5528 5463 … … 5549 5484 ClipRectsContext parentContext(clipRectsContext); 5550 5485 parentContext.overlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize; // FIXME: why? 5551 5552 if (clipCrossesPaintingBoundary())5553 parentContext.clipRectsType = TemporaryClipRects;5554 5555 5486 parentLayer->calculateClipRects(parentContext, clipRects); 5556 5487 } … … 5604 5535 ASSERT(parent()); 5605 5536 5606 auto temporaryParentClipRects = [&](const ClipRectsContext& clipContext) {5537 if (clipRectsContext.clipRectsType == TemporaryClipRects) { 5607 5538 auto parentClipRects = ClipRects::create(); 5608 parent()->calculateClipRects(clip Context, parentClipRects);5539 parent()->calculateClipRects(clipRectsContext, parentClipRects); 5609 5540 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);5619 5541 } 5620 5542 … … 5636 5558 { 5637 5559 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(); 5639 5575 ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer().style().position()); 5640 5576 RenderView& view = renderer().view(); … … 6009 5945 6010 5946 auto computeLayersUnion = [this, &unionBounds, flags, descendantFlags] (const RenderLayer& childLayer) { 6011 if (!(flags & IncludeCompositedDescendants) && (childLayer.isComposited() || childLayer.paintsIntoProvidedBacking()))5947 if (!(flags & IncludeCompositedDescendants) && childLayer.isComposited()) 6012 5948 return; 6013 5949 LayoutRect childBounds = childLayer.calculateLayerBounds(this, childLayer.offsetFromAncestor(this), descendantFlags); … … 6856 6792 { 6857 6793 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" 6859 6795 "Dirty (z)-lists, Dirty (n)ormal flow lists\n" 6860 6796 "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" … … 6882 6818 stream << (layer.renderer().isFixedPositioned() ? "X" : "-"); 6883 6819 stream << (layer.isComposited() ? "C" : "-"); 6884 stream << ((layer.isComposited() && layer.backing()->hasBackingSharingLayers()) ? "P" : (layer.paintsIntoProvidedBacking() ? "p" : "-"));6885 6820 stream << (layer.hasCompositingDescendant() ? "c" : "-"); 6886 6821 stream << (layer.hasCompositedScrollingAncestor() ? "s" : "-"); -
trunk/Source/WebCore/rendering/RenderLayer.h
r245058 r245085 604 604 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerDescendant; } 605 605 606 bool ancestorLayerIsInContainingBlockChain(const RenderLayer& ancestor, const RenderLayer* checkLimit = nullptr) const;607 608 606 // Gets the nearest enclosing positioned ancestor layer (also includes 609 607 // the <html> layer and the root layer). … … 704 702 LayoutRect localClipRect(bool& clipExceedsBounds) const; // Returns the background clip rect of the layer in the local coordinate space. 705 703 706 bool clipCrossesPaintingBoundary() const;707 708 704 // Pass offsetFromRoot if known. 709 705 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutSize& offsetFromRoot, const LayoutRect* cachedBoundingBox = nullptr) const; … … 817 813 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; } 818 814 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; }826 815 827 816 RenderLayerBacking* backing() const { return m_backing.get(); } … … 1269 1258 RenderLayer* m_last { nullptr }; 1270 1259 1271 WeakPtr<RenderLayer> m_backingProviderLayer;1272 1273 1260 // For layers that establish stacking contexts, m_posZOrderList holds a sorted list of all the 1274 1261 // descendant layers within the stacking context that have z-indices of 0 or greater -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r245058 r245085 260 260 ASSERT(m_owningLayer.backing() == this); 261 261 compositor().removeFromScrollCoordinatedLayers(m_owningLayer); 262 263 LOG(Compositing, "RenderLayer(backing) %p willBeDestroyed", &m_owningLayer);264 265 clearBackingSharingLayers();266 262 } 267 263 … … 270 266 if (layer && layer->type() == GraphicsLayer::Type::Normal && layer->tiledBacking()) 271 267 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();311 268 } 312 269 … … 650 607 bool RenderLayerBacking::updateCompositedBounds() 651 608 { 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); 653 610 // Clip to the size of the document or enclosing overflow-scroll layer. 654 611 // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with. … … 672 629 layerBounds.intersect(clippingBounds); 673 630 } 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 683 632 // If the element has a transform-origin that has fixed lengths, and the renderer has zero size, 684 633 // then we need to ensure that the compositing layer has non-zero size so that we can apply … … 1449 1398 m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent); 1450 1399 1451 bool hasScrollingPaintedContent = hasBackingSharingLayers() || (m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent()));1400 bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent()); 1452 1401 m_scrolledContentsLayer->setDrawsContent(hasScrollingPaintedContent); 1453 1402 return; … … 2183 2132 { 2184 2133 if (m_owningLayer.isRenderViewLayer()) 2185 return false;2186 2187 if (hasBackingSharingLayers())2188 2134 return false; 2189 2135 … … 2658 2604 #endif 2659 2605 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); 2698 2619 2699 2620 compositor().didPaintBacking(this); 2621 2622 ASSERT(!m_owningLayer.m_usedTransparency); 2700 2623 } 2701 2624 … … 2725 2648 || graphicsLayer == m_childClippingMaskLayer.get() 2726 2649 || graphicsLayer == m_scrolledContentsLayer.get()) { 2650 InspectorInstrumentation::willPaint(renderer()); 2727 2651 2728 2652 if (!(paintingPhase & GraphicsLayerPaintOverflowContents)) … … 2738 2662 2739 2663 paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase); 2664 2665 InspectorInstrumentation::didPaint(renderer(), dirtyRect); 2740 2666 } else if (graphicsLayer == layerForHorizontalScrollbar()) { 2741 2667 paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect); … … 2744 2670 } else if (graphicsLayer == layerForScrollCorner()) { 2745 2671 const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect(); 2746 GraphicsContextStateSaver stateSaver(context);2672 context.save(); 2747 2673 context.translate(-scrollCornerAndResizer.location()); 2748 2674 LayoutRect transformedClip = LayoutRect(clip); … … 2750 2676 m_owningLayer.paintScrollCorner(context, IntPoint(), snappedIntRect(transformedClip)); 2751 2677 m_owningLayer.paintResizer(context, IntPoint(), transformedClip); 2678 context.restore(); 2752 2679 } 2753 2680 #ifndef NDEBUG -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r245058 r245085 70 70 RenderLayer& owningLayer() const { return m_owningLayer; } 71 71 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 81 72 void updateConfigurationAfterStyleChange(); 82 73 … … 397 388 RenderLayer& m_owningLayer; 398 389 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 402 390 RefPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context. 403 391 RefPtr<GraphicsLayer> m_contentsContainmentLayer; // Only used if we have a background layer; takes the transform. -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r245058 r245085 233 233 } 234 234 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 236 248 { 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 270 251 RenderLayer* compositingAncestor; 271 RenderLayer* stackingContextAncestor { nullptr };272 252 bool subtreeIsCompositing { false }; 273 253 bool testingOverlap { true }; … … 281 261 int depth { 0 }; 282 262 #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 }299 263 }; 300 264 … … 802 766 if (updateRoot->hasDescendantNeedingCompositingRequirementsTraversal() || updateRoot->needsCompositingRequirementsTraversal()) { 803 767 CompositingState compositingState(updateRoot); 804 BackingSharingState backingSharingState;805 768 OverlapMap overlapMap; 806 769 807 770 bool descendantHas3DTransform = false; 808 computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, backingSharingState,descendantHas3DTransform);771 computeCompositingRequirements(nullptr, rootRenderLayer(), overlapMap, compositingState, descendantHas3DTransform); 809 772 } 810 773 … … 859 822 } 860 823 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); 824 void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform) 825 { 826 if (!layer.hasDescendantNeedingCompositingRequirementsTraversal() && !layer.needsCompositingRequirementsTraversal() && !compositingState.fullPaintOrderTraversalRequired && !compositingState.descendantsRequireCompositingUpdate) { 827 traverseUnchangedSubtree(ancestorLayer, layer, overlapMap, compositingState, descendantHas3DTransform); 873 828 return; 874 829 } 875 830 876 831 #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); 878 833 #endif 879 834 … … 886 841 887 842 layer.setHasCompositingDescendant(false); 888 layer.setBackingProviderLayer(nullptr);889 843 890 844 // We updated compositing for direct reasons in layerStyleChanged(). Here, check for compositing that can only be evaluated after layout. … … 908 862 909 863 RenderLayer::IndirectCompositingReason compositingReason = compositingState.subtreeIsCompositing ? RenderLayer::IndirectCompositingReason::Stacking : RenderLayer::IndirectCompositingReason::None; 910 bool layerPaintsIntoProvidedBacking = false;911 864 912 865 // If we know for sure the layer is going to be composited, don't bother looking it up in the overlap map 913 866 if (!willBeComposited && !overlapMap.isEmpty() && compositingState.testingOverlap) { 914 867 computeExtent(overlapMap, layer, layerExtent); 915 916 868 // 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; 927 870 } 928 871 … … 946 889 // a compositing layer among them, so start by inheriting the compositing 947 890 // 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; 951 900 // This layer now acts as the ancestor for kids. 952 901 childState.compositingAncestor = &layer; 902 953 903 overlapMap.pushCompositingContainer(); 954 955 if (postDescendants) {956 childState.subtreeIsCompositing = true;957 addToOverlapMapRecursive(overlapMap, layer);958 }959 960 904 // This layer is going to be composited, so children can safely ignore the fact that there's an 961 905 // animation running behind this layer, meaning they can rely on the overlap map testing again. 962 906 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();975 907 976 908 computeExtent(overlapMap, layer, layerExtent); … … 978 910 // Too hard to compute animated bounds if both us and some ancestor is animating transform. 979 911 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();984 912 } 985 913 … … 991 919 992 920 for (auto* childLayer : layer.negativeZOrderLayers()) { 993 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState,anyDescendantHas3DTransform);921 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform); 994 922 995 923 // If we have to make a layer for this child, make one now so we can have a contents layer … … 998 926 // make layer compositing 999 927 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; 1001 934 } 1002 935 } 1003 936 1004 937 for (auto* childLayer : layer.normalFlowLayers()) 1005 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState,anyDescendantHas3DTransform);938 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform); 1006 939 1007 940 for (auto* childLayer : layer.positiveZOrderLayers()) 1008 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, backingSharingState,anyDescendantHas3DTransform);941 computeCompositingRequirements(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform); 1009 942 1010 943 // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled). … … 1029 962 RenderLayer::IndirectCompositingReason indirectCompositingReason; 1030 963 if (!willBeComposited && canBeComposited(layer) 1031 && requiresCompositingForIndirectReason(layer , compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, layerPaintsIntoProvidedBacking, indirectCompositingReason)) {964 && requiresCompositingForIndirectReason(layer.renderer(), compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) { 1032 965 layer.setIndirectCompositingReason(indirectCompositingReason); 1033 layerWillComposite(true); 966 childState.compositingAncestor = &layer; 967 childState.subtreeIsCompositing = true; 968 overlapMap.pushCompositingContainer(); 969 addToOverlapMapRecursive(overlapMap, layer); 970 willBeComposited = true; 1034 971 } 1035 972 … … 1051 988 compositingState.testingOverlap = false; 1052 989 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 } 1055 999 1056 1000 #if ENABLE(CSS_COMPOSITING) … … 1074 1018 } 1075 1019 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; 1077 1023 1078 1024 ASSERT(willBeComposited == needsToBeComposited(layer, queryData)); … … 1086 1032 // The composited bounds of enclosing layers depends on which descendants are composited, so they need a geometry update. 1087 1033 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);1098 1034 } 1099 1035 … … 1110 1046 1111 1047 #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); 1113 1049 #endif 1114 1050 … … 1119 1055 1120 1056 // 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)1057 void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap& overlapMap, CompositingState& compositingState, bool& descendantHas3DTransform) 1122 1058 { 1123 1059 ASSERT(!compositingState.fullPaintOrderTraversalRequired); … … 1145 1081 computeExtent(overlapMap, layer, layerExtent); 1146 1082 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 1154 1088 1155 1089 if (layerIsComposited) { … … 1168 1102 // Too hard to compute animated bounds if both us and some ancestor is animating transform. 1169 1103 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();1174 1104 } 1175 1105 … … 1181 1111 1182 1112 for (auto* childLayer : layer.negativeZOrderLayers()) { 1183 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState,anyDescendantHas3DTransform);1113 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform); 1184 1114 if (childState.subtreeIsCompositing) 1185 1115 ASSERT(layerIsComposited); … … 1187 1117 1188 1118 for (auto* childLayer : layer.normalFlowLayers()) 1189 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState,anyDescendantHas3DTransform);1119 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform); 1190 1120 1191 1121 for (auto* childLayer : layer.positiveZOrderLayers()) 1192 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, backingSharingState,anyDescendantHas3DTransform);1122 traverseUnchangedSubtree(&layer, *childLayer, overlapMap, childState, anyDescendantHas3DTransform); 1193 1123 1194 1124 // All layers (even ones that aren't being composited) need to get added to … … 1200 1130 addToOverlapMap(overlapMap, layer, layerExtent); 1201 1131 1202 compositingState.propagateStateFromChildrenForUnchangedSubtree(childState); 1132 // Subsequent layers in the parent stacking context also need to composite. 1133 if (childState.subtreeIsCompositing) 1134 compositingState.subtreeIsCompositing = true; 1203 1135 1204 1136 // Set the flag to say that this layer has compositing children. … … 1225 1157 if (childState.compositingAncestor == &layer && !layer.isRenderViewLayer()) 1226 1158 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 }1239 1159 1240 1160 descendantHas3DTransform |= anyDescendantHas3DTransform || layer.has3DTransform(); … … 1656 1576 1657 1577 if (backingRequired == BackingRequired::Yes) { 1658 layer.disconnectFromBackingProviderLayer();1659 1660 1578 enableCompositingMode(); 1661 1579 … … 1810 1728 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer& parent, RenderLayer& child) 1811 1729 { 1812 if ( parent.renderer().renderTreeBeingDestroyed())1730 if (!child.isComposited() || parent.renderer().renderTreeBeingDestroyed()) 1813 1731 return; 1814 1732 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? 1824 1734 1825 1735 child.setNeedsCompositingLayerConnection(); … … 2884 2794 2885 2795 // 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 { 2796 bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const 2797 { 2798 auto& layer = *renderer.layer(); 2799 2888 2800 // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented 2889 2801 // via compositing so that they also apply to those composited descendants. 2890 auto& renderer = layer.renderer();2891 2802 if (hasCompositedDescendants && (layer.isolatesCompositedBlending() || layer.transform() || renderer.createsGroup() || renderer.hasReflection())) { 2892 2803 reason = RenderLayer::IndirectCompositingReason::GraphicalEffect; … … 2908 2819 } 2909 2820 2910 if ( !paintsIntoProvidedBacking &&renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) {2821 if (renderer.isAbsolutelyPositioned() && compositingAncestor && layer.hasCompositedScrollingAncestor()) { 2911 2822 if (layerContainingBlockCrossesCoordinatedScrollingBoundary(layer, *compositingAncestor)) { 2912 2823 reason = RenderLayer::IndirectCompositingReason::OverflowScrollPositioning; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r245058 r245085 370 370 class OverlapMap; 371 371 struct CompositingState; 372 struct BackingSharingState;373 372 struct OverlapExtent; 374 373 … … 412 411 void updateCompositingLayersTimerFired(); 413 412 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); 416 415 417 416 enum class UpdateLevel { … … 478 477 bool requiresCompositingForOverflowScrolling(const RenderLayer&, RequiresCompositingData&) const; 479 478 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; 481 480 482 481 static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer&, const RenderLayer& compositedAncestor); -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r245058 r245085 655 655 ts << " (composited, bounds=" << layer.backing()->compositedBounds() << ", drawsContent=" << layer.backing()->graphicsLayer()->drawsContent() 656 656 << ", paints into ancestor=" << layer.backing()->paintsIntoCompositedAncestor() << ")"; 657 } else if (layer.paintsIntoProvidedBacking()) 658 ts << " (shared backing of " << layer.backingProviderLayer() << ")"; 657 } 659 658 } 660 659
Note: See TracChangeset
for help on using the changeset viewer.