| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/layout/compositing/CompositedLayerMapping.h" | 7 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 8 #include "core/paint/PaintControllerPaintTest.h" | 8 #include "core/paint/PaintControllerPaintTest.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); | 134 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); |
| 135 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); | 135 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); |
| 136 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); | 136 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); |
| 137 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); | 137 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); |
| 138 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); | 138 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); |
| 139 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj
ect(); | 139 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj
ect(); |
| 140 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); | 140 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); |
| 141 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer(); | 141 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer(); |
| 142 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec
t(); | 142 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec
t(); |
| 143 | 143 |
| 144 LayoutRect interestRect(0, 0, 400, 300); | 144 IntRect interestRect(0, 0, 400, 300); |
| 145 document().view()->updateAllLifecyclePhases(&interestRect); | 145 document().view()->updateAllLifecyclePhases(&interestRect); |
| 146 | 146 |
| 147 // Container1 is fully in the interest rect; | 147 // Container1 is fully in the interest rect; |
| 148 // Container2 is partly (including its stacking chidren) in the interest rec
t; | 148 // Container2 is partly (including its stacking chidren) in the interest rec
t; |
| 149 // Content2b is out of the interest rect and output nothing; | 149 // Content2b is out of the interest rect and output nothing; |
| 150 // Container3 is partly in the interest rect. | 150 // Container3 is partly in the interest rect. |
| 151 if (rootLayerScrolls) { | 151 if (rootLayerScrolls) { |
| 152 EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 15, | 152 EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 15, |
| 153 TestDisplayItem(layoutView(), backgroundType), | 153 TestDisplayItem(layoutView(), backgroundType), |
| 154 TestDisplayItem(rootLayer, subsequenceType), | 154 TestDisplayItem(rootLayer, subsequenceType), |
| (...skipping 24 matching lines...) Expand all Loading... |
| 179 TestDisplayItem(content2a, backgroundType), | 179 TestDisplayItem(content2a, backgroundType), |
| 180 TestDisplayItem(container2Layer, endSubsequenceType), | 180 TestDisplayItem(container2Layer, endSubsequenceType), |
| 181 TestDisplayItem(container3, backgroundType), | 181 TestDisplayItem(container3, backgroundType), |
| 182 TestDisplayItem(container3Layer, subsequenceType), | 182 TestDisplayItem(container3Layer, subsequenceType), |
| 183 TestDisplayItem(content3, backgroundType), | 183 TestDisplayItem(content3, backgroundType), |
| 184 TestDisplayItem(container3Layer, endSubsequenceType), | 184 TestDisplayItem(container3Layer, endSubsequenceType), |
| 185 TestDisplayItem(htmlLayer, endSubsequenceType), | 185 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 186 TestDisplayItem(rootLayer, endSubsequenceType)); | 186 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 LayoutRect newInterestRect(0, 100, 300, 300); | 189 IntRect newInterestRect(0, 100, 300, 300); |
| 190 document().view()->updateAllLifecyclePhases(&newInterestRect); | 190 document().view()->updateAllLifecyclePhases(&newInterestRect); |
| 191 | 191 |
| 192 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce | 192 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce |
| 193 // because it was fully painted before; | 193 // because it was fully painted before; |
| 194 // Container2's intersection with the interest rect changes; | 194 // Container2's intersection with the interest rect changes; |
| 195 // Content2b is out of the interest rect and outputs nothing; | 195 // Content2b is out of the interest rect and outputs nothing; |
| 196 // Container3 becomes out of the interest rect and outputs nothing. | 196 // Container3 becomes out of the interest rect and outputs nothing. |
| 197 if (rootLayerScrolls) { | 197 if (rootLayerScrolls) { |
| 198 EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 11, | 198 EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 11, |
| 199 TestDisplayItem(layoutView(), backgroundType), | 199 TestDisplayItem(layoutView(), backgroundType), |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); | 336 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); |
| 337 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); | 337 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); |
| 338 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); | 338 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); |
| 339 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); | 339 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); |
| 340 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); | 340 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); |
| 341 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj
ect(); | 341 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj
ect(); |
| 342 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); | 342 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); |
| 343 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer(); | 343 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer(); |
| 344 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec
t(); | 344 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec
t(); |
| 345 | 345 |
| 346 LayoutRect interestRect(0, 0, 400, 300); | 346 IntRect interestRect(0, 0, 400, 300); |
| 347 document().view()->updateAllLifecyclePhases(&interestRect); | 347 document().view()->updateAllLifecyclePhases(&interestRect); |
| 348 | 348 |
| 349 // Container1 is fully in the interest rect; | 349 // Container1 is fully in the interest rect; |
| 350 // Container2 is partly (including its stacking chidren) in the interest rec
t; | 350 // Container2 is partly (including its stacking chidren) in the interest rec
t; |
| 351 // Content2b is out of the interest rect and output nothing; | 351 // Content2b is out of the interest rect and output nothing; |
| 352 // Container3 is partly in the interest rect. | 352 // Container3 is partly in the interest rect. |
| 353 EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 17, | 353 EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 17, |
| 354 TestDisplayItem(layoutView(), backgroundType), | 354 TestDisplayItem(layoutView(), backgroundType), |
| 355 TestDisplayItem(rootLayer, subsequenceType), | 355 TestDisplayItem(rootLayer, subsequenceType), |
| 356 TestDisplayItem(htmlLayer, subsequenceType), | 356 TestDisplayItem(htmlLayer, subsequenceType), |
| (...skipping 10 matching lines...) Expand all Loading... |
| 367 TestDisplayItem(content3, backgroundType), | 367 TestDisplayItem(content3, backgroundType), |
| 368 TestDisplayItem(container3Layer, endSubsequenceType), | 368 TestDisplayItem(container3Layer, endSubsequenceType), |
| 369 TestDisplayItem(htmlLayer, endSubsequenceType), | 369 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 370 TestDisplayItem(rootLayer, endSubsequenceType)); | 370 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 371 | 371 |
| 372 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce | 372 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce |
| 373 // because it was fully painted before; | 373 // because it was fully painted before; |
| 374 // Container2's intersection with the interest rect changes; | 374 // Container2's intersection with the interest rect changes; |
| 375 // Content2b is out of the interest rect and outputs nothing; | 375 // Content2b is out of the interest rect and outputs nothing; |
| 376 // Container3 becomes out of the interest rect and outputs nothing. | 376 // Container3 becomes out of the interest rect and outputs nothing. |
| 377 LayoutRect newInterestRect(0, 100, 300, 300); | 377 IntRect newInterestRect(0, 100, 300, 300); |
| 378 updateLifecyclePhasesToPaintClean(&newInterestRect); | 378 updateLifecyclePhasesToPaintClean(&newInterestRect); |
| 379 | 379 |
| 380 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItemList(), 11, | 380 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItemList(), 11, |
| 381 TestDisplayItem(layoutView(), cachedBackgroundType), | 381 TestDisplayItem(layoutView(), cachedBackgroundType), |
| 382 TestDisplayItem(rootLayer, subsequenceType), | 382 TestDisplayItem(rootLayer, subsequenceType), |
| 383 TestDisplayItem(htmlLayer, subsequenceType), | 383 TestDisplayItem(htmlLayer, subsequenceType), |
| 384 TestDisplayItem(container1, cachedBackgroundType), | 384 TestDisplayItem(container1, cachedBackgroundType), |
| 385 TestDisplayItem(container1Layer, cachedSubsequenceType), | 385 TestDisplayItem(container1Layer, cachedSubsequenceType), |
| 386 TestDisplayItem(container2, cachedBackgroundType), | 386 TestDisplayItem(container2, cachedBackgroundType), |
| 387 TestDisplayItem(container2Layer, subsequenceType), | 387 TestDisplayItem(container2Layer, subsequenceType), |
| (...skipping 14 matching lines...) Expand all Loading... |
| 402 TestDisplayItem(container1Layer, endSubsequenceType), | 402 TestDisplayItem(container1Layer, endSubsequenceType), |
| 403 TestDisplayItem(container2, backgroundType), | 403 TestDisplayItem(container2, backgroundType), |
| 404 TestDisplayItem(container2Layer, subsequenceType), | 404 TestDisplayItem(container2Layer, subsequenceType), |
| 405 TestDisplayItem(content2a, backgroundType), | 405 TestDisplayItem(content2a, backgroundType), |
| 406 TestDisplayItem(container2Layer, endSubsequenceType), | 406 TestDisplayItem(container2Layer, endSubsequenceType), |
| 407 TestDisplayItem(htmlLayer, endSubsequenceType), | 407 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 408 TestDisplayItem(rootLayer, endSubsequenceType)); | 408 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 409 } | 409 } |
| 410 | 410 |
| 411 } // namespace blink | 411 } // namespace blink |
| OLD | NEW |