| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBoxModelObject.h" | 7 #include "core/layout/LayoutBoxModelObject.h" |
| 8 #include "core/layout/compositing/CompositedLayerMapping.h" | 8 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 9 #include "core/paint/PaintControllerPaintTest.h" | 9 #include "core/paint/PaintControllerPaintTest.h" |
| 10 #include "platform/graphics/GraphicsContext.h" | 10 #include "platform/graphics/GraphicsContext.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); | 77 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); |
| 78 LayoutObject& content1 = | 78 LayoutObject& content1 = |
| 79 *document().getElementById("content1")->layoutObject(); | 79 *document().getElementById("content1")->layoutObject(); |
| 80 LayoutObject& container2 = | 80 LayoutObject& container2 = |
| 81 *document().getElementById("container2")->layoutObject(); | 81 *document().getElementById("container2")->layoutObject(); |
| 82 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); | 82 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); |
| 83 LayoutObject& content2 = | 83 LayoutObject& content2 = |
| 84 *document().getElementById("content2")->layoutObject(); | 84 *document().getElementById("content2")->layoutObject(); |
| 85 | 85 |
| 86 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 86 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 87 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 87 EXPECT_DISPLAY_LIST( |
| 88 EXPECT_DISPLAY_LIST( | 88 rootPaintController().getDisplayItemList(), 13, |
| 89 rootPaintController().getDisplayItemList(), 13, | 89 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 90 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 90 TestDisplayItem(layoutView(), documentBackgroundType), |
| 91 TestDisplayItem(layoutView(), documentBackgroundType), | 91 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 92 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 92 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 93 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 93 TestDisplayItem(container1, backgroundType), |
| 94 TestDisplayItem(container1, backgroundType), | 94 TestDisplayItem(content1, backgroundType), |
| 95 TestDisplayItem(content1, backgroundType), | 95 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 96 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 96 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| 97 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 97 TestDisplayItem(container2, backgroundType), |
| 98 TestDisplayItem(container2, backgroundType), | 98 TestDisplayItem(content2, backgroundType), |
| 99 TestDisplayItem(content2, backgroundType), | 99 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), |
| 100 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | 100 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 101 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | 101 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); |
| 102 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); | |
| 103 } else { | |
| 104 EXPECT_DISPLAY_LIST( | |
| 105 rootPaintController().getDisplayItemList(), 15, | |
| 106 TestDisplayItem(layoutView(), | |
| 107 DisplayItem::kClipFrameToVisibleContentRect), | |
| 108 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | |
| 109 TestDisplayItem(layoutView(), documentBackgroundType), | |
| 110 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | |
| 111 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | |
| 112 TestDisplayItem(container1, backgroundType), | |
| 113 TestDisplayItem(content1, backgroundType), | |
| 114 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | |
| 115 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | |
| 116 TestDisplayItem(container2, backgroundType), | |
| 117 TestDisplayItem(content2, backgroundType), | |
| 118 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | |
| 119 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 120 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | |
| 121 TestDisplayItem(layoutView(), | |
| 122 DisplayItem::clipTypeToEndClipType( | |
| 123 DisplayItem::kClipFrameToVisibleContentRect))); | |
| 124 } | |
| 125 } else { | 102 } else { |
| 126 EXPECT_DISPLAY_LIST( | 103 EXPECT_DISPLAY_LIST( |
| 127 rootPaintController().getDisplayItemList(), 11, | 104 rootPaintController().getDisplayItemList(), 11, |
| 128 TestDisplayItem(layoutView(), documentBackgroundType), | 105 TestDisplayItem(layoutView(), documentBackgroundType), |
| 129 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 106 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 130 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 107 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 131 TestDisplayItem(container1, backgroundType), | 108 TestDisplayItem(container1, backgroundType), |
| 132 TestDisplayItem(content1, backgroundType), | 109 TestDisplayItem(content1, backgroundType), |
| 133 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 110 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 134 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 111 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| 135 TestDisplayItem(container2, backgroundType), | 112 TestDisplayItem(container2, backgroundType), |
| 136 TestDisplayItem(content2, backgroundType), | 113 TestDisplayItem(content2, backgroundType), |
| 137 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | 114 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), |
| 138 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence)); | 115 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence)); |
| 139 } | 116 } |
| 140 | 117 |
| 141 toHTMLElement(content1.node()) | 118 toHTMLElement(content1.node()) |
| 142 ->setAttribute(HTMLNames::styleAttr, | 119 ->setAttribute(HTMLNames::styleAttr, |
| 143 "position: absolute; width: 100px; height: 100px; " | 120 "position: absolute; width: 100px; height: 100px; " |
| 144 "background-color: green"); | 121 "background-color: green"); |
| 145 document().view()->updateAllLifecyclePhasesExceptPaint(); | 122 document().view()->updateAllLifecyclePhasesExceptPaint(); |
| 146 EXPECT_TRUE(paintWithoutCommit()); | 123 EXPECT_TRUE(paintWithoutCommit()); |
| 147 | 124 |
| 148 EXPECT_EQ(6, numCachedNewItems()); | 125 EXPECT_EQ(6, numCachedNewItems()); |
| 149 | 126 |
| 150 commit(); | 127 commit(); |
| 151 | 128 |
| 152 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 129 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 153 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 130 EXPECT_DISPLAY_LIST( |
| 154 EXPECT_DISPLAY_LIST( | 131 rootPaintController().getDisplayItemList(), 13, |
| 155 rootPaintController().getDisplayItemList(), 13, | 132 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 156 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 133 TestDisplayItem(layoutView(), documentBackgroundType), |
| 157 TestDisplayItem(layoutView(), documentBackgroundType), | 134 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 158 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 135 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 159 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 136 TestDisplayItem(container1, backgroundType), |
| 160 TestDisplayItem(container1, backgroundType), | 137 TestDisplayItem(content1, backgroundType), |
| 161 TestDisplayItem(content1, backgroundType), | 138 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 162 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 139 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| 163 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 140 TestDisplayItem(container2, backgroundType), |
| 164 TestDisplayItem(container2, backgroundType), | 141 TestDisplayItem(content2, backgroundType), |
| 165 TestDisplayItem(content2, backgroundType), | 142 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), |
| 166 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | 143 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 167 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | 144 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); |
| 168 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); | |
| 169 } else { | |
| 170 EXPECT_DISPLAY_LIST( | |
| 171 rootPaintController().getDisplayItemList(), 15, | |
| 172 TestDisplayItem(layoutView(), | |
| 173 DisplayItem::kClipFrameToVisibleContentRect), | |
| 174 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | |
| 175 TestDisplayItem(layoutView(), documentBackgroundType), | |
| 176 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | |
| 177 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | |
| 178 TestDisplayItem(container1, backgroundType), | |
| 179 TestDisplayItem(content1, backgroundType), | |
| 180 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | |
| 181 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | |
| 182 TestDisplayItem(container2, backgroundType), | |
| 183 TestDisplayItem(content2, backgroundType), | |
| 184 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | |
| 185 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 186 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | |
| 187 TestDisplayItem(layoutView(), | |
| 188 DisplayItem::clipTypeToEndClipType( | |
| 189 DisplayItem::kClipFrameToVisibleContentRect))); | |
| 190 } | |
| 191 } else { | 145 } else { |
| 192 EXPECT_DISPLAY_LIST( | 146 EXPECT_DISPLAY_LIST( |
| 193 rootPaintController().getDisplayItemList(), 11, | 147 rootPaintController().getDisplayItemList(), 11, |
| 194 TestDisplayItem(layoutView(), documentBackgroundType), | 148 TestDisplayItem(layoutView(), documentBackgroundType), |
| 195 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 149 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 196 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 150 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 197 TestDisplayItem(container1, backgroundType), | 151 TestDisplayItem(container1, backgroundType), |
| 198 TestDisplayItem(content1, backgroundType), | 152 TestDisplayItem(content1, backgroundType), |
| 199 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 153 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 200 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 154 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| (...skipping 16 matching lines...) Expand all Loading... |
| 217 | 171 |
| 218 PaintLayer& htmlLayer = | 172 PaintLayer& htmlLayer = |
| 219 *toLayoutBoxModelObject(document().documentElement()->layoutObject()) | 173 *toLayoutBoxModelObject(document().documentElement()->layoutObject()) |
| 220 ->layer(); | 174 ->layer(); |
| 221 LayoutObject& svg = *document().getElementById("svg")->layoutObject(); | 175 LayoutObject& svg = *document().getElementById("svg")->layoutObject(); |
| 222 PaintLayer& svgLayer = *toLayoutBoxModelObject(svg).layer(); | 176 PaintLayer& svgLayer = *toLayoutBoxModelObject(svg).layer(); |
| 223 LayoutObject& rect = *document().getElementById("rect")->layoutObject(); | 177 LayoutObject& rect = *document().getElementById("rect")->layoutObject(); |
| 224 LayoutObject& div = *document().getElementById("div")->layoutObject(); | 178 LayoutObject& div = *document().getElementById("div")->layoutObject(); |
| 225 | 179 |
| 226 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 180 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 227 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 181 // SPv2 slips the clip box (see BoxClipper). |
| 228 // SPv2 slips the clip box (see BoxClipper). | 182 EXPECT_DISPLAY_LIST( |
| 229 EXPECT_DISPLAY_LIST( | 183 rootPaintController().getDisplayItemList(), 8, |
| 230 rootPaintController().getDisplayItemList(), 10, | 184 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 231 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 185 TestDisplayItem(layoutView(), documentBackgroundType), |
| 232 TestDisplayItem(layoutView(), documentBackgroundType), | 186 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 233 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 187 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), |
| 234 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), | 188 TestDisplayItem(rect, foregroundType), |
| 235 TestDisplayItem(svg, DisplayItem::kBeginTransform), | 189 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), |
| 236 TestDisplayItem(rect, foregroundType), | 190 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 237 TestDisplayItem(svg, DisplayItem::kEndTransform), | 191 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); |
| 238 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), | |
| 239 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 240 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); | |
| 241 } else { | |
| 242 // SPv2 slips the clip box (see BoxClipper). | |
| 243 EXPECT_DISPLAY_LIST( | |
| 244 rootPaintController().getDisplayItemList(), 12, | |
| 245 TestDisplayItem(layoutView(), | |
| 246 DisplayItem::kClipFrameToVisibleContentRect), | |
| 247 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | |
| 248 TestDisplayItem(layoutView(), documentBackgroundType), | |
| 249 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | |
| 250 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), | |
| 251 TestDisplayItem(svg, DisplayItem::kBeginTransform), | |
| 252 TestDisplayItem(rect, foregroundType), | |
| 253 TestDisplayItem(svg, DisplayItem::kEndTransform), | |
| 254 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), | |
| 255 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 256 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | |
| 257 TestDisplayItem(layoutView(), | |
| 258 DisplayItem::clipTypeToEndClipType( | |
| 259 DisplayItem::kClipFrameToVisibleContentRect))); | |
| 260 } | |
| 261 } else { | 192 } else { |
| 262 EXPECT_DISPLAY_LIST( | 193 EXPECT_DISPLAY_LIST( |
| 263 rootPaintController().getDisplayItemList(), 10, | 194 rootPaintController().getDisplayItemList(), 10, |
| 264 TestDisplayItem(layoutView(), documentBackgroundType), | 195 TestDisplayItem(layoutView(), documentBackgroundType), |
| 265 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 196 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 266 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), | 197 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), |
| 267 TestDisplayItem(svg, DisplayItem::kClipLayerForeground), | 198 TestDisplayItem(svg, DisplayItem::kClipLayerForeground), |
| 268 TestDisplayItem(svg, DisplayItem::kBeginTransform), | 199 TestDisplayItem(svg, DisplayItem::kBeginTransform), |
| 269 TestDisplayItem(rect, foregroundType), | 200 TestDisplayItem(rect, foregroundType), |
| 270 TestDisplayItem(svg, DisplayItem::kEndTransform), | 201 TestDisplayItem(svg, DisplayItem::kEndTransform), |
| 271 TestDisplayItem(svg, DisplayItem::clipTypeToEndClipType( | 202 TestDisplayItem(svg, DisplayItem::clipTypeToEndClipType( |
| 272 DisplayItem::kClipLayerForeground)), | 203 DisplayItem::kClipLayerForeground)), |
| 273 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), | 204 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), |
| 274 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence)); | 205 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence)); |
| 275 } | 206 } |
| 276 | 207 |
| 277 // Change the color of the div. This should not invalidate the subsequence | 208 // Change the color of the div. This should not invalidate the subsequence |
| 278 // for the SVG root. | 209 // for the SVG root. |
| 279 toHTMLElement(div.node()) | 210 toHTMLElement(div.node()) |
| 280 ->setAttribute(HTMLNames::styleAttr, | 211 ->setAttribute(HTMLNames::styleAttr, |
| 281 "position: relative; width: 50x; height: 50px; " | 212 "position: relative; width: 50x; height: 50px; " |
| 282 "background-color: green"); | 213 "background-color: green"); |
| 283 document().view()->updateAllLifecyclePhasesExceptPaint(); | 214 document().view()->updateAllLifecyclePhasesExceptPaint(); |
| 284 EXPECT_TRUE(paintWithoutCommit()); | 215 EXPECT_TRUE(paintWithoutCommit()); |
| 285 | 216 |
| 286 // Reuse of SVG and document background. 2 fewer with SPv2 enabled because | 217 // Reuse of SVG and document background. 2 fewer with SPv2 enabled because |
| 287 // clip display items don't appear in SPv2 display lists. | 218 // clip display items don't appear in SPv2 display lists. |
| 288 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 219 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 289 EXPECT_EQ(6, numCachedNewItems()); | 220 EXPECT_EQ(4, numCachedNewItems()); |
| 290 else | 221 else |
| 291 EXPECT_EQ(8, numCachedNewItems()); | 222 EXPECT_EQ(8, numCachedNewItems()); |
| 292 | 223 |
| 293 commit(); | 224 commit(); |
| 294 | 225 |
| 295 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 226 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 296 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 227 EXPECT_DISPLAY_LIST( |
| 297 EXPECT_DISPLAY_LIST( | 228 rootPaintController().getDisplayItemList(), 9, |
| 298 rootPaintController().getDisplayItemList(), 11, | 229 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 299 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 230 TestDisplayItem(layoutView(), documentBackgroundType), |
| 300 TestDisplayItem(layoutView(), documentBackgroundType), | 231 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 301 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 232 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), |
| 302 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), | 233 TestDisplayItem(rect, foregroundType), |
| 303 TestDisplayItem(svg, DisplayItem::kBeginTransform), | 234 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), |
| 304 TestDisplayItem(rect, foregroundType), | 235 TestDisplayItem(div, backgroundType), |
| 305 TestDisplayItem(svg, DisplayItem::kEndTransform), | 236 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 306 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), | 237 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); |
| 307 TestDisplayItem(div, backgroundType), | |
| 308 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 309 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); | |
| 310 } else { | |
| 311 EXPECT_DISPLAY_LIST( | |
| 312 rootPaintController().getDisplayItemList(), 13, | |
| 313 TestDisplayItem(layoutView(), | |
| 314 DisplayItem::kClipFrameToVisibleContentRect), | |
| 315 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | |
| 316 TestDisplayItem(layoutView(), documentBackgroundType), | |
| 317 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | |
| 318 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), | |
| 319 TestDisplayItem(svg, DisplayItem::kBeginTransform), | |
| 320 TestDisplayItem(rect, foregroundType), | |
| 321 TestDisplayItem(svg, DisplayItem::kEndTransform), | |
| 322 TestDisplayItem(svgLayer, DisplayItem::kEndSubsequence), | |
| 323 TestDisplayItem(div, backgroundType), | |
| 324 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 325 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | |
| 326 TestDisplayItem(layoutView(), | |
| 327 DisplayItem::clipTypeToEndClipType( | |
| 328 DisplayItem::kClipFrameToVisibleContentRect))); | |
| 329 } | |
| 330 } else { | 238 } else { |
| 331 EXPECT_DISPLAY_LIST( | 239 EXPECT_DISPLAY_LIST( |
| 332 rootPaintController().getDisplayItemList(), 11, | 240 rootPaintController().getDisplayItemList(), 11, |
| 333 TestDisplayItem(layoutView(), documentBackgroundType), | 241 TestDisplayItem(layoutView(), documentBackgroundType), |
| 334 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 242 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 335 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), | 243 TestDisplayItem(svgLayer, DisplayItem::kSubsequence), |
| 336 TestDisplayItem(svg, DisplayItem::kClipLayerForeground), | 244 TestDisplayItem(svg, DisplayItem::kClipLayerForeground), |
| 337 TestDisplayItem(svg, DisplayItem::kBeginTransform), | 245 TestDisplayItem(svg, DisplayItem::kBeginTransform), |
| 338 TestDisplayItem(rect, foregroundType), | 246 TestDisplayItem(rect, foregroundType), |
| 339 TestDisplayItem(svg, DisplayItem::kEndTransform), | 247 TestDisplayItem(svg, DisplayItem::kEndTransform), |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); | 387 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); |
| 480 LayoutObject& content1 = | 388 LayoutObject& content1 = |
| 481 *document().getElementById("content1")->layoutObject(); | 389 *document().getElementById("content1")->layoutObject(); |
| 482 LayoutObject& container2 = | 390 LayoutObject& container2 = |
| 483 *document().getElementById("container2")->layoutObject(); | 391 *document().getElementById("container2")->layoutObject(); |
| 484 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); | 392 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); |
| 485 LayoutObject& content2 = | 393 LayoutObject& content2 = |
| 486 *document().getElementById("content2")->layoutObject(); | 394 *document().getElementById("content2")->layoutObject(); |
| 487 | 395 |
| 488 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 396 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 489 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 397 EXPECT_DISPLAY_LIST( |
| 490 EXPECT_DISPLAY_LIST( | 398 rootPaintController().getDisplayItemList(), 13, |
| 491 rootPaintController().getDisplayItemList(), 13, | 399 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 492 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 400 TestDisplayItem(layoutView(), documentBackgroundType), |
| 493 TestDisplayItem(layoutView(), documentBackgroundType), | 401 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 494 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 402 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 495 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 403 TestDisplayItem(container1, backgroundType), |
| 496 TestDisplayItem(container1, backgroundType), | 404 TestDisplayItem(content1, backgroundType), |
| 497 TestDisplayItem(content1, backgroundType), | 405 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 498 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 406 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| 499 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 407 TestDisplayItem(container2, backgroundType), |
| 500 TestDisplayItem(container2, backgroundType), | 408 TestDisplayItem(content2, backgroundType), |
| 501 TestDisplayItem(content2, backgroundType), | 409 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), |
| 502 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | 410 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 503 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | 411 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); |
| 504 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); | |
| 505 } else { | |
| 506 EXPECT_DISPLAY_LIST( | |
| 507 rootPaintController().getDisplayItemList(), 15, | |
| 508 TestDisplayItem(layoutView(), | |
| 509 DisplayItem::kClipFrameToVisibleContentRect), | |
| 510 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | |
| 511 TestDisplayItem(layoutView(), documentBackgroundType), | |
| 512 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | |
| 513 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | |
| 514 TestDisplayItem(container1, backgroundType), | |
| 515 TestDisplayItem(content1, backgroundType), | |
| 516 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | |
| 517 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | |
| 518 TestDisplayItem(container2, backgroundType), | |
| 519 TestDisplayItem(content2, backgroundType), | |
| 520 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | |
| 521 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 522 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | |
| 523 TestDisplayItem(layoutView(), | |
| 524 DisplayItem::clipTypeToEndClipType( | |
| 525 DisplayItem::kClipFrameToVisibleContentRect))); | |
| 526 } | |
| 527 } else { | 412 } else { |
| 528 EXPECT_DISPLAY_LIST( | 413 EXPECT_DISPLAY_LIST( |
| 529 rootPaintController().getDisplayItemList(), 11, | 414 rootPaintController().getDisplayItemList(), 11, |
| 530 TestDisplayItem(layoutView(), documentBackgroundType), | 415 TestDisplayItem(layoutView(), documentBackgroundType), |
| 531 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 416 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 532 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 417 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 533 TestDisplayItem(container1, backgroundType), | 418 TestDisplayItem(container1, backgroundType), |
| 534 TestDisplayItem(content1, backgroundType), | 419 TestDisplayItem(content1, backgroundType), |
| 535 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 420 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 536 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 421 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| 537 TestDisplayItem(container2, backgroundType), | 422 TestDisplayItem(container2, backgroundType), |
| 538 TestDisplayItem(content2, backgroundType), | 423 TestDisplayItem(content2, backgroundType), |
| 539 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | 424 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), |
| 540 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence)); | 425 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence)); |
| 541 } | 426 } |
| 542 | 427 |
| 543 toHTMLElement(content1.node()) | 428 toHTMLElement(content1.node()) |
| 544 ->setAttribute(HTMLNames::styleAttr, | 429 ->setAttribute(HTMLNames::styleAttr, |
| 545 "position: absolute; width: 100px; height: 100px; " | 430 "position: absolute; width: 100px; height: 100px; " |
| 546 "background-color: green"); | 431 "background-color: green"); |
| 547 document().view()->updateAllLifecyclePhasesExceptPaint(); | 432 document().view()->updateAllLifecyclePhasesExceptPaint(); |
| 548 EXPECT_TRUE(paintWithoutCommit(&interestRect)); | 433 EXPECT_TRUE(paintWithoutCommit(&interestRect)); |
| 549 | 434 |
| 550 EXPECT_EQ(6, numCachedNewItems()); | 435 EXPECT_EQ(6, numCachedNewItems()); |
| 551 | 436 |
| 552 commit(); | 437 commit(); |
| 553 | 438 |
| 554 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 439 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 555 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 440 EXPECT_DISPLAY_LIST( |
| 556 EXPECT_DISPLAY_LIST( | 441 rootPaintController().getDisplayItemList(), 13, |
| 557 rootPaintController().getDisplayItemList(), 13, | 442 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 558 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 443 TestDisplayItem(layoutView(), documentBackgroundType), |
| 559 TestDisplayItem(layoutView(), documentBackgroundType), | 444 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 560 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 445 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 561 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 446 TestDisplayItem(container1, backgroundType), |
| 562 TestDisplayItem(container1, backgroundType), | 447 TestDisplayItem(content1, backgroundType), |
| 563 TestDisplayItem(content1, backgroundType), | 448 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 564 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 449 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| 565 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 450 TestDisplayItem(container2, backgroundType), |
| 566 TestDisplayItem(container2, backgroundType), | 451 TestDisplayItem(content2, backgroundType), |
| 567 TestDisplayItem(content2, backgroundType), | 452 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), |
| 568 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | 453 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 569 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | 454 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); |
| 570 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); | |
| 571 } else { | |
| 572 EXPECT_DISPLAY_LIST( | |
| 573 rootPaintController().getDisplayItemList(), 15, | |
| 574 TestDisplayItem(layoutView(), | |
| 575 DisplayItem::kClipFrameToVisibleContentRect), | |
| 576 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | |
| 577 TestDisplayItem(layoutView(), documentBackgroundType), | |
| 578 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | |
| 579 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | |
| 580 TestDisplayItem(container1, backgroundType), | |
| 581 TestDisplayItem(content1, backgroundType), | |
| 582 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | |
| 583 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | |
| 584 TestDisplayItem(container2, backgroundType), | |
| 585 TestDisplayItem(content2, backgroundType), | |
| 586 TestDisplayItem(container2Layer, DisplayItem::kEndSubsequence), | |
| 587 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | |
| 588 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | |
| 589 TestDisplayItem(layoutView(), | |
| 590 DisplayItem::clipTypeToEndClipType( | |
| 591 DisplayItem::kClipFrameToVisibleContentRect))); | |
| 592 } | |
| 593 } else { | 455 } else { |
| 594 EXPECT_DISPLAY_LIST( | 456 EXPECT_DISPLAY_LIST( |
| 595 rootPaintController().getDisplayItemList(), 11, | 457 rootPaintController().getDisplayItemList(), 11, |
| 596 TestDisplayItem(layoutView(), documentBackgroundType), | 458 TestDisplayItem(layoutView(), documentBackgroundType), |
| 597 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 459 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 598 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), | 460 TestDisplayItem(container1Layer, DisplayItem::kSubsequence), |
| 599 TestDisplayItem(container1, backgroundType), | 461 TestDisplayItem(container1, backgroundType), |
| 600 TestDisplayItem(content1, backgroundType), | 462 TestDisplayItem(content1, backgroundType), |
| 601 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), | 463 TestDisplayItem(container1Layer, DisplayItem::kEndSubsequence), |
| 602 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), | 464 TestDisplayItem(container2Layer, DisplayItem::kSubsequence), |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 966 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 1105 EXPECT_TRUE( | 967 EXPECT_TRUE( |
| 1106 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); | 968 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1107 } else { | 969 } else { |
| 1108 EXPECT_FALSE( | 970 EXPECT_FALSE( |
| 1109 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); | 971 PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo)); |
| 1110 } | 972 } |
| 1111 } | 973 } |
| 1112 | 974 |
| 1113 } // namespace blink | 975 } // namespace blink |
| OLD | NEW |