OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 } | 549 } |
550 | 550 |
551 TEST_F(TreeSynchronizerTest, SynchronizeAnimations) { | 551 TEST_F(TreeSynchronizerTest, SynchronizeAnimations) { |
552 LayerTreeSettings settings; | 552 LayerTreeSettings settings; |
553 FakeProxy proxy; | 553 FakeProxy proxy; |
554 DebugScopedSetImplThread impl(&proxy); | 554 DebugScopedSetImplThread impl(&proxy); |
555 FakeRenderingStatsInstrumentation stats_instrumentation; | 555 FakeRenderingStatsInstrumentation stats_instrumentation; |
556 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( | 556 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( |
557 new TestSharedBitmapManager()); | 557 new TestSharedBitmapManager()); |
558 scoped_ptr<LayerTreeHostImpl> host_impl = | 558 scoped_ptr<LayerTreeHostImpl> host_impl = |
559 LayerTreeHostImpl::Create(settings, | 559 LayerTreeHostImpl::Create(settings, NULL, &proxy, &stats_instrumentation, |
560 NULL, | 560 shared_bitmap_manager.get(), NULL, NULL, 0); |
561 &proxy, | |
562 &stats_instrumentation, | |
563 shared_bitmap_manager.get(), | |
564 NULL, | |
565 0); | |
566 | 561 |
567 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 562 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
568 host_->SetRootLayer(layer_tree_root); | 563 host_->SetRootLayer(layer_tree_root); |
569 | 564 |
570 layer_tree_root->SetLayerAnimationControllerForTest( | 565 layer_tree_root->SetLayerAnimationControllerForTest( |
571 FakeLayerAnimationController::Create()); | 566 FakeLayerAnimationController::Create()); |
572 | 567 |
573 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>( | 568 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>( |
574 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); | 569 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); |
575 | 570 |
(...skipping 12 matching lines...) Expand all Loading... |
588 } | 583 } |
589 | 584 |
590 TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) { | 585 TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) { |
591 LayerTreeSettings settings; | 586 LayerTreeSettings settings; |
592 FakeProxy proxy; | 587 FakeProxy proxy; |
593 DebugScopedSetImplThread impl(&proxy); | 588 DebugScopedSetImplThread impl(&proxy); |
594 FakeRenderingStatsInstrumentation stats_instrumentation; | 589 FakeRenderingStatsInstrumentation stats_instrumentation; |
595 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( | 590 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( |
596 new TestSharedBitmapManager()); | 591 new TestSharedBitmapManager()); |
597 scoped_ptr<LayerTreeHostImpl> host_impl = | 592 scoped_ptr<LayerTreeHostImpl> host_impl = |
598 LayerTreeHostImpl::Create(settings, | 593 LayerTreeHostImpl::Create(settings, NULL, &proxy, &stats_instrumentation, |
599 NULL, | 594 shared_bitmap_manager.get(), NULL, NULL, 0); |
600 &proxy, | |
601 &stats_instrumentation, | |
602 shared_bitmap_manager.get(), | |
603 NULL, | |
604 0); | |
605 | 595 |
606 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 596 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
607 scoped_refptr<Layer> scroll_parent = Layer::Create(); | 597 scoped_refptr<Layer> scroll_parent = Layer::Create(); |
608 layer_tree_root->AddChild(scroll_parent); | 598 layer_tree_root->AddChild(scroll_parent); |
609 layer_tree_root->AddChild(Layer::Create()); | 599 layer_tree_root->AddChild(Layer::Create()); |
610 layer_tree_root->AddChild(Layer::Create()); | 600 layer_tree_root->AddChild(Layer::Create()); |
611 | 601 |
612 host_->SetRootLayer(layer_tree_root); | 602 host_->SetRootLayer(layer_tree_root); |
613 | 603 |
614 // First child is the second and third child's scroll parent. | 604 // First child is the second and third child's scroll parent. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 } | 651 } |
662 | 652 |
663 TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { | 653 TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { |
664 LayerTreeSettings settings; | 654 LayerTreeSettings settings; |
665 FakeProxy proxy; | 655 FakeProxy proxy; |
666 DebugScopedSetImplThread impl(&proxy); | 656 DebugScopedSetImplThread impl(&proxy); |
667 FakeRenderingStatsInstrumentation stats_instrumentation; | 657 FakeRenderingStatsInstrumentation stats_instrumentation; |
668 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( | 658 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( |
669 new TestSharedBitmapManager()); | 659 new TestSharedBitmapManager()); |
670 scoped_ptr<LayerTreeHostImpl> host_impl = | 660 scoped_ptr<LayerTreeHostImpl> host_impl = |
671 LayerTreeHostImpl::Create(settings, | 661 LayerTreeHostImpl::Create(settings, NULL, &proxy, &stats_instrumentation, |
672 NULL, | 662 shared_bitmap_manager.get(), NULL, NULL, 0); |
673 &proxy, | |
674 &stats_instrumentation, | |
675 shared_bitmap_manager.get(), | |
676 NULL, | |
677 0); | |
678 | 663 |
679 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 664 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
680 scoped_refptr<Layer> clip_parent = Layer::Create(); | 665 scoped_refptr<Layer> clip_parent = Layer::Create(); |
681 scoped_refptr<Layer> intervening = Layer::Create(); | 666 scoped_refptr<Layer> intervening = Layer::Create(); |
682 scoped_refptr<Layer> clip_child1 = Layer::Create(); | 667 scoped_refptr<Layer> clip_child1 = Layer::Create(); |
683 scoped_refptr<Layer> clip_child2 = Layer::Create(); | 668 scoped_refptr<Layer> clip_child2 = Layer::Create(); |
684 layer_tree_root->AddChild(clip_parent); | 669 layer_tree_root->AddChild(clip_parent); |
685 clip_parent->AddChild(intervening); | 670 clip_parent->AddChild(intervening); |
686 intervening->AddChild(clip_child1); | 671 intervening->AddChild(clip_child1); |
687 intervening->AddChild(clip_child2); | 672 intervening->AddChild(clip_child2); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 host_impl->active_tree()); | 728 host_impl->active_tree()); |
744 | 729 |
745 // The clip children should have been unhooked. | 730 // The clip children should have been unhooked. |
746 EXPECT_EQ(2u, intervening->children().size()); | 731 EXPECT_EQ(2u, intervening->children().size()); |
747 EXPECT_FALSE(clip_child2->clip_parent()); | 732 EXPECT_FALSE(clip_child2->clip_parent()); |
748 EXPECT_FALSE(additional_clip_child->clip_parent()); | 733 EXPECT_FALSE(additional_clip_child->clip_parent()); |
749 } | 734 } |
750 | 735 |
751 } // namespace | 736 } // namespace |
752 } // namespace cc | 737 } // namespace cc |
OLD | NEW |