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

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

Issue 1808373002: cc : Make tree synchronization independent of layer tree hierarchy (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 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/tree_synchronizer.h" 5 #include "cc/trees/tree_synchronizer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 clip_children_impl->end()); 158 clip_children_impl->end());
159 } 159 }
160 160
161 for (size_t i = 0; i < layer_children.size(); ++i) { 161 for (size_t i = 0; i < layer_children.size(); ++i) {
162 SCOPED_TRACE(base::StringPrintf("child layer %" PRIuS, i).c_str()); 162 SCOPED_TRACE(base::StringPrintf("child layer %" PRIuS, i).c_str());
163 ExpectTreesAreIdentical(layer_children[i].get(), 163 ExpectTreesAreIdentical(layer_children[i].get(),
164 layer_impl_children[i].get(), tree_impl); 164 layer_impl_children[i].get(), tree_impl);
165 } 165 }
166 } 166 }
167 167
168 void PushLayerPropertiesTo(LayerTreeHost* tree_host, LayerTreeImpl* tree_impl) {
ajuma 2016/03/21 13:41:20 Is this still needed now that we have a method in
jaydasika 2016/03/21 17:32:03 Removed.
169 std::unordered_set<Layer*> layers_that_should_push_properties =
170 tree_host->LayersThatShouldPushProperties();
171 for (auto layer : layers_that_should_push_properties) {
172 LayerImpl* impl_layer = tree_impl->LayerById(layer->id());
173 DCHECK(impl_layer) << layer->id();
174 layer->PushPropertiesTo(impl_layer);
175 }
176 }
177
168 class TreeSynchronizerTest : public testing::Test { 178 class TreeSynchronizerTest : public testing::Test {
169 public: 179 public:
170 TreeSynchronizerTest() 180 TreeSynchronizerTest()
171 : client_(FakeLayerTreeHostClient::DIRECT_3D), 181 : client_(FakeLayerTreeHostClient::DIRECT_3D),
172 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)) {} 182 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)) {}
173 183
174 protected: 184 protected:
175 FakeLayerTreeHostClient client_; 185 FakeLayerTreeHostClient client_;
176 TestTaskGraphRunner task_graph_runner_; 186 TestTaskGraphRunner task_graph_runner_;
177 scoped_ptr<FakeLayerTreeHost> host_; 187 scoped_ptr<FakeLayerTreeHost> host_;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 host_->SetRootLayer(layer_tree_root); 246 host_->SetRootLayer(layer_tree_root);
237 247
238 scoped_ptr<LayerImpl> layer_impl_tree_root = 248 scoped_ptr<LayerImpl> layer_impl_tree_root =
239 TreeSynchronizer::SynchronizeTrees( 249 TreeSynchronizer::SynchronizeTrees(
240 layer_tree_root.get(), nullptr, host_->active_tree()); 250 layer_tree_root.get(), nullptr, host_->active_tree());
241 ExpectTreesAreIdentical(layer_tree_root.get(), 251 ExpectTreesAreIdentical(layer_tree_root.get(),
242 layer_impl_tree_root.get(), 252 layer_impl_tree_root.get(),
243 host_->active_tree()); 253 host_->active_tree());
244 254
245 // We have to push properties to pick up the destruction list pointer. 255 // We have to push properties to pick up the destruction list pointer.
246 TreeSynchronizer::PushProperties(layer_tree_root.get(), 256 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
247 layer_impl_tree_root.get()); 257 host_->active_tree());
248 258
249 // Add a new layer to the Layer side 259 // Add a new layer to the Layer side
250 layer_tree_root->children()[0]->AddChild( 260 layer_tree_root->children()[0]->AddChild(
251 MockLayer::Create(&layer_impl_destruction_list)); 261 MockLayer::Create(&layer_impl_destruction_list));
252 // Remove one. 262 // Remove one.
253 layer_tree_root->children()[1]->RemoveFromParent(); 263 layer_tree_root->children()[1]->RemoveFromParent();
254 int second_layer_impl_id = layer_impl_tree_root->children()[1]->id(); 264 int second_layer_impl_id = layer_impl_tree_root->children()[1]->id();
255 265
256 // Synchronize again. After the sync the trees should be equivalent and we 266 // Synchronize again. After the sync the trees should be equivalent and we
257 // should have created and destroyed one LayerImpl. 267 // should have created and destroyed one LayerImpl.
(...skipping 23 matching lines...) Expand all
281 291
282 host_->SetRootLayer(layer_tree_root); 292 host_->SetRootLayer(layer_tree_root);
283 293
284 host_->active_tree()->SetRootLayer(TreeSynchronizer::SynchronizeTrees( 294 host_->active_tree()->SetRootLayer(TreeSynchronizer::SynchronizeTrees(
285 layer_tree_root.get(), nullptr, host_->active_tree())); 295 layer_tree_root.get(), nullptr, host_->active_tree()));
286 LayerImpl* layer_impl_tree_root = host_->active_tree()->root_layer(); 296 LayerImpl* layer_impl_tree_root = host_->active_tree()->root_layer();
287 ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root, 297 ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root,
288 host_->active_tree()); 298 host_->active_tree());
289 299
290 // We have to push properties to pick up the destruction list pointer. 300 // We have to push properties to pick up the destruction list pointer.
291 TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root); 301 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
302 host_->active_tree());
292 303
293 host_->active_tree()->ResetAllChangeTracking( 304 host_->active_tree()->ResetAllChangeTracking(
294 PropertyTrees::ResetFlags::ALL_TREES); 305 PropertyTrees::ResetFlags::ALL_TREES);
295 306
296 // re-insert the layer and sync again. 307 // re-insert the layer and sync again.
297 child2->RemoveFromParent(); 308 child2->RemoveFromParent();
298 layer_tree_root->AddChild(child2); 309 layer_tree_root->AddChild(child2);
299 host_->active_tree()->SetRootLayer(TreeSynchronizer::SynchronizeTrees( 310 host_->active_tree()->SetRootLayer(TreeSynchronizer::SynchronizeTrees(
300 layer_tree_root.get(), host_->active_tree()->DetachLayerTree(), 311 layer_tree_root.get(), host_->active_tree()->DetachLayerTree(),
301 host_->active_tree())); 312 host_->active_tree()));
302 layer_impl_tree_root = host_->active_tree()->root_layer(); 313 layer_impl_tree_root = host_->active_tree()->root_layer();
303 ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root, 314 ExpectTreesAreIdentical(layer_tree_root.get(), layer_impl_tree_root,
304 host_->active_tree()); 315 host_->active_tree());
305 316
306 TreeSynchronizer::PushProperties(layer_tree_root.get(), layer_impl_tree_root); 317 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
318 host_->active_tree());
307 319
308 // Check that the impl thread properly tracked the change. 320 // Check that the impl thread properly tracked the change.
309 EXPECT_FALSE(layer_impl_tree_root->LayerPropertyChanged()); 321 EXPECT_FALSE(layer_impl_tree_root->LayerPropertyChanged());
310 EXPECT_FALSE(layer_impl_tree_root->children()[0]->LayerPropertyChanged()); 322 EXPECT_FALSE(layer_impl_tree_root->children()[0]->LayerPropertyChanged());
311 EXPECT_TRUE(layer_impl_tree_root->children()[1]->LayerPropertyChanged()); 323 EXPECT_TRUE(layer_impl_tree_root->children()[1]->LayerPropertyChanged());
312 host_->active_tree()->DetachLayerTree(); 324 host_->active_tree()->DetachLayerTree();
313 } 325 }
314 326
315 TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndProperties) { 327 TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndProperties) {
316 scoped_refptr<Layer> layer_tree_root = Layer::Create(); 328 scoped_refptr<Layer> layer_tree_root = Layer::Create();
(...skipping 14 matching lines...) Expand all
331 layer_tree_root->children()[1]->SetBounds(second_child_bounds); 343 layer_tree_root->children()[1]->SetBounds(second_child_bounds);
332 layer_tree_root->children()[1]->SavePaintProperties(); 344 layer_tree_root->children()[1]->SavePaintProperties();
333 345
334 scoped_ptr<LayerImpl> layer_impl_tree_root = 346 scoped_ptr<LayerImpl> layer_impl_tree_root =
335 TreeSynchronizer::SynchronizeTrees( 347 TreeSynchronizer::SynchronizeTrees(
336 layer_tree_root.get(), nullptr, host_->active_tree()); 348 layer_tree_root.get(), nullptr, host_->active_tree());
337 ExpectTreesAreIdentical(layer_tree_root.get(), 349 ExpectTreesAreIdentical(layer_tree_root.get(),
338 layer_impl_tree_root.get(), 350 layer_impl_tree_root.get(),
339 host_->active_tree()); 351 host_->active_tree());
340 352
341 TreeSynchronizer::PushProperties(layer_tree_root.get(), 353 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
342 layer_impl_tree_root.get()); 354 host_->active_tree());
343 355
344 // Check that the property values we set on the Layer tree are reflected in 356 // Check that the property values we set on the Layer tree are reflected in
345 // the LayerImpl tree. 357 // the LayerImpl tree.
346 gfx::PointF root_layer_impl_position = layer_impl_tree_root->position(); 358 gfx::PointF root_layer_impl_position = layer_impl_tree_root->position();
347 EXPECT_EQ(root_position.x(), root_layer_impl_position.x()); 359 EXPECT_EQ(root_position.x(), root_layer_impl_position.x());
348 EXPECT_EQ(root_position.y(), root_layer_impl_position.y()); 360 EXPECT_EQ(root_position.y(), root_layer_impl_position.y());
349 361
350 EXPECT_EQ(first_child_opacity, 362 EXPECT_EQ(first_child_opacity,
351 layer_impl_tree_root->children()[0]->opacity()); 363 layer_impl_tree_root->children()[0]->opacity());
352 364
(...skipping 29 matching lines...) Expand all
382 host_->SetRootLayer(layer_tree_root); 394 host_->SetRootLayer(layer_tree_root);
383 395
384 scoped_ptr<LayerImpl> layer_impl_tree_root = 396 scoped_ptr<LayerImpl> layer_impl_tree_root =
385 TreeSynchronizer::SynchronizeTrees( 397 TreeSynchronizer::SynchronizeTrees(
386 layer_tree_root.get(), nullptr, host_->active_tree()); 398 layer_tree_root.get(), nullptr, host_->active_tree());
387 ExpectTreesAreIdentical(layer_tree_root.get(), 399 ExpectTreesAreIdentical(layer_tree_root.get(),
388 layer_impl_tree_root.get(), 400 layer_impl_tree_root.get(),
389 host_->active_tree()); 401 host_->active_tree());
390 402
391 // We have to push properties to pick up the destruction list pointer. 403 // We have to push properties to pick up the destruction list pointer.
392 TreeSynchronizer::PushProperties(layer_tree_root.get(), 404 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
393 layer_impl_tree_root.get()); 405 host_->active_tree());
394 406
395 // Now restructure the tree to look like this: 407 // Now restructure the tree to look like this:
396 // root --- D ---+--- A 408 // root --- D ---+--- A
397 // | 409 // |
398 // +--- C --- B 410 // +--- C --- B
399 layer_tree_root->RemoveAllChildren(); 411 layer_tree_root->RemoveAllChildren();
400 layer_d->RemoveAllChildren(); 412 layer_d->RemoveAllChildren();
401 layer_tree_root->AddChild(layer_d); 413 layer_tree_root->AddChild(layer_d);
402 layer_a->RemoveAllChildren(); 414 layer_a->RemoveAllChildren();
403 layer_d->AddChild(layer_a); 415 layer_d->AddChild(layer_a);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 int old_tree_second_child_layer_id = old_layer_tree_root->children()[1]->id(); 449 int old_tree_second_child_layer_id = old_layer_tree_root->children()[1]->id();
438 450
439 scoped_ptr<LayerImpl> layer_impl_tree_root = 451 scoped_ptr<LayerImpl> layer_impl_tree_root =
440 TreeSynchronizer::SynchronizeTrees( 452 TreeSynchronizer::SynchronizeTrees(
441 old_layer_tree_root.get(), nullptr, host_->active_tree()); 453 old_layer_tree_root.get(), nullptr, host_->active_tree());
442 ExpectTreesAreIdentical(old_layer_tree_root.get(), 454 ExpectTreesAreIdentical(old_layer_tree_root.get(),
443 layer_impl_tree_root.get(), 455 layer_impl_tree_root.get(),
444 host_->active_tree()); 456 host_->active_tree());
445 457
446 // We have to push properties to pick up the destruction list pointer. 458 // We have to push properties to pick up the destruction list pointer.
447 TreeSynchronizer::PushProperties(old_layer_tree_root.get(), 459 PushLayerPropertiesTo(old_layer_tree_root->layer_tree_host(),
448 layer_impl_tree_root.get()); 460 host_->active_tree());
449 461
450 // Remove all children on the Layer side. 462 // Remove all children on the Layer side.
451 old_layer_tree_root->RemoveAllChildren(); 463 old_layer_tree_root->RemoveAllChildren();
452 464
453 // Synchronize again. After the sync all LayerImpls from the old tree should 465 // Synchronize again. After the sync all LayerImpls from the old tree should
454 // be deleted. 466 // be deleted.
455 scoped_refptr<Layer> new_layer_tree_root = Layer::Create(); 467 scoped_refptr<Layer> new_layer_tree_root = Layer::Create();
456 host_->SetRootLayer(new_layer_tree_root); 468 host_->SetRootLayer(new_layer_tree_root);
457 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( 469 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
458 new_layer_tree_root.get(), std::move(layer_impl_tree_root), 470 new_layer_tree_root.get(), std::move(layer_impl_tree_root),
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 567
556 host_->SetRootLayer(layer_tree_root); 568 host_->SetRootLayer(layer_tree_root);
557 569
558 // First child is the second and third child's scroll parent. 570 // First child is the second and third child's scroll parent.
559 layer_tree_root->children()[1]->SetScrollParent(scroll_parent.get()); 571 layer_tree_root->children()[1]->SetScrollParent(scroll_parent.get());
560 layer_tree_root->children()[2]->SetScrollParent(scroll_parent.get()); 572 layer_tree_root->children()[2]->SetScrollParent(scroll_parent.get());
561 573
562 scoped_ptr<LayerImpl> layer_impl_tree_root = 574 scoped_ptr<LayerImpl> layer_impl_tree_root =
563 TreeSynchronizer::SynchronizeTrees( 575 TreeSynchronizer::SynchronizeTrees(
564 layer_tree_root.get(), nullptr, host_impl->active_tree()); 576 layer_tree_root.get(), nullptr, host_impl->active_tree());
565 TreeSynchronizer::PushProperties(layer_tree_root.get(), 577 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
566 layer_impl_tree_root.get()); 578 host_impl->active_tree());
567 { 579 {
568 SCOPED_TRACE("case one"); 580 SCOPED_TRACE("case one");
569 ExpectTreesAreIdentical(layer_tree_root.get(), 581 ExpectTreesAreIdentical(layer_tree_root.get(),
570 layer_impl_tree_root.get(), 582 layer_impl_tree_root.get(),
571 host_impl->active_tree()); 583 host_impl->active_tree());
572 } 584 }
573 585
574 // Remove the first scroll child. 586 // Remove the first scroll child.
575 layer_tree_root->children()[1]->RemoveFromParent(); 587 layer_tree_root->children()[1]->RemoveFromParent();
576 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( 588 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
577 layer_tree_root.get(), std::move(layer_impl_tree_root), 589 layer_tree_root.get(), std::move(layer_impl_tree_root),
578 host_impl->active_tree()); 590 host_impl->active_tree());
579 TreeSynchronizer::PushProperties(layer_tree_root.get(), 591 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
580 layer_impl_tree_root.get()); 592 host_impl->active_tree());
581 { 593 {
582 SCOPED_TRACE("case two"); 594 SCOPED_TRACE("case two");
583 ExpectTreesAreIdentical(layer_tree_root.get(), 595 ExpectTreesAreIdentical(layer_tree_root.get(),
584 layer_impl_tree_root.get(), 596 layer_impl_tree_root.get(),
585 host_impl->active_tree()); 597 host_impl->active_tree());
586 } 598 }
587 599
588 // Add an additional scroll layer. 600 // Add an additional scroll layer.
589 scoped_refptr<Layer> additional_scroll_child = Layer::Create(); 601 scoped_refptr<Layer> additional_scroll_child = Layer::Create();
590 layer_tree_root->AddChild(additional_scroll_child); 602 layer_tree_root->AddChild(additional_scroll_child);
591 additional_scroll_child->SetScrollParent(scroll_parent.get()); 603 additional_scroll_child->SetScrollParent(scroll_parent.get());
592 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( 604 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
593 layer_tree_root.get(), std::move(layer_impl_tree_root), 605 layer_tree_root.get(), std::move(layer_impl_tree_root),
594 host_impl->active_tree()); 606 host_impl->active_tree());
595 TreeSynchronizer::PushProperties(layer_tree_root.get(), 607 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
596 layer_impl_tree_root.get()); 608 host_impl->active_tree());
597 { 609 {
598 SCOPED_TRACE("case three"); 610 SCOPED_TRACE("case three");
599 ExpectTreesAreIdentical(layer_tree_root.get(), 611 ExpectTreesAreIdentical(layer_tree_root.get(),
600 layer_impl_tree_root.get(), 612 layer_impl_tree_root.get(),
601 host_impl->active_tree()); 613 host_impl->active_tree());
602 } 614 }
603 } 615 }
604 616
605 TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { 617 TEST_F(TreeSynchronizerTest, SynchronizeClipParent) {
606 LayerTreeSettings settings; 618 LayerTreeSettings settings;
(...skipping 17 matching lines...) Expand all
624 636
625 host_->SetRootLayer(layer_tree_root); 637 host_->SetRootLayer(layer_tree_root);
626 638
627 // First child is the second and third child's scroll parent. 639 // First child is the second and third child's scroll parent.
628 clip_child1->SetClipParent(clip_parent.get()); 640 clip_child1->SetClipParent(clip_parent.get());
629 clip_child2->SetClipParent(clip_parent.get()); 641 clip_child2->SetClipParent(clip_parent.get());
630 642
631 scoped_ptr<LayerImpl> layer_impl_tree_root = 643 scoped_ptr<LayerImpl> layer_impl_tree_root =
632 TreeSynchronizer::SynchronizeTrees( 644 TreeSynchronizer::SynchronizeTrees(
633 layer_tree_root.get(), nullptr, host_impl->active_tree()); 645 layer_tree_root.get(), nullptr, host_impl->active_tree());
634 TreeSynchronizer::PushProperties(layer_tree_root.get(), 646 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
635 layer_impl_tree_root.get()); 647 host_impl->active_tree());
636 ExpectTreesAreIdentical(layer_tree_root.get(), 648 ExpectTreesAreIdentical(layer_tree_root.get(),
637 layer_impl_tree_root.get(), 649 layer_impl_tree_root.get(),
638 host_impl->active_tree()); 650 host_impl->active_tree());
639 651
640 // Remove the first clip child. 652 // Remove the first clip child.
641 clip_child1->RemoveFromParent(); 653 clip_child1->RemoveFromParent();
642 clip_child1 = NULL; 654 clip_child1 = NULL;
643 655
644 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( 656 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
645 layer_tree_root.get(), std::move(layer_impl_tree_root), 657 layer_tree_root.get(), std::move(layer_impl_tree_root),
646 host_impl->active_tree()); 658 host_impl->active_tree());
647 TreeSynchronizer::PushProperties(layer_tree_root.get(), 659 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
648 layer_impl_tree_root.get()); 660 host_impl->active_tree());
649 ExpectTreesAreIdentical(layer_tree_root.get(), 661 ExpectTreesAreIdentical(layer_tree_root.get(),
650 layer_impl_tree_root.get(), 662 layer_impl_tree_root.get(),
651 host_impl->active_tree()); 663 host_impl->active_tree());
652 664
653 // Add an additional clip child. 665 // Add an additional clip child.
654 scoped_refptr<Layer> additional_clip_child = Layer::Create(); 666 scoped_refptr<Layer> additional_clip_child = Layer::Create();
655 intervening->AddChild(additional_clip_child); 667 intervening->AddChild(additional_clip_child);
656 additional_clip_child->SetClipParent(clip_parent.get()); 668 additional_clip_child->SetClipParent(clip_parent.get());
657 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( 669 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
658 layer_tree_root.get(), std::move(layer_impl_tree_root), 670 layer_tree_root.get(), std::move(layer_impl_tree_root),
659 host_impl->active_tree()); 671 host_impl->active_tree());
660 TreeSynchronizer::PushProperties(layer_tree_root.get(), 672 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
661 layer_impl_tree_root.get()); 673 host_impl->active_tree());
662 ExpectTreesAreIdentical(layer_tree_root.get(), 674 ExpectTreesAreIdentical(layer_tree_root.get(),
663 layer_impl_tree_root.get(), 675 layer_impl_tree_root.get(),
664 host_impl->active_tree()); 676 host_impl->active_tree());
665 677
666 // Remove the nearest clipping ancestor. 678 // Remove the nearest clipping ancestor.
667 clip_parent->RemoveFromParent(); 679 clip_parent->RemoveFromParent();
668 clip_parent = NULL; 680 clip_parent = NULL;
669 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees( 681 layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
670 layer_tree_root.get(), std::move(layer_impl_tree_root), 682 layer_tree_root.get(), std::move(layer_impl_tree_root),
671 host_impl->active_tree()); 683 host_impl->active_tree());
672 TreeSynchronizer::PushProperties(layer_tree_root.get(), 684 PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
673 layer_impl_tree_root.get()); 685 host_impl->active_tree());
674 ExpectTreesAreIdentical(layer_tree_root.get(), 686 ExpectTreesAreIdentical(layer_tree_root.get(),
675 layer_impl_tree_root.get(), 687 layer_impl_tree_root.get(),
676 host_impl->active_tree()); 688 host_impl->active_tree());
677 689
678 // The clip children should have been unhooked. 690 // The clip children should have been unhooked.
679 EXPECT_EQ(2u, intervening->children().size()); 691 EXPECT_EQ(2u, intervening->children().size());
680 EXPECT_FALSE(clip_child2->clip_parent()); 692 EXPECT_FALSE(clip_child2->clip_parent());
681 EXPECT_FALSE(additional_clip_child->clip_parent()); 693 EXPECT_FALSE(additional_clip_child->clip_parent());
682 } 694 }
683 695
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 scroll_offset_map[scroll_layer->id()]->PullDeltaForMainThread(); 830 scroll_offset_map[scroll_layer->id()]->PullDeltaForMainThread();
819 scroll_offset_map[scroll_layer->id()]->SetCurrent(gfx::ScrollOffset(40, 50)); 831 scroll_offset_map[scroll_layer->id()]->SetCurrent(gfx::ScrollOffset(40, 50));
820 scroll_offset_map[scroll_layer->id()]->PushFromMainThread( 832 scroll_offset_map[scroll_layer->id()]->PushFromMainThread(
821 gfx::ScrollOffset(100, 100)); 833 gfx::ScrollOffset(100, 100));
822 scroll_offset_map[scroll_layer->id()]->PushPendingToActive(); 834 scroll_offset_map[scroll_layer->id()]->PushPendingToActive();
823 EXPECT_TRUE(is_equal(scroll_offset_map, scroll_tree.scroll_offset_map())); 835 EXPECT_TRUE(is_equal(scroll_offset_map, scroll_tree.scroll_offset_map()));
824 } 836 }
825 837
826 } // namespace 838 } // namespace
827 } // namespace cc 839 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_unittest_serialization.cc ('K') | « cc/trees/tree_synchronizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698