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

Side by Side Diff: cc/layers/layer_iterator_unittest.cc

Issue 1505243003: Revert of Create RenderSurface on Effect Tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alwayspt
Patch Set: rebase Created 5 years 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
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/layer_iterator.h" 5 #include "cc/layers/layer_iterator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/test/fake_layer_tree_host.h" 10 #include "cc/test/fake_layer_tree_host.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 TestLayerImpl* first_ptr = first.get(); 128 TestLayerImpl* first_ptr = first.get();
129 TestLayerImpl* second_ptr = second.get(); 129 TestLayerImpl* second_ptr = second.get();
130 TestLayerImpl* third_ptr = third.get(); 130 TestLayerImpl* third_ptr = third.get();
131 TestLayerImpl* fourth_ptr = fourth.get(); 131 TestLayerImpl* fourth_ptr = fourth.get();
132 132
133 root_layer->AddChild(std::move(first)); 133 root_layer->AddChild(std::move(first));
134 root_layer->AddChild(std::move(second)); 134 root_layer->AddChild(std::move(second));
135 root_layer->AddChild(std::move(third)); 135 root_layer->AddChild(std::move(third));
136 root_layer->AddChild(std::move(fourth)); 136 root_layer->AddChild(std::move(fourth));
137 137
138 root_layer->SetHasRenderSurface(true);
138 host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); 139 host_impl_.active_tree()->SetRootLayer(std::move(root_layer));
139 140
140 LayerImplList render_surface_layer_list; 141 LayerImplList render_surface_layer_list;
141 host_impl_.active_tree()->IncrementRenderSurfaceListIdForTesting(); 142 host_impl_.active_tree()->IncrementRenderSurfaceListIdForTesting();
142 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 143 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
143 root_ptr, root_ptr->bounds(), &render_surface_layer_list, 144 root_ptr, root_ptr->bounds(), &render_surface_layer_list,
144 host_impl_.active_tree()->current_render_surface_list_id()); 145 host_impl_.active_tree()->current_render_surface_list_id());
145 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 146 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
146 147
147 IterateFrontToBack(&render_surface_layer_list); 148 IterateFrontToBack(&render_surface_layer_list);
(...skipping 27 matching lines...) Expand all
175 176
176 root22->AddChild(std::move(root221)); 177 root22->AddChild(std::move(root221));
177 root23->AddChild(std::move(root231)); 178 root23->AddChild(std::move(root231));
178 root2->AddChild(std::move(root21)); 179 root2->AddChild(std::move(root21));
179 root2->AddChild(std::move(root22)); 180 root2->AddChild(std::move(root22));
180 root2->AddChild(std::move(root23)); 181 root2->AddChild(std::move(root23));
181 root_layer->AddChild(std::move(root1)); 182 root_layer->AddChild(std::move(root1));
182 root_layer->AddChild(std::move(root2)); 183 root_layer->AddChild(std::move(root2));
183 root_layer->AddChild(std::move(root3)); 184 root_layer->AddChild(std::move(root3));
184 185
186 root_layer->SetHasRenderSurface(true);
185 host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); 187 host_impl_.active_tree()->SetRootLayer(std::move(root_layer));
186 188
187 LayerImplList render_surface_layer_list; 189 LayerImplList render_surface_layer_list;
188 host_impl_.active_tree()->IncrementRenderSurfaceListIdForTesting(); 190 host_impl_.active_tree()->IncrementRenderSurfaceListIdForTesting();
189 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 191 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
190 root_ptr, root_ptr->bounds(), &render_surface_layer_list, 192 root_ptr, root_ptr->bounds(), &render_surface_layer_list,
191 host_impl_.active_tree()->current_render_surface_list_id()); 193 host_impl_.active_tree()->current_render_surface_list_id());
192 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 194 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
193 195
194 IterateFrontToBack(&render_surface_layer_list); 196 IterateFrontToBack(&render_surface_layer_list);
(...skipping 22 matching lines...) Expand all
217 TestLayerImpl* root_ptr = root_layer.get(); 219 TestLayerImpl* root_ptr = root_layer.get();
218 TestLayerImpl* root1_ptr = root1.get(); 220 TestLayerImpl* root1_ptr = root1.get();
219 TestLayerImpl* root2_ptr = root2.get(); 221 TestLayerImpl* root2_ptr = root2.get();
220 TestLayerImpl* root3_ptr = root3.get(); 222 TestLayerImpl* root3_ptr = root3.get();
221 TestLayerImpl* root21_ptr = root21.get(); 223 TestLayerImpl* root21_ptr = root21.get();
222 TestLayerImpl* root22_ptr = root22.get(); 224 TestLayerImpl* root22_ptr = root22.get();
223 TestLayerImpl* root23_ptr = root23.get(); 225 TestLayerImpl* root23_ptr = root23.get();
224 TestLayerImpl* root221_ptr = root221.get(); 226 TestLayerImpl* root221_ptr = root221.get();
225 TestLayerImpl* root231_ptr = root231.get(); 227 TestLayerImpl* root231_ptr = root231.get();
226 228
227 root22->SetForceRenderSurface(true); 229 root22->SetHasRenderSurface(true);
228 root23->SetForceRenderSurface(true);
229 root2->SetForceRenderSurface(true);
230 root22->AddChild(std::move(root221)); 230 root22->AddChild(std::move(root221));
231 root23->SetHasRenderSurface(true);
231 root23->AddChild(std::move(root231)); 232 root23->AddChild(std::move(root231));
232 root2->SetDrawsContent(false); 233 root2->SetDrawsContent(false);
234 root2->SetHasRenderSurface(true);
233 root2->AddChild(std::move(root21)); 235 root2->AddChild(std::move(root21));
234 root2->AddChild(std::move(root22)); 236 root2->AddChild(std::move(root22));
235 root2->AddChild(std::move(root23)); 237 root2->AddChild(std::move(root23));
236 root_layer->AddChild(std::move(root1)); 238 root_layer->AddChild(std::move(root1));
237 root_layer->AddChild(std::move(root2)); 239 root_layer->AddChild(std::move(root2));
238 root_layer->AddChild(std::move(root3)); 240 root_layer->AddChild(std::move(root3));
239 241
242 root_layer->SetHasRenderSurface(true);
240 host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); 243 host_impl_.active_tree()->SetRootLayer(std::move(root_layer));
241 244
242 LayerImplList render_surface_layer_list; 245 LayerImplList render_surface_layer_list;
243 host_impl_.active_tree()->IncrementRenderSurfaceListIdForTesting(); 246 host_impl_.active_tree()->IncrementRenderSurfaceListIdForTesting();
244 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 247 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
245 root_ptr, root_ptr->bounds(), &render_surface_layer_list, 248 root_ptr, root_ptr->bounds(), &render_surface_layer_list,
246 host_impl_.active_tree()->current_render_surface_list_id()); 249 host_impl_.active_tree()->current_render_surface_list_id());
247 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 250 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
248 251
249 IterateFrontToBack(&render_surface_layer_list); 252 IterateFrontToBack(&render_surface_layer_list);
250 EXPECT_COUNT(root_ptr, 14, -1, 13); 253 EXPECT_COUNT(root_ptr, 14, -1, 13);
251 EXPECT_COUNT(root1_ptr, -1, -1, 12); 254 EXPECT_COUNT(root1_ptr, -1, -1, 12);
252 EXPECT_COUNT(root2_ptr, 10, 11, -1); 255 EXPECT_COUNT(root2_ptr, 10, 11, -1);
253 EXPECT_COUNT(root21_ptr, -1, -1, 9); 256 EXPECT_COUNT(root21_ptr, -1, -1, 9);
254 EXPECT_COUNT(root22_ptr, 7, 8, 6); 257 EXPECT_COUNT(root22_ptr, 7, 8, 6);
255 EXPECT_COUNT(root221_ptr, -1, -1, 5); 258 EXPECT_COUNT(root221_ptr, -1, -1, 5);
256 EXPECT_COUNT(root23_ptr, 3, 4, 2); 259 EXPECT_COUNT(root23_ptr, 3, 4, 2);
257 EXPECT_COUNT(root231_ptr, -1, -1, 1); 260 EXPECT_COUNT(root231_ptr, -1, -1, 1);
258 EXPECT_COUNT(root3_ptr, -1, -1, 0); 261 EXPECT_COUNT(root3_ptr, -1, -1, 0);
259 } 262 }
260 263
261 } // namespace 264 } // namespace
262 } // namespace cc 265 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698