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

Side by Side Diff: cc/trees/layer_sorter_unittest.cc

Issue 13285002: cc: Consolidate LayerList types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_sorter.cc ('k') | cc/trees/layer_tree_host.h » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_sorter.h" 5 #include "cc/trees/layer_sorter.h"
6 6
7 #include "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/layers/layer_impl.h" 8 #include "cc/layers/layer_impl.h"
9 #include "cc/test/fake_impl_proxy.h" 9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 layer4->SetBounds(gfx::Size(40, 40)); 241 layer4->SetBounds(gfx::Size(40, 40));
242 layer4->SetContentBounds(gfx::Size(40, 40)); 242 layer4->SetContentBounds(gfx::Size(40, 40));
243 layer4->draw_properties().target_space_transform = FrontMatrix; 243 layer4->draw_properties().target_space_transform = FrontMatrix;
244 layer4->SetDrawsContent(true); 244 layer4->SetDrawsContent(true);
245 245
246 layer5->SetBounds(gfx::Size(50, 50)); 246 layer5->SetBounds(gfx::Size(50, 50));
247 layer5->SetContentBounds(gfx::Size(50, 50)); 247 layer5->SetContentBounds(gfx::Size(50, 50));
248 layer5->draw_properties().target_space_transform = BehindMatrix; 248 layer5->draw_properties().target_space_transform = BehindMatrix;
249 layer5->SetDrawsContent(true); 249 layer5->SetDrawsContent(true);
250 250
251 std::vector<LayerImpl*> layer_list; 251 LayerImplList layer_list;
252 layer_list.push_back(layer1.get()); 252 layer_list.push_back(layer1.get());
253 layer_list.push_back(layer2.get()); 253 layer_list.push_back(layer2.get());
254 layer_list.push_back(layer3.get()); 254 layer_list.push_back(layer3.get());
255 layer_list.push_back(layer4.get()); 255 layer_list.push_back(layer4.get());
256 layer_list.push_back(layer5.get()); 256 layer_list.push_back(layer5.get());
257 257
258 ASSERT_EQ(5u, layer_list.size()); 258 ASSERT_EQ(5u, layer_list.size());
259 EXPECT_EQ(1, layer_list[0]->id()); 259 EXPECT_EQ(1, layer_list[0]->id());
260 EXPECT_EQ(2, layer_list[1]->id()); 260 EXPECT_EQ(2, layer_list[1]->id());
261 EXPECT_EQ(3, layer_list[2]->id()); 261 EXPECT_EQ(3, layer_list[2]->id());
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 layer1->SetBounds(gfx::Size(10, 10)); 298 layer1->SetBounds(gfx::Size(10, 10));
299 layer1->SetContentBounds(gfx::Size(10, 10)); 299 layer1->SetContentBounds(gfx::Size(10, 10));
300 layer1->draw_properties().target_space_transform = BehindMatrix; 300 layer1->draw_properties().target_space_transform = BehindMatrix;
301 layer1->SetDrawsContent(true); 301 layer1->SetDrawsContent(true);
302 302
303 layer2->SetBounds(gfx::Size(10, 10)); 303 layer2->SetBounds(gfx::Size(10, 10));
304 layer2->SetContentBounds(gfx::Size(10, 10)); 304 layer2->SetContentBounds(gfx::Size(10, 10));
305 layer2->draw_properties().target_space_transform = FrontMatrix; 305 layer2->draw_properties().target_space_transform = FrontMatrix;
306 layer2->SetDrawsContent(true); 306 layer2->SetDrawsContent(true);
307 307
308 std::vector<LayerImpl*> layer_list; 308 LayerImplList layer_list;
309 layer_list.push_back(layer1.get()); 309 layer_list.push_back(layer1.get());
310 layer_list.push_back(layer2.get()); 310 layer_list.push_back(layer2.get());
311 311
312 ASSERT_EQ(2u, layer_list.size()); 312 ASSERT_EQ(2u, layer_list.size());
313 EXPECT_EQ(1, layer_list[0]->id()); 313 EXPECT_EQ(1, layer_list[0]->id());
314 EXPECT_EQ(2, layer_list[1]->id()); 314 EXPECT_EQ(2, layer_list[1]->id());
315 315
316 LayerSorter layer_sorter; 316 LayerSorter layer_sorter;
317 layer_sorter.Sort(layer_list.begin(), layer_list.end()); 317 layer_sorter.Sort(layer_list.begin(), layer_list.end());
318 318
319 ASSERT_EQ(2u, layer_list.size()); 319 ASSERT_EQ(2u, layer_list.size());
320 EXPECT_EQ(1, layer_list[0]->id()); 320 EXPECT_EQ(1, layer_list[0]->id());
321 EXPECT_EQ(2, layer_list[1]->id()); 321 EXPECT_EQ(2, layer_list[1]->id());
322 } 322 }
323 323
324 } // namespace 324 } // namespace
325 } // namespace cc 325 } // namespace cc
326 326
OLDNEW
« no previous file with comments | « cc/trees/layer_sorter.cc ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698