Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp

Issue 1401363003: Rename DisplayItemList to PaintController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/PaintControllerPaintTest.h"
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 class PaintLayerPainterTest 12 class PaintLayerPainterTest
13 : public DisplayItemListPaintTest 13 : public PaintControllerPaintTest
14 , public testing::WithParamInterface<FrameSettingOverrideFunction> { 14 , public testing::WithParamInterface<FrameSettingOverrideFunction> {
15 WTF_MAKE_FAST_ALLOCATED(PaintLayerPainterTest); 15 WTF_MAKE_FAST_ALLOCATED(PaintLayerPainterTest);
16 public: 16 public:
17 FrameSettingOverrideFunction settingOverrider() const override { return GetP aram(); } 17 FrameSettingOverrideFunction settingOverrider() const override { return GetP aram(); }
18 }; 18 };
19 19
20 using PaintLayerPainterTestForSlimmingPaintV2 = DisplayItemListPaintTestForSlimm ingPaintV2; 20 using PaintLayerPainterTestForSlimmingPaintV2 = PaintControllerPaintTestForSlimm ingPaintV2;
21 21
22 INSTANTIATE_TEST_CASE_P(All, PaintLayerPainterTest, ::testing::Values( 22 INSTANTIATE_TEST_CASE_P(All, PaintLayerPainterTest, ::testing::Values(
23 nullptr, 23 nullptr,
24 RootLayerScrollsFrameSettingOverride)); 24 RootLayerScrollsFrameSettingOverride));
25 25
26 TEST_P(PaintLayerPainterTest, CachedSubsequence) 26 TEST_P(PaintLayerPainterTest, CachedSubsequence)
27 { 27 {
28 RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true); 28 RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true);
29 29
30 setBodyInnerHTML( 30 setBodyInnerHTML(
31 "<div id='container1' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>" 31 "<div id='container1' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>"
32 " <div id='content1' style='position: absolute; width: 100px; height: 1 00px; background-color: red'></div>" 32 " <div id='content1' style='position: absolute; width: 100px; height: 1 00px; background-color: red'></div>"
33 "</div>" 33 "</div>"
34 "<div id='container2' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>" 34 "<div id='container2' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>"
35 " <div id='content2' style='position: absolute; width: 100px; height: 1 00px; background-color: green'></div>" 35 " <div id='content2' style='position: absolute; width: 100px; height: 1 00px; background-color: green'></div>"
36 "</div>"); 36 "</div>");
37 document().view()->updateAllLifecyclePhases(); 37 document().view()->updateAllLifecyclePhases();
38 38
39 bool rootLayerScrolls = document().frame()->settings()->rootLayerScrolls(); 39 bool rootLayerScrolls = document().frame()->settings()->rootLayerScrolls();
40 PaintLayer& rootLayer = *layoutView().layer(); 40 PaintLayer& rootLayer = *layoutView().layer();
41 PaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement() ->layoutObject())->layer(); 41 PaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement() ->layoutObject())->layer();
42 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject(); 42 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject();
43 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); 43 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer();
44 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t(); 44 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t();
45 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject(); 45 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject();
46 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); 46 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer();
47 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec t(); 47 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec t();
48 48
49 GraphicsContext context(&rootDisplayItemList()); 49 GraphicsContext context(&rootPaintController());
50 PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize()); 50 PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
51 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases); 51 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases);
52 rootDisplayItemList().commitNewDisplayItems(); 52 rootPaintController().commitNewDisplayItems();
53 53
54 if (rootLayerScrolls) { 54 if (rootLayerScrolls) {
55 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11, 55 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
56 TestDisplayItem(layoutView(), backgroundType), 56 TestDisplayItem(layoutView(), backgroundType),
57 TestDisplayItem(rootLayer, subsequenceType), 57 TestDisplayItem(rootLayer, subsequenceType),
58 TestDisplayItem(container1, backgroundType), 58 TestDisplayItem(container1, backgroundType),
59 TestDisplayItem(container1Layer, subsequenceType), 59 TestDisplayItem(container1Layer, subsequenceType),
60 TestDisplayItem(content1, backgroundType), 60 TestDisplayItem(content1, backgroundType),
61 TestDisplayItem(container1Layer, endSubsequenceType), 61 TestDisplayItem(container1Layer, endSubsequenceType),
62 TestDisplayItem(container2, backgroundType), 62 TestDisplayItem(container2, backgroundType),
63 TestDisplayItem(container2Layer, subsequenceType), 63 TestDisplayItem(container2Layer, subsequenceType),
64 TestDisplayItem(content2, backgroundType), 64 TestDisplayItem(content2, backgroundType),
65 TestDisplayItem(container2Layer, endSubsequenceType), 65 TestDisplayItem(container2Layer, endSubsequenceType),
66 TestDisplayItem(rootLayer, endSubsequenceType)); 66 TestDisplayItem(rootLayer, endSubsequenceType));
67 } else { 67 } else {
68 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 68 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
69 TestDisplayItem(layoutView(), backgroundType), 69 TestDisplayItem(layoutView(), backgroundType),
70 TestDisplayItem(rootLayer, subsequenceType), 70 TestDisplayItem(rootLayer, subsequenceType),
71 TestDisplayItem(htmlLayer, subsequenceType), 71 TestDisplayItem(htmlLayer, subsequenceType),
72 TestDisplayItem(container1, backgroundType), 72 TestDisplayItem(container1, backgroundType),
73 TestDisplayItem(container1Layer, subsequenceType), 73 TestDisplayItem(container1Layer, subsequenceType),
74 TestDisplayItem(content1, backgroundType), 74 TestDisplayItem(content1, backgroundType),
75 TestDisplayItem(container1Layer, endSubsequenceType), 75 TestDisplayItem(container1Layer, endSubsequenceType),
76 TestDisplayItem(container2, backgroundType), 76 TestDisplayItem(container2, backgroundType),
77 TestDisplayItem(container2Layer, subsequenceType), 77 TestDisplayItem(container2Layer, subsequenceType),
78 TestDisplayItem(content2, backgroundType), 78 TestDisplayItem(content2, backgroundType),
79 TestDisplayItem(container2Layer, endSubsequenceType), 79 TestDisplayItem(container2Layer, endSubsequenceType),
80 TestDisplayItem(htmlLayer, endSubsequenceType), 80 TestDisplayItem(htmlLayer, endSubsequenceType),
81 TestDisplayItem(rootLayer, endSubsequenceType)); 81 TestDisplayItem(rootLayer, endSubsequenceType));
82 } 82 }
83 83
84 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position : absolute; width: 100px; height: 100px; background-color: green"); 84 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position : absolute; width: 100px; height: 100px; background-color: green");
85 document().view()->updateAllLifecyclePhases(); 85 document().view()->updateAllLifecyclePhases();
86 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases); 86 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases);
87 87
88 if (rootLayerScrolls) { 88 if (rootLayerScrolls) {
89 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 9, 89 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 9,
90 TestDisplayItem(layoutView(), cachedBackgroundType), 90 TestDisplayItem(layoutView(), cachedBackgroundType),
91 TestDisplayItem(rootLayer, subsequenceType), 91 TestDisplayItem(rootLayer, subsequenceType),
92 TestDisplayItem(container1, cachedBackgroundType), 92 TestDisplayItem(container1, cachedBackgroundType),
93 TestDisplayItem(container1Layer, subsequenceType), 93 TestDisplayItem(container1Layer, subsequenceType),
94 TestDisplayItem(content1, backgroundType), 94 TestDisplayItem(content1, backgroundType),
95 TestDisplayItem(container1Layer, endSubsequenceType), 95 TestDisplayItem(container1Layer, endSubsequenceType),
96 TestDisplayItem(container2, cachedBackgroundType), 96 TestDisplayItem(container2, cachedBackgroundType),
97 TestDisplayItem(container2Layer, cachedSubsequenceType), 97 TestDisplayItem(container2Layer, cachedSubsequenceType),
98 TestDisplayItem(rootLayer, endSubsequenceType)); 98 TestDisplayItem(rootLayer, endSubsequenceType));
99 } else { 99 } else {
100 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, 100 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
101 TestDisplayItem(layoutView(), cachedBackgroundType), 101 TestDisplayItem(layoutView(), cachedBackgroundType),
102 TestDisplayItem(rootLayer, subsequenceType), 102 TestDisplayItem(rootLayer, subsequenceType),
103 TestDisplayItem(htmlLayer, subsequenceType), 103 TestDisplayItem(htmlLayer, subsequenceType),
104 TestDisplayItem(container1, cachedBackgroundType), 104 TestDisplayItem(container1, cachedBackgroundType),
105 TestDisplayItem(container1Layer, subsequenceType), 105 TestDisplayItem(container1Layer, subsequenceType),
106 TestDisplayItem(content1, backgroundType), 106 TestDisplayItem(content1, backgroundType),
107 TestDisplayItem(container1Layer, endSubsequenceType), 107 TestDisplayItem(container1Layer, endSubsequenceType),
108 TestDisplayItem(container2, cachedBackgroundType), 108 TestDisplayItem(container2, cachedBackgroundType),
109 TestDisplayItem(container2Layer, cachedSubsequenceType), 109 TestDisplayItem(container2Layer, cachedSubsequenceType),
110 TestDisplayItem(htmlLayer, endSubsequenceType), 110 TestDisplayItem(htmlLayer, endSubsequenceType),
111 TestDisplayItem(rootLayer, endSubsequenceType)); 111 TestDisplayItem(rootLayer, endSubsequenceType));
112 } 112 }
113 113
114 rootDisplayItemList().commitNewDisplayItems(); 114 rootPaintController().commitNewDisplayItems();
115 115
116 if (rootLayerScrolls) { 116 if (rootLayerScrolls) {
117 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11, 117 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
118 TestDisplayItem(layoutView(), backgroundType), 118 TestDisplayItem(layoutView(), backgroundType),
119 TestDisplayItem(rootLayer, subsequenceType), 119 TestDisplayItem(rootLayer, subsequenceType),
120 TestDisplayItem(container1, backgroundType), 120 TestDisplayItem(container1, backgroundType),
121 TestDisplayItem(container1Layer, subsequenceType), 121 TestDisplayItem(container1Layer, subsequenceType),
122 TestDisplayItem(content1, backgroundType), 122 TestDisplayItem(content1, backgroundType),
123 TestDisplayItem(container1Layer, endSubsequenceType), 123 TestDisplayItem(container1Layer, endSubsequenceType),
124 TestDisplayItem(container2, backgroundType), 124 TestDisplayItem(container2, backgroundType),
125 TestDisplayItem(container2Layer, subsequenceType), 125 TestDisplayItem(container2Layer, subsequenceType),
126 TestDisplayItem(content2, backgroundType), 126 TestDisplayItem(content2, backgroundType),
127 TestDisplayItem(container2Layer, endSubsequenceType), 127 TestDisplayItem(container2Layer, endSubsequenceType),
128 TestDisplayItem(rootLayer, endSubsequenceType)); 128 TestDisplayItem(rootLayer, endSubsequenceType));
129 } else { 129 } else {
130 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 130 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
131 TestDisplayItem(layoutView(), backgroundType), 131 TestDisplayItem(layoutView(), backgroundType),
132 TestDisplayItem(rootLayer, subsequenceType), 132 TestDisplayItem(rootLayer, subsequenceType),
133 TestDisplayItem(htmlLayer, subsequenceType), 133 TestDisplayItem(htmlLayer, subsequenceType),
134 TestDisplayItem(container1, backgroundType), 134 TestDisplayItem(container1, backgroundType),
135 TestDisplayItem(container1Layer, subsequenceType), 135 TestDisplayItem(container1Layer, subsequenceType),
136 TestDisplayItem(content1, backgroundType), 136 TestDisplayItem(content1, backgroundType),
137 TestDisplayItem(container1Layer, endSubsequenceType), 137 TestDisplayItem(container1Layer, endSubsequenceType),
138 TestDisplayItem(container2, backgroundType), 138 TestDisplayItem(container2, backgroundType),
139 TestDisplayItem(container2Layer, subsequenceType), 139 TestDisplayItem(container2Layer, subsequenceType),
140 TestDisplayItem(content2, backgroundType), 140 TestDisplayItem(content2, backgroundType),
141 TestDisplayItem(container2Layer, endSubsequenceType), 141 TestDisplayItem(container2Layer, endSubsequenceType),
142 TestDisplayItem(htmlLayer, endSubsequenceType), 142 TestDisplayItem(htmlLayer, endSubsequenceType),
143 TestDisplayItem(rootLayer, endSubsequenceType)); 143 TestDisplayItem(rootLayer, endSubsequenceType));
144 } 144 }
145 145
146 // Repeated painting should just generate the root cached subsequence. 146 // Repeated painting should just generate the root cached subsequence.
147 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases); 147 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases);
148 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 2, 148 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 2,
149 TestDisplayItem(layoutView(), cachedBackgroundType), 149 TestDisplayItem(layoutView(), cachedBackgroundType),
150 TestDisplayItem(rootLayer, cachedSubsequenceType)); 150 TestDisplayItem(rootLayer, cachedSubsequenceType));
151 151
152 rootDisplayItemList().commitNewDisplayItems(); 152 rootPaintController().commitNewDisplayItems();
153 153
154 if (rootLayerScrolls) { 154 if (rootLayerScrolls) {
155 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11, 155 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
156 TestDisplayItem(layoutView(), backgroundType), 156 TestDisplayItem(layoutView(), backgroundType),
157 TestDisplayItem(rootLayer, subsequenceType), 157 TestDisplayItem(rootLayer, subsequenceType),
158 TestDisplayItem(container1, backgroundType), 158 TestDisplayItem(container1, backgroundType),
159 TestDisplayItem(container1Layer, subsequenceType), 159 TestDisplayItem(container1Layer, subsequenceType),
160 TestDisplayItem(content1, backgroundType), 160 TestDisplayItem(content1, backgroundType),
161 TestDisplayItem(container1Layer, endSubsequenceType), 161 TestDisplayItem(container1Layer, endSubsequenceType),
162 TestDisplayItem(container2, backgroundType), 162 TestDisplayItem(container2, backgroundType),
163 TestDisplayItem(container2Layer, subsequenceType), 163 TestDisplayItem(container2Layer, subsequenceType),
164 TestDisplayItem(content2, backgroundType), 164 TestDisplayItem(content2, backgroundType),
165 TestDisplayItem(container2Layer, endSubsequenceType), 165 TestDisplayItem(container2Layer, endSubsequenceType),
166 TestDisplayItem(rootLayer, endSubsequenceType)); 166 TestDisplayItem(rootLayer, endSubsequenceType));
167 } else { 167 } else {
168 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 168 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
169 TestDisplayItem(layoutView(), backgroundType), 169 TestDisplayItem(layoutView(), backgroundType),
170 TestDisplayItem(rootLayer, subsequenceType), 170 TestDisplayItem(rootLayer, subsequenceType),
171 TestDisplayItem(htmlLayer, subsequenceType), 171 TestDisplayItem(htmlLayer, subsequenceType),
172 TestDisplayItem(container1, backgroundType), 172 TestDisplayItem(container1, backgroundType),
173 TestDisplayItem(container1Layer, subsequenceType), 173 TestDisplayItem(container1Layer, subsequenceType),
174 TestDisplayItem(content1, backgroundType), 174 TestDisplayItem(content1, backgroundType),
175 TestDisplayItem(container1Layer, endSubsequenceType), 175 TestDisplayItem(container1Layer, endSubsequenceType),
176 TestDisplayItem(container2, backgroundType), 176 TestDisplayItem(container2, backgroundType),
177 TestDisplayItem(container2Layer, subsequenceType), 177 TestDisplayItem(container2Layer, subsequenceType),
178 TestDisplayItem(content2, backgroundType), 178 TestDisplayItem(content2, backgroundType),
(...skipping 11 matching lines...) Expand all
190 "<div id='container1' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>" 190 "<div id='container1' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>"
191 " <div id='content1' style='position: absolute; width: 100px; height: 1 00px; background-color: green'></div>" 191 " <div id='content1' style='position: absolute; width: 100px; height: 1 00px; background-color: green'></div>"
192 "</div>" 192 "</div>"
193 "<div id='container2' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>" 193 "<div id='container2' style='position: relative; z-index: 1; width: 200p x; height: 200px; background-color: blue'>"
194 " <div id='content2a' style='position: absolute; width: 100px; height: 100px; background-color: green'></div>" 194 " <div id='content2a' style='position: absolute; width: 100px; height: 100px; background-color: green'></div>"
195 " <div id='content2b' style='position: absolute; top: 200px; width: 100 px; height: 100px; background-color: green'></div>" 195 " <div id='content2b' style='position: absolute; top: 200px; width: 100 px; height: 100px; background-color: green'></div>"
196 "</div>" 196 "</div>"
197 "<div id='container3' style='position: absolute; z-index: 2; left: 300px ; top: 0; width: 200px; height: 200px; background-color: blue'>" 197 "<div id='container3' style='position: absolute; z-index: 2; left: 300px ; top: 0; width: 200px; height: 200px; background-color: blue'>"
198 " <div id='content3' style='position: absolute; width: 200px; height: 2 00px; background-color: green'></div>" 198 " <div id='content3' style='position: absolute; width: 200px; height: 2 00px; background-color: green'></div>"
199 "</div>"); 199 "</div>");
200 rootDisplayItemList().invalidateAll(); 200 rootPaintController().invalidateAll();
201 201
202 bool rootLayerScrolls = document().frame()->settings()->rootLayerScrolls(); 202 bool rootLayerScrolls = document().frame()->settings()->rootLayerScrolls();
203 PaintLayer& rootLayer = *layoutView().layer(); 203 PaintLayer& rootLayer = *layoutView().layer();
204 PaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement() ->layoutObject())->layer(); 204 PaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement() ->layoutObject())->layer();
205 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject(); 205 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject();
206 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); 206 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer();
207 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t(); 207 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t();
208 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject(); 208 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject();
209 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); 209 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer();
210 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj ect(); 210 LayoutObject& content2a = *document().getElementById("content2a")->layoutObj ect();
211 LayoutObject& container3 = *document().getElementById("container3")->layoutO bject(); 211 LayoutObject& container3 = *document().getElementById("container3")->layoutO bject();
212 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer(); 212 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer();
213 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec t(); 213 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec t();
214 214
215 document().view()->updateAllLifecyclePhases(); 215 document().view()->updateAllLifecyclePhases();
216 GraphicsContext context(&rootDisplayItemList()); 216 GraphicsContext context(&rootPaintController());
217 PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 400, 300), GlobalPaintNormalPhase, LayoutSize()); 217 PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 400, 300), GlobalPaintNormalPhase, LayoutSize());
218 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases); 218 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, Pain tLayerPaintingCompositingAllPhases);
219 rootDisplayItemList().commitNewDisplayItems(); 219 rootPaintController().commitNewDisplayItems();
220 220
221 // Container1 is fully in the interest rect; 221 // Container1 is fully in the interest rect;
222 // Container2 is partly (including its stacking chidren) in the interest rec t; 222 // Container2 is partly (including its stacking chidren) in the interest rec t;
223 // Content2b is out of the interest rect and output nothing; 223 // Content2b is out of the interest rect and output nothing;
224 // Container3 is partly in the interest rect. 224 // Container3 is partly in the interest rect.
225 if (rootLayerScrolls) { 225 if (rootLayerScrolls) {
226 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 15, 226 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 15,
227 TestDisplayItem(layoutView(), backgroundType), 227 TestDisplayItem(layoutView(), backgroundType),
228 TestDisplayItem(rootLayer, subsequenceType), 228 TestDisplayItem(rootLayer, subsequenceType),
229 TestDisplayItem(container1, backgroundType), 229 TestDisplayItem(container1, backgroundType),
230 TestDisplayItem(container1Layer, subsequenceType), 230 TestDisplayItem(container1Layer, subsequenceType),
231 TestDisplayItem(content1, backgroundType), 231 TestDisplayItem(content1, backgroundType),
232 TestDisplayItem(container1Layer, endSubsequenceType), 232 TestDisplayItem(container1Layer, endSubsequenceType),
233 TestDisplayItem(container2, backgroundType), 233 TestDisplayItem(container2, backgroundType),
234 TestDisplayItem(container2Layer, subsequenceType), 234 TestDisplayItem(container2Layer, subsequenceType),
235 TestDisplayItem(content2a, backgroundType), 235 TestDisplayItem(content2a, backgroundType),
236 TestDisplayItem(container2Layer, endSubsequenceType), 236 TestDisplayItem(container2Layer, endSubsequenceType),
237 TestDisplayItem(container3, backgroundType), 237 TestDisplayItem(container3, backgroundType),
238 TestDisplayItem(container3Layer, subsequenceType), 238 TestDisplayItem(container3Layer, subsequenceType),
239 TestDisplayItem(content3, backgroundType), 239 TestDisplayItem(content3, backgroundType),
240 TestDisplayItem(container3Layer, endSubsequenceType), 240 TestDisplayItem(container3Layer, endSubsequenceType),
241 TestDisplayItem(rootLayer, endSubsequenceType)); 241 TestDisplayItem(rootLayer, endSubsequenceType));
242 } else { 242 } else {
243 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 17, 243 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 17,
244 TestDisplayItem(layoutView(), backgroundType), 244 TestDisplayItem(layoutView(), backgroundType),
245 TestDisplayItem(rootLayer, subsequenceType), 245 TestDisplayItem(rootLayer, subsequenceType),
246 TestDisplayItem(htmlLayer, subsequenceType), 246 TestDisplayItem(htmlLayer, subsequenceType),
247 TestDisplayItem(container1, backgroundType), 247 TestDisplayItem(container1, backgroundType),
248 TestDisplayItem(container1Layer, subsequenceType), 248 TestDisplayItem(container1Layer, subsequenceType),
249 TestDisplayItem(content1, backgroundType), 249 TestDisplayItem(content1, backgroundType),
250 TestDisplayItem(container1Layer, endSubsequenceType), 250 TestDisplayItem(container1Layer, endSubsequenceType),
251 TestDisplayItem(container2, backgroundType), 251 TestDisplayItem(container2, backgroundType),
252 TestDisplayItem(container2Layer, subsequenceType), 252 TestDisplayItem(container2Layer, subsequenceType),
253 TestDisplayItem(content2a, backgroundType), 253 TestDisplayItem(content2a, backgroundType),
254 TestDisplayItem(container2Layer, endSubsequenceType), 254 TestDisplayItem(container2Layer, endSubsequenceType),
255 TestDisplayItem(container3, backgroundType), 255 TestDisplayItem(container3, backgroundType),
256 TestDisplayItem(container3Layer, subsequenceType), 256 TestDisplayItem(container3Layer, subsequenceType),
257 TestDisplayItem(content3, backgroundType), 257 TestDisplayItem(content3, backgroundType),
258 TestDisplayItem(container3Layer, endSubsequenceType), 258 TestDisplayItem(container3Layer, endSubsequenceType),
259 TestDisplayItem(htmlLayer, endSubsequenceType), 259 TestDisplayItem(htmlLayer, endSubsequenceType),
260 TestDisplayItem(rootLayer, endSubsequenceType)); 260 TestDisplayItem(rootLayer, endSubsequenceType));
261 } 261 }
262 262
263 // Container1 becomes partly in the interest rect, but uses cached subsequen ce 263 // Container1 becomes partly in the interest rect, but uses cached subsequen ce
264 // because it was fully painted before; 264 // because it was fully painted before;
265 // Container2's intersection with the interest rect changes; 265 // Container2's intersection with the interest rect changes;
266 // Content2b is out of the interest rect and outputs nothing; 266 // Content2b is out of the interest rect and outputs nothing;
267 // Container3 becomes out of the interest rect and outputs nothing. 267 // Container3 becomes out of the interest rect and outputs nothing.
268 PaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 100, 300, 300 ), GlobalPaintNormalPhase, LayoutSize()); 268 PaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 100, 300, 300 ), GlobalPaintNormalPhase, LayoutSize());
269 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo1, Pai ntLayerPaintingCompositingAllPhases); 269 PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo1, Pai ntLayerPaintingCompositingAllPhases);
270 270
271 if (rootLayerScrolls) { 271 if (rootLayerScrolls) {
272 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 9, 272 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 9,
273 TestDisplayItem(layoutView(), cachedBackgroundType), 273 TestDisplayItem(layoutView(), cachedBackgroundType),
274 TestDisplayItem(rootLayer, subsequenceType), 274 TestDisplayItem(rootLayer, subsequenceType),
275 TestDisplayItem(container1, cachedBackgroundType), 275 TestDisplayItem(container1, cachedBackgroundType),
276 TestDisplayItem(container1Layer, cachedSubsequenceType), 276 TestDisplayItem(container1Layer, cachedSubsequenceType),
277 TestDisplayItem(container2, cachedBackgroundType), 277 TestDisplayItem(container2, cachedBackgroundType),
278 TestDisplayItem(container2Layer, subsequenceType), 278 TestDisplayItem(container2Layer, subsequenceType),
279 TestDisplayItem(content2a, cachedBackgroundType), 279 TestDisplayItem(content2a, cachedBackgroundType),
280 TestDisplayItem(container2Layer, endSubsequenceType), 280 TestDisplayItem(container2Layer, endSubsequenceType),
281 TestDisplayItem(rootLayer, endSubsequenceType)); 281 TestDisplayItem(rootLayer, endSubsequenceType));
282 282
283 } else { 283 } else {
284 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, 284 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
285 TestDisplayItem(layoutView(), cachedBackgroundType), 285 TestDisplayItem(layoutView(), cachedBackgroundType),
286 TestDisplayItem(rootLayer, subsequenceType), 286 TestDisplayItem(rootLayer, subsequenceType),
287 TestDisplayItem(htmlLayer, subsequenceType), 287 TestDisplayItem(htmlLayer, subsequenceType),
288 TestDisplayItem(container1, cachedBackgroundType), 288 TestDisplayItem(container1, cachedBackgroundType),
289 TestDisplayItem(container1Layer, cachedSubsequenceType), 289 TestDisplayItem(container1Layer, cachedSubsequenceType),
290 TestDisplayItem(container2, cachedBackgroundType), 290 TestDisplayItem(container2, cachedBackgroundType),
291 TestDisplayItem(container2Layer, subsequenceType), 291 TestDisplayItem(container2Layer, subsequenceType),
292 TestDisplayItem(content2a, cachedBackgroundType), 292 TestDisplayItem(content2a, cachedBackgroundType),
293 TestDisplayItem(container2Layer, endSubsequenceType), 293 TestDisplayItem(container2Layer, endSubsequenceType),
294 TestDisplayItem(htmlLayer, endSubsequenceType), 294 TestDisplayItem(htmlLayer, endSubsequenceType),
295 TestDisplayItem(rootLayer, endSubsequenceType)); 295 TestDisplayItem(rootLayer, endSubsequenceType));
296 } 296 }
297 297
298 rootDisplayItemList().commitNewDisplayItems(); 298 rootPaintController().commitNewDisplayItems();
299 299
300 if (rootLayerScrolls) { 300 if (rootLayerScrolls) {
301 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11, 301 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
302 TestDisplayItem(layoutView(), backgroundType), 302 TestDisplayItem(layoutView(), backgroundType),
303 TestDisplayItem(rootLayer, subsequenceType), 303 TestDisplayItem(rootLayer, subsequenceType),
304 TestDisplayItem(container1, backgroundType), 304 TestDisplayItem(container1, backgroundType),
305 TestDisplayItem(container1Layer, subsequenceType), 305 TestDisplayItem(container1Layer, subsequenceType),
306 TestDisplayItem(content1, backgroundType), 306 TestDisplayItem(content1, backgroundType),
307 TestDisplayItem(container1Layer, endSubsequenceType), 307 TestDisplayItem(container1Layer, endSubsequenceType),
308 TestDisplayItem(container2, backgroundType), 308 TestDisplayItem(container2, backgroundType),
309 TestDisplayItem(container2Layer, subsequenceType), 309 TestDisplayItem(container2Layer, subsequenceType),
310 TestDisplayItem(content2a, backgroundType), 310 TestDisplayItem(content2a, backgroundType),
311 TestDisplayItem(container2Layer, endSubsequenceType), 311 TestDisplayItem(container2Layer, endSubsequenceType),
312 TestDisplayItem(rootLayer, endSubsequenceType)); 312 TestDisplayItem(rootLayer, endSubsequenceType));
313 } else { 313 } else {
314 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 314 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
315 TestDisplayItem(layoutView(), backgroundType), 315 TestDisplayItem(layoutView(), backgroundType),
316 TestDisplayItem(rootLayer, subsequenceType), 316 TestDisplayItem(rootLayer, subsequenceType),
317 TestDisplayItem(htmlLayer, subsequenceType), 317 TestDisplayItem(htmlLayer, subsequenceType),
318 TestDisplayItem(container1, backgroundType), 318 TestDisplayItem(container1, backgroundType),
319 TestDisplayItem(container1Layer, subsequenceType), 319 TestDisplayItem(container1Layer, subsequenceType),
320 TestDisplayItem(content1, backgroundType), 320 TestDisplayItem(content1, backgroundType),
321 TestDisplayItem(container1Layer, endSubsequenceType), 321 TestDisplayItem(container1Layer, endSubsequenceType),
322 TestDisplayItem(container2, backgroundType), 322 TestDisplayItem(container2, backgroundType),
323 TestDisplayItem(container2Layer, subsequenceType), 323 TestDisplayItem(container2Layer, subsequenceType),
324 TestDisplayItem(content2a, backgroundType), 324 TestDisplayItem(content2a, backgroundType),
(...skipping 16 matching lines...) Expand all
341 341
342 PaintLayer& rootLayer = *layoutView().layer(); 342 PaintLayer& rootLayer = *layoutView().layer();
343 PaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement() ->layoutObject())->layer(); 343 PaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement() ->layoutObject())->layer();
344 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject(); 344 LayoutObject& container1 = *document().getElementById("container1")->layoutO bject();
345 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer(); 345 PaintLayer& container1Layer = *toLayoutBoxModelObject(container1).layer();
346 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t(); 346 LayoutObject& content1 = *document().getElementById("content1")->layoutObjec t();
347 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject(); 347 LayoutObject& container2 = *document().getElementById("container2")->layoutO bject();
348 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer(); 348 PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer();
349 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec t(); 349 LayoutObject& content2 = *document().getElementById("content2")->layoutObjec t();
350 350
351 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 351 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
352 TestDisplayItem(layoutView(), backgroundType), 352 TestDisplayItem(layoutView(), backgroundType),
353 TestDisplayItem(rootLayer, subsequenceType), 353 TestDisplayItem(rootLayer, subsequenceType),
354 TestDisplayItem(htmlLayer, subsequenceType), 354 TestDisplayItem(htmlLayer, subsequenceType),
355 TestDisplayItem(container1, backgroundType), 355 TestDisplayItem(container1, backgroundType),
356 TestDisplayItem(container1Layer, subsequenceType), 356 TestDisplayItem(container1Layer, subsequenceType),
357 TestDisplayItem(content1, backgroundType), 357 TestDisplayItem(content1, backgroundType),
358 TestDisplayItem(container1Layer, endSubsequenceType), 358 TestDisplayItem(container1Layer, endSubsequenceType),
359 TestDisplayItem(container2, backgroundType), 359 TestDisplayItem(container2, backgroundType),
360 TestDisplayItem(container2Layer, subsequenceType), 360 TestDisplayItem(container2Layer, subsequenceType),
361 TestDisplayItem(content2, backgroundType), 361 TestDisplayItem(content2, backgroundType),
362 TestDisplayItem(container2Layer, endSubsequenceType), 362 TestDisplayItem(container2Layer, endSubsequenceType),
363 TestDisplayItem(htmlLayer, endSubsequenceType), 363 TestDisplayItem(htmlLayer, endSubsequenceType),
364 TestDisplayItem(rootLayer, endSubsequenceType)); 364 TestDisplayItem(rootLayer, endSubsequenceType));
365 365
366 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position : absolute; width: 100px; height: 100px; background-color: green"); 366 toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position : absolute; width: 100px; height: 100px; background-color: green");
367 updateLifecyclePhasesToPaintClean(LayoutRect(LayoutRect::infiniteIntRect())) ; 367 updateLifecyclePhasesToPaintClean(LayoutRect(LayoutRect::infiniteIntRect())) ;
368 368
369 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, 369 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
370 TestDisplayItem(layoutView(), cachedBackgroundType), 370 TestDisplayItem(layoutView(), cachedBackgroundType),
371 TestDisplayItem(rootLayer, subsequenceType), 371 TestDisplayItem(rootLayer, subsequenceType),
372 TestDisplayItem(htmlLayer, subsequenceType), 372 TestDisplayItem(htmlLayer, subsequenceType),
373 TestDisplayItem(container1, cachedBackgroundType), 373 TestDisplayItem(container1, cachedBackgroundType),
374 TestDisplayItem(container1Layer, subsequenceType), 374 TestDisplayItem(container1Layer, subsequenceType),
375 TestDisplayItem(content1, backgroundType), 375 TestDisplayItem(content1, backgroundType),
376 TestDisplayItem(container1Layer, endSubsequenceType), 376 TestDisplayItem(container1Layer, endSubsequenceType),
377 TestDisplayItem(container2, cachedBackgroundType), 377 TestDisplayItem(container2, cachedBackgroundType),
378 TestDisplayItem(container2Layer, cachedSubsequenceType), 378 TestDisplayItem(container2Layer, cachedSubsequenceType),
379 TestDisplayItem(htmlLayer, endSubsequenceType), 379 TestDisplayItem(htmlLayer, endSubsequenceType),
380 TestDisplayItem(rootLayer, endSubsequenceType)); 380 TestDisplayItem(rootLayer, endSubsequenceType));
381 381
382 compositeForSlimmingPaintV2(); 382 compositeForSlimmingPaintV2();
383 383
384 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 384 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
385 TestDisplayItem(layoutView(), backgroundType), 385 TestDisplayItem(layoutView(), backgroundType),
386 TestDisplayItem(rootLayer, subsequenceType), 386 TestDisplayItem(rootLayer, subsequenceType),
387 TestDisplayItem(htmlLayer, subsequenceType), 387 TestDisplayItem(htmlLayer, subsequenceType),
388 TestDisplayItem(container1, backgroundType), 388 TestDisplayItem(container1, backgroundType),
389 TestDisplayItem(container1Layer, subsequenceType), 389 TestDisplayItem(container1Layer, subsequenceType),
390 TestDisplayItem(content1, backgroundType), 390 TestDisplayItem(content1, backgroundType),
391 TestDisplayItem(container1Layer, endSubsequenceType), 391 TestDisplayItem(container1Layer, endSubsequenceType),
392 TestDisplayItem(container2, backgroundType), 392 TestDisplayItem(container2, backgroundType),
393 TestDisplayItem(container2Layer, subsequenceType), 393 TestDisplayItem(container2Layer, subsequenceType),
394 TestDisplayItem(content2, backgroundType), 394 TestDisplayItem(content2, backgroundType),
395 TestDisplayItem(container2Layer, endSubsequenceType), 395 TestDisplayItem(container2Layer, endSubsequenceType),
396 TestDisplayItem(htmlLayer, endSubsequenceType), 396 TestDisplayItem(htmlLayer, endSubsequenceType),
397 TestDisplayItem(rootLayer, endSubsequenceType)); 397 TestDisplayItem(rootLayer, endSubsequenceType));
398 398
399 // Repeated painting should just generate the root cached subsequence. 399 // Repeated painting should just generate the root cached subsequence.
400 setNeedsDisplayWithoutInvalidationForRoot(); 400 setNeedsDisplayWithoutInvalidationForRoot();
401 updateLifecyclePhasesToPaintClean(); 401 updateLifecyclePhasesToPaintClean();
402 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 2, 402 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 2,
403 TestDisplayItem(layoutView(), cachedBackgroundType), 403 TestDisplayItem(layoutView(), cachedBackgroundType),
404 TestDisplayItem(rootLayer, cachedSubsequenceType)); 404 TestDisplayItem(rootLayer, cachedSubsequenceType));
405 405
406 compositeForSlimmingPaintV2(); 406 compositeForSlimmingPaintV2();
407 407
408 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 408 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
409 TestDisplayItem(layoutView(), backgroundType), 409 TestDisplayItem(layoutView(), backgroundType),
410 TestDisplayItem(rootLayer, subsequenceType), 410 TestDisplayItem(rootLayer, subsequenceType),
411 TestDisplayItem(htmlLayer, subsequenceType), 411 TestDisplayItem(htmlLayer, subsequenceType),
412 TestDisplayItem(container1, backgroundType), 412 TestDisplayItem(container1, backgroundType),
413 TestDisplayItem(container1Layer, subsequenceType), 413 TestDisplayItem(container1Layer, subsequenceType),
414 TestDisplayItem(content1, backgroundType), 414 TestDisplayItem(content1, backgroundType),
415 TestDisplayItem(container1Layer, endSubsequenceType), 415 TestDisplayItem(container1Layer, endSubsequenceType),
416 TestDisplayItem(container2, backgroundType), 416 TestDisplayItem(container2, backgroundType),
417 TestDisplayItem(container2Layer, subsequenceType), 417 TestDisplayItem(container2Layer, subsequenceType),
418 TestDisplayItem(content2, backgroundType), 418 TestDisplayItem(content2, backgroundType),
(...skipping 29 matching lines...) Expand all
448 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer(); 448 PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer();
449 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec t(); 449 LayoutObject& content3 = *document().getElementById("content3")->layoutObjec t();
450 450
451 LayoutRect interestRect(0, 0, 400, 300); 451 LayoutRect interestRect(0, 0, 400, 300);
452 document().view()->updateAllLifecyclePhases(&interestRect); 452 document().view()->updateAllLifecyclePhases(&interestRect);
453 453
454 // Container1 is fully in the interest rect; 454 // Container1 is fully in the interest rect;
455 // Container2 is partly (including its stacking chidren) in the interest rec t; 455 // Container2 is partly (including its stacking chidren) in the interest rec t;
456 // Content2b is out of the interest rect and output nothing; 456 // Content2b is out of the interest rect and output nothing;
457 // Container3 is partly in the interest rect. 457 // Container3 is partly in the interest rect.
458 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 17, 458 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 17,
459 TestDisplayItem(layoutView(), backgroundType), 459 TestDisplayItem(layoutView(), backgroundType),
460 TestDisplayItem(rootLayer, subsequenceType), 460 TestDisplayItem(rootLayer, subsequenceType),
461 TestDisplayItem(htmlLayer, subsequenceType), 461 TestDisplayItem(htmlLayer, subsequenceType),
462 TestDisplayItem(container1, backgroundType), 462 TestDisplayItem(container1, backgroundType),
463 TestDisplayItem(container1Layer, subsequenceType), 463 TestDisplayItem(container1Layer, subsequenceType),
464 TestDisplayItem(content1, backgroundType), 464 TestDisplayItem(content1, backgroundType),
465 TestDisplayItem(container1Layer, endSubsequenceType), 465 TestDisplayItem(container1Layer, endSubsequenceType),
466 TestDisplayItem(container2, backgroundType), 466 TestDisplayItem(container2, backgroundType),
467 TestDisplayItem(container2Layer, subsequenceType), 467 TestDisplayItem(container2Layer, subsequenceType),
468 TestDisplayItem(content2a, backgroundType), 468 TestDisplayItem(content2a, backgroundType),
469 TestDisplayItem(container2Layer, endSubsequenceType), 469 TestDisplayItem(container2Layer, endSubsequenceType),
470 TestDisplayItem(container3, backgroundType), 470 TestDisplayItem(container3, backgroundType),
471 TestDisplayItem(container3Layer, subsequenceType), 471 TestDisplayItem(container3Layer, subsequenceType),
472 TestDisplayItem(content3, backgroundType), 472 TestDisplayItem(content3, backgroundType),
473 TestDisplayItem(container3Layer, endSubsequenceType), 473 TestDisplayItem(container3Layer, endSubsequenceType),
474 TestDisplayItem(htmlLayer, endSubsequenceType), 474 TestDisplayItem(htmlLayer, endSubsequenceType),
475 TestDisplayItem(rootLayer, endSubsequenceType)); 475 TestDisplayItem(rootLayer, endSubsequenceType));
476 476
477 setNeedsDisplayWithoutInvalidationForRoot(); 477 setNeedsDisplayWithoutInvalidationForRoot();
478 478
479 // Container1 becomes partly in the interest rect, but uses cached subsequen ce 479 // Container1 becomes partly in the interest rect, but uses cached subsequen ce
480 // because it was fully painted before; 480 // because it was fully painted before;
481 // Container2's intersection with the interest rect changes; 481 // Container2's intersection with the interest rect changes;
482 // Content2b is out of the interest rect and outputs nothing; 482 // Content2b is out of the interest rect and outputs nothing;
483 // Container3 becomes out of the interest rect and outputs nothing. 483 // Container3 becomes out of the interest rect and outputs nothing.
484 updateLifecyclePhasesToPaintClean(LayoutRect(0, 100, 300, 300)); 484 updateLifecyclePhasesToPaintClean(LayoutRect(0, 100, 300, 300));
485 485
486 EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11, 486 EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
487 TestDisplayItem(layoutView(), cachedBackgroundType), 487 TestDisplayItem(layoutView(), cachedBackgroundType),
488 TestDisplayItem(rootLayer, subsequenceType), 488 TestDisplayItem(rootLayer, subsequenceType),
489 TestDisplayItem(htmlLayer, subsequenceType), 489 TestDisplayItem(htmlLayer, subsequenceType),
490 TestDisplayItem(container1, cachedBackgroundType), 490 TestDisplayItem(container1, cachedBackgroundType),
491 TestDisplayItem(container1Layer, cachedSubsequenceType), 491 TestDisplayItem(container1Layer, cachedSubsequenceType),
492 TestDisplayItem(container2, cachedBackgroundType), 492 TestDisplayItem(container2, cachedBackgroundType),
493 TestDisplayItem(container2Layer, subsequenceType), 493 TestDisplayItem(container2Layer, subsequenceType),
494 TestDisplayItem(content2a, cachedBackgroundType), 494 TestDisplayItem(content2a, cachedBackgroundType),
495 TestDisplayItem(container2Layer, endSubsequenceType), 495 TestDisplayItem(container2Layer, endSubsequenceType),
496 TestDisplayItem(htmlLayer, endSubsequenceType), 496 TestDisplayItem(htmlLayer, endSubsequenceType),
497 TestDisplayItem(rootLayer, endSubsequenceType)); 497 TestDisplayItem(rootLayer, endSubsequenceType));
498 498
499 compositeForSlimmingPaintV2(); 499 compositeForSlimmingPaintV2();
500 500
501 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13, 501 EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
502 TestDisplayItem(layoutView(), backgroundType), 502 TestDisplayItem(layoutView(), backgroundType),
503 TestDisplayItem(rootLayer, subsequenceType), 503 TestDisplayItem(rootLayer, subsequenceType),
504 TestDisplayItem(htmlLayer, subsequenceType), 504 TestDisplayItem(htmlLayer, subsequenceType),
505 TestDisplayItem(container1, backgroundType), 505 TestDisplayItem(container1, backgroundType),
506 TestDisplayItem(container1Layer, subsequenceType), 506 TestDisplayItem(container1Layer, subsequenceType),
507 TestDisplayItem(content1, backgroundType), 507 TestDisplayItem(content1, backgroundType),
508 TestDisplayItem(container1Layer, endSubsequenceType), 508 TestDisplayItem(container1Layer, endSubsequenceType),
509 TestDisplayItem(container2, backgroundType), 509 TestDisplayItem(container2, backgroundType),
510 TestDisplayItem(container2Layer, subsequenceType), 510 TestDisplayItem(container2Layer, subsequenceType),
511 TestDisplayItem(content2a, backgroundType), 511 TestDisplayItem(content2a, backgroundType),
512 TestDisplayItem(container2Layer, endSubsequenceType), 512 TestDisplayItem(container2Layer, endSubsequenceType),
513 TestDisplayItem(htmlLayer, endSubsequenceType), 513 TestDisplayItem(htmlLayer, endSubsequenceType),
514 TestDisplayItem(rootLayer, endSubsequenceType)); 514 TestDisplayItem(rootLayer, endSubsequenceType));
515 } 515 }
516 516
517 } // namespace blink 517 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698