| 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/paint/DisplayItemListPaintTest.h" | 7 #include "core/paint/DisplayItemListPaintTest.h" |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 using DeprecatedPaintLayerPainterTest = DisplayItemListPaintTest; | 12 using DeprecatedPaintLayerPainterTest = DisplayItemListPaintTest; |
| 13 using DeprecatedPaintLayerPainterTestForSlimmingPaintV2 = DisplayItemListPaintTe
stForSlimmingPaintV2; | 13 using DeprecatedPaintLayerPainterTestForSlimmingPaintV2 = DisplayItemListPaintTe
stForSlimmingPaintV2; |
| 14 | 14 |
| 15 TEST_F(DeprecatedPaintLayerPainterTest, CachedSubsequence) | 15 TEST_F(DeprecatedPaintLayerPainterTest, CachedSubsequence) |
| 16 { | 16 { |
| 17 RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true); | 17 RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true); |
| 18 | 18 |
| 19 setBodyInnerHTML( | 19 setBodyInnerHTML( |
| 20 "<div id='container1' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" | 20 "<div id='container1' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 21 " <div id='content1' style='width: 100px; height: 100px; background-col
or: red'></div>" | 21 " <div id='content1' style='position: absolute; width: 100px; height: 1
00px; background-color: red'></div>" |
| 22 "</div>" | 22 "</div>" |
| 23 "<div id='container2' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" | 23 "<div id='container2' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 24 " <div id='content2' style='width: 100px; height: 100px; background-col
or: green'></div>" | 24 " <div id='content2' style='position: absolute; width: 100px; height: 1
00px; background-color: green'></div>" |
| 25 "</div>"); | 25 "</div>"); |
| 26 document().view()->updateAllLifecyclePhases(); | 26 document().view()->updateAllLifecyclePhases(); |
| 27 | 27 |
| 28 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); | 28 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
| 29 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); | 29 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); |
| 30 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); | 30 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); |
| 31 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); | 31 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); |
| 32 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); | 32 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); |
| 33 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); | 33 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); |
| 34 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); | 34 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); |
| 35 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec
t(); | 35 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec
t(); |
| 36 | 36 |
| 37 GraphicsContext context(&rootDisplayItemList()); | 37 GraphicsContext context(&rootDisplayItemList()); |
| 38 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8
00, 600), GlobalPaintNormalPhase, LayoutSize()); | 38 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8
00, 600), GlobalPaintNormalPhase, LayoutSize()); |
| 39 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 39 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 40 rootDisplayItemList().commitNewDisplayItems(); | 40 rootDisplayItemList().commitNewDisplayItems(); |
| 41 | 41 |
| 42 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, | 42 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 43 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 43 TestDisplayItem(layoutView(), backgroundType), |
| 44 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 44 TestDisplayItem(rootLayer, subsequenceType), |
| 45 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 45 TestDisplayItem(htmlLayer, subsequenceType), |
| 46 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 46 TestDisplayItem(container1, backgroundType), |
| 47 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 47 TestDisplayItem(container1Layer, subsequenceType), |
| 48 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 48 TestDisplayItem(content1, backgroundType), |
| 49 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 49 TestDisplayItem(container1Layer, endSubsequenceType), |
| 50 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 50 TestDisplayItem(container2, backgroundType), |
| 51 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 51 TestDisplayItem(container2Layer, subsequenceType), |
| 52 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 52 TestDisplayItem(content2, backgroundType), |
| 53 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 53 TestDisplayItem(container2Layer, endSubsequenceType), |
| 54 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 54 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 55 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 55 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 56 | 56 |
| 57 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; background-color: green"); | 57 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position
: absolute; width: 100px; height: 100px; background-color: green"); |
| 58 document().view()->updateAllLifecyclePhases(); | 58 document().view()->updateAllLifecyclePhases(); |
| 59 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 59 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 60 | 60 |
| 61 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 10, | 61 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, |
| 62 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 62 TestDisplayItem(layoutView(), cachedBackgroundType), |
| 63 TestDisplayItem(layoutView(), DisplayItem::drawingTypeToCachedDrawingTyp
e(DisplayItem::BoxDecorationBackground)), | 63 TestDisplayItem(rootLayer, subsequenceType), |
| 64 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 64 TestDisplayItem(htmlLayer, subsequenceType), |
| 65 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 65 TestDisplayItem(container1, cachedBackgroundType), |
| 66 TestDisplayItem(container1, DisplayItem::drawingTypeToCachedDrawingType(
DisplayItem::BoxDecorationBackground)), | 66 TestDisplayItem(container1Layer, subsequenceType), |
| 67 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 67 TestDisplayItem(content1, backgroundType), |
| 68 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 68 TestDisplayItem(container1Layer, endSubsequenceType), |
| 69 TestDisplayItem(container2Layer, DisplayItem::CachedSubsequence), | 69 TestDisplayItem(container2, cachedBackgroundType), |
| 70 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 70 TestDisplayItem(container2Layer, cachedSubsequenceType), |
| 71 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 71 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 72 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 72 | 73 |
| 73 rootDisplayItemList().commitNewDisplayItems(); | 74 rootDisplayItemList().commitNewDisplayItems(); |
| 74 | 75 |
| 75 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, | 76 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 76 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 77 TestDisplayItem(layoutView(), backgroundType), |
| 77 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 78 TestDisplayItem(rootLayer, subsequenceType), |
| 78 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 79 TestDisplayItem(htmlLayer, subsequenceType), |
| 79 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 80 TestDisplayItem(container1, backgroundType), |
| 80 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 81 TestDisplayItem(container1Layer, subsequenceType), |
| 81 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 82 TestDisplayItem(content1, backgroundType), |
| 82 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 83 TestDisplayItem(container1Layer, endSubsequenceType), |
| 83 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 84 TestDisplayItem(container2, backgroundType), |
| 84 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 85 TestDisplayItem(container2Layer, subsequenceType), |
| 85 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 86 TestDisplayItem(content2, backgroundType), |
| 86 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 87 TestDisplayItem(container2Layer, endSubsequenceType), |
| 87 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 88 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 88 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 89 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 89 | 90 |
| 90 // Repeated painting should just generate the root cached subsequence. | 91 // Repeated painting should just generate the root cached subsequence. |
| 91 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 92 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 92 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 1, | 93 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 2, |
| 93 TestDisplayItem(rootLayer, DisplayItem::CachedSubsequence)); | 94 TestDisplayItem(layoutView(), cachedBackgroundType), |
| 95 TestDisplayItem(rootLayer, cachedSubsequenceType)); |
| 94 | 96 |
| 95 rootDisplayItemList().commitNewDisplayItems(); | 97 rootDisplayItemList().commitNewDisplayItems(); |
| 96 | 98 |
| 97 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, | 99 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 98 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 100 TestDisplayItem(layoutView(), backgroundType), |
| 99 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 101 TestDisplayItem(rootLayer, subsequenceType), |
| 100 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 102 TestDisplayItem(htmlLayer, subsequenceType), |
| 101 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 103 TestDisplayItem(container1, backgroundType), |
| 102 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 104 TestDisplayItem(container1Layer, subsequenceType), |
| 103 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 105 TestDisplayItem(content1, backgroundType), |
| 104 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 106 TestDisplayItem(container1Layer, endSubsequenceType), |
| 105 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 107 TestDisplayItem(container2, backgroundType), |
| 106 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 108 TestDisplayItem(container2Layer, subsequenceType), |
| 107 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 109 TestDisplayItem(content2, backgroundType), |
| 108 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 110 TestDisplayItem(container2Layer, endSubsequenceType), |
| 109 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 111 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 110 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 112 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 111 } | 113 } |
| 112 | 114 |
| 113 TEST_F(DeprecatedPaintLayerPainterTest, CachedSubsequenceOnInterestRectChange) | 115 TEST_F(DeprecatedPaintLayerPainterTest, CachedSubsequenceOnInterestRectChange) |
| 114 { | 116 { |
| 115 RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true); | 117 RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true); |
| 116 | 118 |
| 117 setBodyInnerHTML( | 119 setBodyInnerHTML( |
| 118 "<div id='container1' style='position: relative; width: 200px; height: 2
00px; background-color: blue'></div>" | 120 "<div id='container1' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 119 "<div id='container2' style='position: absolute; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" | 121 " <div id='content1' style='position: absolute; width: 100px; height: 1
00px; background-color: green'></div>" |
| 120 " <div id='content2' style='position: relative; top: 200px; width: 100p
x; height: 100px; background-color: green'></div>" | |
| 121 "</div>" | 122 "</div>" |
| 122 "<div id='container3' style='position: absolute; z-index: 2; left: 300px
; top: 0; width: 200px; height: 200px; background-color: blue'></div>"); | 123 "<div id='container2' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 124 " <div id='content2a' style='position: absolute; width: 100px; height:
100px; background-color: green'></div>" |
| 125 " <div id='content2b' style='position: absolute; top: 200px; width: 100
px; height: 100px; background-color: green'></div>" |
| 126 "</div>" |
| 127 "<div id='container3' style='position: absolute; z-index: 2; left: 300px
; top: 0; width: 200px; height: 200px; background-color: blue'>" |
| 128 " <div id='content3' style='position: absolute; width: 200px; height: 2
00px; background-color: green'></div>" |
| 129 "</div>"); |
| 123 rootDisplayItemList().invalidateAll(); | 130 rootDisplayItemList().invalidateAll(); |
| 124 | 131 |
| 125 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); | 132 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
| 126 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); | 133 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); |
| 127 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); | 134 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); |
| 128 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); | 135 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); |
| 136 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); |
| 129 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); | 137 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); |
| 130 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); | 138 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); |
| 139 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj
ect(); |
| 131 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); | 140 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); |
| 132 DeprecatedPaintLayer& container3Layer = *toLayoutBoxModelObject(container3).
layer(); | 141 DeprecatedPaintLayer& container3Layer = *toLayoutBoxModelObject(container3).
layer(); |
| 142 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec
t(); |
| 133 | 143 |
| 134 document().view()->updateAllLifecyclePhases(); | 144 document().view()->updateAllLifecyclePhases(); |
| 135 GraphicsContext context(&rootDisplayItemList()); | 145 GraphicsContext context(&rootDisplayItemList()); |
| 136 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 4
00, 300), GlobalPaintNormalPhase, LayoutSize()); | 146 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 4
00, 300), GlobalPaintNormalPhase, LayoutSize()); |
| 137 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); | 147 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info, PaintLayerPaintingCompositingAllPhases); |
| 138 rootDisplayItemList().commitNewDisplayItems(); | 148 rootDisplayItemList().commitNewDisplayItems(); |
| 139 | 149 |
| 140 // Container1 is fully in the interest rect; | 150 // Container1 is fully in the interest rect; |
| 141 // Container2 is partly (including its stacking chidren) in the interest rec
t; | 151 // Container2 is partly (including its stacking chidren) in the interest rec
t; |
| 142 // Content2 is out of the interest rect and output nothing; | 152 // Content2b is out of the interest rect and output nothing; |
| 143 // Container3 is fully in the interest rect. | 153 // Container3 is partly in the interest rect. |
| 144 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 14, | 154 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 17, |
| 145 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 155 TestDisplayItem(layoutView(), backgroundType), |
| 146 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 156 TestDisplayItem(rootLayer, subsequenceType), |
| 147 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 157 TestDisplayItem(htmlLayer, subsequenceType), |
| 148 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 158 TestDisplayItem(container1, backgroundType), |
| 149 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 159 TestDisplayItem(container1Layer, subsequenceType), |
| 150 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 160 TestDisplayItem(content1, backgroundType), |
| 151 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 161 TestDisplayItem(container1Layer, endSubsequenceType), |
| 152 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 162 TestDisplayItem(container2, backgroundType), |
| 153 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 163 TestDisplayItem(container2Layer, subsequenceType), |
| 154 TestDisplayItem(container3Layer, DisplayItem::BeginSubsequence), | 164 TestDisplayItem(content2a, backgroundType), |
| 155 TestDisplayItem(container3, DisplayItem::BoxDecorationBackground), | 165 TestDisplayItem(container2Layer, endSubsequenceType), |
| 156 TestDisplayItem(container3Layer, DisplayItem::EndSubsequence), | 166 TestDisplayItem(container3, backgroundType), |
| 157 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 167 TestDisplayItem(container3Layer, subsequenceType), |
| 158 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 168 TestDisplayItem(content3, backgroundType), |
| 169 TestDisplayItem(container3Layer, endSubsequenceType), |
| 170 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 171 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 159 | 172 |
| 160 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce | 173 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce |
| 161 // because it was fully painted before; | 174 // because it was fully painted before; |
| 162 // Container2's intersection with the interest rect changes; | 175 // Container2's intersection with the interest rect changes; |
| 163 // Content2 is out of the interest rect and outputs nothing; | 176 // Content2b is out of the interest rect and outputs nothing; |
| 164 // Container3 becomes out of the interest rect and outputs nothing. | 177 // Container3 becomes out of the interest rect and outputs nothing. |
| 165 DeprecatedPaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 100
, 300, 300), GlobalPaintNormalPhase, LayoutSize()); | 178 DeprecatedPaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 100
, 300, 300), GlobalPaintNormalPhase, LayoutSize()); |
| 166 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info1, PaintLayerPaintingCompositingAllPhases); | 179 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting
Info1, PaintLayerPaintingCompositingAllPhases); |
| 167 | 180 |
| 168 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 9, | 181 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, |
| 169 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 182 TestDisplayItem(layoutView(), cachedBackgroundType), |
| 170 TestDisplayItem(layoutView(), DisplayItem::drawingTypeToCachedDrawingTyp
e(DisplayItem::BoxDecorationBackground)), | 183 TestDisplayItem(rootLayer, subsequenceType), |
| 171 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 184 TestDisplayItem(htmlLayer, subsequenceType), |
| 172 TestDisplayItem(container1Layer, DisplayItem::CachedSubsequence), | 185 TestDisplayItem(container1, cachedBackgroundType), |
| 173 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 186 TestDisplayItem(container1Layer, cachedSubsequenceType), |
| 174 TestDisplayItem(container2, DisplayItem::drawingTypeToCachedDrawingType(
DisplayItem::BoxDecorationBackground)), | 187 TestDisplayItem(container2, cachedBackgroundType), |
| 175 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 188 TestDisplayItem(container2Layer, subsequenceType), |
| 176 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 189 TestDisplayItem(content2a, cachedBackgroundType), |
| 177 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 190 TestDisplayItem(container2Layer, endSubsequenceType), |
| 191 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 192 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 178 | 193 |
| 179 rootDisplayItemList().commitNewDisplayItems(); | 194 rootDisplayItemList().commitNewDisplayItems(); |
| 180 | 195 |
| 181 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11, | 196 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 182 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 197 TestDisplayItem(layoutView(), backgroundType), |
| 183 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 198 TestDisplayItem(rootLayer, subsequenceType), |
| 184 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 199 TestDisplayItem(htmlLayer, subsequenceType), |
| 185 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 200 TestDisplayItem(container1, backgroundType), |
| 186 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 201 TestDisplayItem(container1Layer, subsequenceType), |
| 187 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 202 TestDisplayItem(content1, backgroundType), |
| 188 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 203 TestDisplayItem(container1Layer, endSubsequenceType), |
| 189 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 204 TestDisplayItem(container2, backgroundType), |
| 190 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 205 TestDisplayItem(container2Layer, subsequenceType), |
| 191 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 206 TestDisplayItem(content2a, backgroundType), |
| 192 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 207 TestDisplayItem(container2Layer, endSubsequenceType), |
| 208 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 209 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 193 } | 210 } |
| 194 | 211 |
| 195 TEST_F(DeprecatedPaintLayerPainterTestForSlimmingPaintV2, CachedSubsequence) | 212 TEST_F(DeprecatedPaintLayerPainterTestForSlimmingPaintV2, CachedSubsequence) |
| 196 { | 213 { |
| 197 setBodyInnerHTML( | 214 setBodyInnerHTML( |
| 198 "<div id='container1' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" | 215 "<div id='container1' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 199 " <div id='content1' style='width: 100px; height: 100px; background-col
or: red'></div>" | 216 " <div id='content1' style='position: absolute; width: 100px; height: 1
00px; background-color: red'></div>" |
| 200 "</div>" | 217 "</div>" |
| 201 "<div id='container2' style='position: relative; width: 200px; height: 2
00px; background-color: blue'>" | 218 "<div id='container2' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 202 " <div id='content2' style='width: 100px; height: 100px; background-col
or: green'></div>" | 219 " <div id='content2' style='position: absolute; width: 100px; height: 1
00px; background-color: green'></div>" |
| 203 "</div>"); | 220 "</div>"); |
| 204 document().view()->updateAllLifecyclePhases(); | 221 document().view()->updateAllLifecyclePhases(); |
| 205 | 222 |
| 206 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); | 223 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
| 207 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); | 224 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); |
| 208 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); | 225 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); |
| 209 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); | 226 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); |
| 210 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); | 227 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); |
| 211 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); | 228 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); |
| 212 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); | 229 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); |
| 213 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec
t(); | 230 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec
t(); |
| 214 | 231 |
| 215 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, | 232 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 216 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 233 TestDisplayItem(layoutView(), backgroundType), |
| 217 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 234 TestDisplayItem(rootLayer, subsequenceType), |
| 218 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 235 TestDisplayItem(htmlLayer, subsequenceType), |
| 219 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 236 TestDisplayItem(container1, backgroundType), |
| 220 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 237 TestDisplayItem(container1Layer, subsequenceType), |
| 221 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 238 TestDisplayItem(content1, backgroundType), |
| 222 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 239 TestDisplayItem(container1Layer, endSubsequenceType), |
| 223 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 240 TestDisplayItem(container2, backgroundType), |
| 224 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 241 TestDisplayItem(container2Layer, subsequenceType), |
| 225 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 242 TestDisplayItem(content2, backgroundType), |
| 226 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 243 TestDisplayItem(container2Layer, endSubsequenceType), |
| 227 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 244 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 228 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 245 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 229 | 246 |
| 230 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "width: 1
00px; height: 100px; background-color: green"); | 247 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position
: absolute; width: 100px; height: 100px; background-color: green"); |
| 231 updateLifecyclePhasesToPaintClean(LayoutRect::infiniteRect()); | 248 updateLifecyclePhasesToPaintClean(LayoutRect::infiniteRect()); |
| 232 | 249 |
| 233 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 10, | 250 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, |
| 234 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 251 TestDisplayItem(layoutView(), cachedBackgroundType), |
| 235 TestDisplayItem(layoutView(), DisplayItem::drawingTypeToCachedDrawingTyp
e(DisplayItem::BoxDecorationBackground)), | 252 TestDisplayItem(rootLayer, subsequenceType), |
| 236 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 253 TestDisplayItem(htmlLayer, subsequenceType), |
| 237 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 254 TestDisplayItem(container1, cachedBackgroundType), |
| 238 TestDisplayItem(container1, DisplayItem::drawingTypeToCachedDrawingType(
DisplayItem::BoxDecorationBackground)), | 255 TestDisplayItem(container1Layer, subsequenceType), |
| 239 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 256 TestDisplayItem(content1, backgroundType), |
| 240 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 257 TestDisplayItem(container1Layer, endSubsequenceType), |
| 241 TestDisplayItem(container2Layer, DisplayItem::CachedSubsequence), | 258 TestDisplayItem(container2, cachedBackgroundType), |
| 242 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 259 TestDisplayItem(container2Layer, cachedSubsequenceType), |
| 243 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 260 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 261 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 244 | 262 |
| 245 compositeForSlimmingPaintV2(); | 263 compositeForSlimmingPaintV2(); |
| 246 | 264 |
| 247 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, | 265 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 248 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 266 TestDisplayItem(layoutView(), backgroundType), |
| 249 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 267 TestDisplayItem(rootLayer, subsequenceType), |
| 250 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 268 TestDisplayItem(htmlLayer, subsequenceType), |
| 251 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 269 TestDisplayItem(container1, backgroundType), |
| 252 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 270 TestDisplayItem(container1Layer, subsequenceType), |
| 253 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 271 TestDisplayItem(content1, backgroundType), |
| 254 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 272 TestDisplayItem(container1Layer, endSubsequenceType), |
| 255 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 273 TestDisplayItem(container2, backgroundType), |
| 256 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 274 TestDisplayItem(container2Layer, subsequenceType), |
| 257 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 275 TestDisplayItem(content2, backgroundType), |
| 258 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 276 TestDisplayItem(container2Layer, endSubsequenceType), |
| 259 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 277 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 260 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 278 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 261 | 279 |
| 262 // Repeated painting should just generate the root cached subsequence. | 280 // Repeated painting should just generate the root cached subsequence. |
| 263 setNeedsDisplayWithoutInvalidationForRoot(); | 281 setNeedsDisplayWithoutInvalidationForRoot(); |
| 264 updateLifecyclePhasesToPaintClean(); | 282 updateLifecyclePhasesToPaintClean(); |
| 265 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 1, | 283 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 2, |
| 266 TestDisplayItem(rootLayer, DisplayItem::CachedSubsequence)); | 284 TestDisplayItem(layoutView(), cachedBackgroundType), |
| 285 TestDisplayItem(rootLayer, cachedSubsequenceType)); |
| 267 | 286 |
| 268 compositeForSlimmingPaintV2(); | 287 compositeForSlimmingPaintV2(); |
| 269 | 288 |
| 270 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, | 289 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 271 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 290 TestDisplayItem(layoutView(), backgroundType), |
| 272 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 291 TestDisplayItem(rootLayer, subsequenceType), |
| 273 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 292 TestDisplayItem(htmlLayer, subsequenceType), |
| 274 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 293 TestDisplayItem(container1, backgroundType), |
| 275 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 294 TestDisplayItem(container1Layer, subsequenceType), |
| 276 TestDisplayItem(content1, DisplayItem::BoxDecorationBackground), | 295 TestDisplayItem(content1, backgroundType), |
| 277 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 296 TestDisplayItem(container1Layer, endSubsequenceType), |
| 278 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 297 TestDisplayItem(container2, backgroundType), |
| 279 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 298 TestDisplayItem(container2Layer, subsequenceType), |
| 280 TestDisplayItem(content2, DisplayItem::BoxDecorationBackground), | 299 TestDisplayItem(content2, backgroundType), |
| 281 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 300 TestDisplayItem(container2Layer, endSubsequenceType), |
| 282 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 301 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 283 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 302 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 284 } | 303 } |
| 285 | 304 |
| 286 TEST_F(DeprecatedPaintLayerPainterTestForSlimmingPaintV2, CachedSubsequenceOnInt
erestRectChange) | 305 TEST_F(DeprecatedPaintLayerPainterTestForSlimmingPaintV2, CachedSubsequenceOnInt
erestRectChange) |
| 287 { | 306 { |
| 288 setBodyInnerHTML( | 307 setBodyInnerHTML( |
| 289 "<div id='container1' style='position: relative; width: 200px; height: 2
00px; background-color: blue'></div>" | 308 "<div id='container1' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 290 "<div id='container2' style='position: absolute; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" | 309 " <div id='content1' style='position: absolute; width: 100px; height: 1
00px; background-color: green'></div>" |
| 291 " <div id='content2' style='position: relative; top: 200px; width: 100p
x; height: 100px; background-color: green'></div>" | |
| 292 "</div>" | 310 "</div>" |
| 293 "<div id='container3' style='position: absolute; z-index: 2; left: 300px
; top: 0; width: 200px; height: 200px; background-color: blue'></div>"); | 311 "<div id='container2' style='position: relative; z-index: 1; width: 200p
x; height: 200px; background-color: blue'>" |
| 312 " <div id='content2a' style='position: absolute; width: 100px; height:
100px; background-color: green'></div>" |
| 313 " <div id='content2b' style='position: absolute; top: 200px; width: 100
px; height: 100px; background-color: green'></div>" |
| 314 "</div>" |
| 315 "<div id='container3' style='position: absolute; z-index: 2; left: 300px
; top: 0; width: 200px; height: 200px; background-color: blue'>" |
| 316 " <div id='content3' style='position: absolute; width: 200px; height: 2
00px; background-color: green'></div>" |
| 317 "</div>"); |
| 294 setNeedsDisplayForRoot(); | 318 setNeedsDisplayForRoot(); |
| 295 | 319 |
| 296 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); | 320 DeprecatedPaintLayer& rootLayer = *layoutView().layer(); |
| 297 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); | 321 DeprecatedPaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documen
tElement()->layoutObject())->layer(); |
| 298 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); | 322 LayoutObject& container1 = *document().getElementById("container1")->layoutO
bject(); |
| 299 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); | 323 DeprecatedPaintLayer& container1Layer = *toLayoutBoxModelObject(container1).
layer(); |
| 324 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec
t(); |
| 300 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); | 325 LayoutObject& container2 = *document().getElementById("container2")->layoutO
bject(); |
| 301 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); | 326 DeprecatedPaintLayer& container2Layer = *toLayoutBoxModelObject(container2).
layer(); |
| 327 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj
ect(); |
| 302 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); | 328 LayoutObject& container3 = *document().getElementById("container3")->layoutO
bject(); |
| 303 DeprecatedPaintLayer& container3Layer = *toLayoutBoxModelObject(container3).
layer(); | 329 DeprecatedPaintLayer& container3Layer = *toLayoutBoxModelObject(container3).
layer(); |
| 330 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec
t(); |
| 304 | 331 |
| 305 document().view()->updateAllLifecyclePhases(LayoutRect(0, 0, 400, 300)); | 332 document().view()->updateAllLifecyclePhases(LayoutRect(0, 0, 400, 300)); |
| 306 | 333 |
| 307 // Container1 is fully in the interest rect; | 334 // Container1 is fully in the interest rect; |
| 308 // Container2 is partly (including its stacking chidren) in the interest rec
t; | 335 // Container2 is partly (including its stacking chidren) in the interest rec
t; |
| 309 // Content2 is out of the interest rect and output nothing; | 336 // Content2b is out of the interest rect and output nothing; |
| 310 // Container3 is fully in the interest rect. | 337 // Container3 is partly in the interest rect. |
| 311 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 14, | 338 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 17, |
| 312 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 339 TestDisplayItem(layoutView(), backgroundType), |
| 313 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 340 TestDisplayItem(rootLayer, subsequenceType), |
| 314 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 341 TestDisplayItem(htmlLayer, subsequenceType), |
| 315 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 342 TestDisplayItem(container1, backgroundType), |
| 316 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 343 TestDisplayItem(container1Layer, subsequenceType), |
| 317 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 344 TestDisplayItem(content1, backgroundType), |
| 318 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 345 TestDisplayItem(container1Layer, endSubsequenceType), |
| 319 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 346 TestDisplayItem(container2, backgroundType), |
| 320 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 347 TestDisplayItem(container2Layer, subsequenceType), |
| 321 TestDisplayItem(container3Layer, DisplayItem::BeginSubsequence), | 348 TestDisplayItem(content2a, backgroundType), |
| 322 TestDisplayItem(container3, DisplayItem::BoxDecorationBackground), | 349 TestDisplayItem(container2Layer, endSubsequenceType), |
| 323 TestDisplayItem(container3Layer, DisplayItem::EndSubsequence), | 350 TestDisplayItem(container3, backgroundType), |
| 324 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 351 TestDisplayItem(container3Layer, subsequenceType), |
| 325 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 352 TestDisplayItem(content3, backgroundType), |
| 353 TestDisplayItem(container3Layer, endSubsequenceType), |
| 354 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 355 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 326 | 356 |
| 327 setNeedsDisplayWithoutInvalidationForRoot(); | 357 setNeedsDisplayWithoutInvalidationForRoot(); |
| 328 | 358 |
| 329 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce | 359 // Container1 becomes partly in the interest rect, but uses cached subsequen
ce |
| 330 // because it was fully painted before; | 360 // because it was fully painted before; |
| 331 // Container2's intersection with the interest rect changes; | 361 // Container2's intersection with the interest rect changes; |
| 332 // Content2 is out of the interest rect and outputs nothing; | 362 // Content2b is out of the interest rect and outputs nothing; |
| 333 // Container3 becomes out of the interest rect and outputs nothing. | 363 // Container3 becomes out of the interest rect and outputs nothing. |
| 334 updateLifecyclePhasesToPaintClean(LayoutRect(0, 100, 300, 300)); | 364 updateLifecyclePhasesToPaintClean(LayoutRect(0, 100, 300, 300)); |
| 335 | 365 |
| 336 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 9, | 366 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, |
| 337 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 367 TestDisplayItem(layoutView(), cachedBackgroundType), |
| 338 TestDisplayItem(layoutView(), DisplayItem::drawingTypeToCachedDrawingTyp
e(DisplayItem::BoxDecorationBackground)), | 368 TestDisplayItem(rootLayer, subsequenceType), |
| 339 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 369 TestDisplayItem(htmlLayer, subsequenceType), |
| 340 TestDisplayItem(container1Layer, DisplayItem::CachedSubsequence), | 370 TestDisplayItem(container1, cachedBackgroundType), |
| 341 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 371 TestDisplayItem(container1Layer, cachedSubsequenceType), |
| 342 TestDisplayItem(container2, DisplayItem::drawingTypeToCachedDrawingType(
DisplayItem::BoxDecorationBackground)), | 372 TestDisplayItem(container2, cachedBackgroundType), |
| 343 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 373 TestDisplayItem(container2Layer, subsequenceType), |
| 344 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 374 TestDisplayItem(content2a, cachedBackgroundType), |
| 345 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 375 TestDisplayItem(container2Layer, endSubsequenceType), |
| 376 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 377 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 346 | 378 |
| 347 compositeForSlimmingPaintV2(); | 379 compositeForSlimmingPaintV2(); |
| 348 | 380 |
| 349 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11, | 381 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, |
| 350 TestDisplayItem(rootLayer, DisplayItem::BeginSubsequence), | 382 TestDisplayItem(layoutView(), backgroundType), |
| 351 TestDisplayItem(layoutView(), DisplayItem::BoxDecorationBackground), | 383 TestDisplayItem(rootLayer, subsequenceType), |
| 352 TestDisplayItem(htmlLayer, DisplayItem::BeginSubsequence), | 384 TestDisplayItem(htmlLayer, subsequenceType), |
| 353 TestDisplayItem(container1Layer, DisplayItem::BeginSubsequence), | 385 TestDisplayItem(container1, backgroundType), |
| 354 TestDisplayItem(container1, DisplayItem::BoxDecorationBackground), | 386 TestDisplayItem(container1Layer, subsequenceType), |
| 355 TestDisplayItem(container1Layer, DisplayItem::EndSubsequence), | 387 TestDisplayItem(content1, backgroundType), |
| 356 TestDisplayItem(container2Layer, DisplayItem::BeginSubsequence), | 388 TestDisplayItem(container1Layer, endSubsequenceType), |
| 357 TestDisplayItem(container2, DisplayItem::BoxDecorationBackground), | 389 TestDisplayItem(container2, backgroundType), |
| 358 TestDisplayItem(container2Layer, DisplayItem::EndSubsequence), | 390 TestDisplayItem(container2Layer, subsequenceType), |
| 359 TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence), | 391 TestDisplayItem(content2a, backgroundType), |
| 360 TestDisplayItem(rootLayer, DisplayItem::EndSubsequence)); | 392 TestDisplayItem(container2Layer, endSubsequenceType), |
| 393 TestDisplayItem(htmlLayer, endSubsequenceType), |
| 394 TestDisplayItem(rootLayer, endSubsequenceType)); |
| 361 } | 395 } |
| 362 | 396 |
| 363 } // namespace blink | 397 } // namespace blink |
| OLD | NEW |