| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 layer_impl_tree_root.get(), | 546 layer_impl_tree_root.get(), |
| 547 host_->active_tree()); | 547 host_->active_tree()); |
| 548 } | 548 } |
| 549 | 549 |
| 550 TEST_F(TreeSynchronizerTest, SynchronizeAnimations) { | 550 TEST_F(TreeSynchronizerTest, SynchronizeAnimations) { |
| 551 LayerTreeSettings settings; | 551 LayerTreeSettings settings; |
| 552 FakeProxy proxy; | 552 FakeProxy proxy; |
| 553 DebugScopedSetImplThread impl(&proxy); | 553 DebugScopedSetImplThread impl(&proxy); |
| 554 FakeRenderingStatsInstrumentation stats_instrumentation; | 554 FakeRenderingStatsInstrumentation stats_instrumentation; |
| 555 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( | 555 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( |
| 556 settings, NULL, &proxy, &stats_instrumentation, NULL); | 556 settings, NULL, &proxy, &stats_instrumentation, NULL, 0); |
| 557 | 557 |
| 558 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 558 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
| 559 host_->SetRootLayer(layer_tree_root); | 559 host_->SetRootLayer(layer_tree_root); |
| 560 | 560 |
| 561 layer_tree_root->SetLayerAnimationControllerForTest( | 561 layer_tree_root->SetLayerAnimationControllerForTest( |
| 562 FakeLayerAnimationController::Create()); | 562 FakeLayerAnimationController::Create()); |
| 563 | 563 |
| 564 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>( | 564 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>( |
| 565 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); | 565 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); |
| 566 | 566 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 578 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>( | 578 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>( |
| 579 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); | 579 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); |
| 580 } | 580 } |
| 581 | 581 |
| 582 TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) { | 582 TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) { |
| 583 LayerTreeSettings settings; | 583 LayerTreeSettings settings; |
| 584 FakeProxy proxy; | 584 FakeProxy proxy; |
| 585 DebugScopedSetImplThread impl(&proxy); | 585 DebugScopedSetImplThread impl(&proxy); |
| 586 FakeRenderingStatsInstrumentation stats_instrumentation; | 586 FakeRenderingStatsInstrumentation stats_instrumentation; |
| 587 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( | 587 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( |
| 588 settings, NULL, &proxy, &stats_instrumentation, NULL); | 588 settings, NULL, &proxy, &stats_instrumentation, NULL, 0); |
| 589 | 589 |
| 590 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 590 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
| 591 scoped_refptr<Layer> scroll_parent = Layer::Create(); | 591 scoped_refptr<Layer> scroll_parent = Layer::Create(); |
| 592 layer_tree_root->AddChild(scroll_parent); | 592 layer_tree_root->AddChild(scroll_parent); |
| 593 layer_tree_root->AddChild(Layer::Create()); | 593 layer_tree_root->AddChild(Layer::Create()); |
| 594 layer_tree_root->AddChild(Layer::Create()); | 594 layer_tree_root->AddChild(Layer::Create()); |
| 595 | 595 |
| 596 host_->SetRootLayer(layer_tree_root); | 596 host_->SetRootLayer(layer_tree_root); |
| 597 | 597 |
| 598 // First child is the second and third child's scroll parent. | 598 // First child is the second and third child's scroll parent. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 EXPECT_FALSE(layer_tree_root->children()[0]->scroll_parent()); | 653 EXPECT_FALSE(layer_tree_root->children()[0]->scroll_parent()); |
| 654 EXPECT_FALSE(layer_tree_root->children()[1]->scroll_parent()); | 654 EXPECT_FALSE(layer_tree_root->children()[1]->scroll_parent()); |
| 655 } | 655 } |
| 656 | 656 |
| 657 TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { | 657 TEST_F(TreeSynchronizerTest, SynchronizeClipParent) { |
| 658 LayerTreeSettings settings; | 658 LayerTreeSettings settings; |
| 659 FakeProxy proxy; | 659 FakeProxy proxy; |
| 660 DebugScopedSetImplThread impl(&proxy); | 660 DebugScopedSetImplThread impl(&proxy); |
| 661 FakeRenderingStatsInstrumentation stats_instrumentation; | 661 FakeRenderingStatsInstrumentation stats_instrumentation; |
| 662 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( | 662 scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( |
| 663 settings, NULL, &proxy, &stats_instrumentation, NULL); | 663 settings, NULL, &proxy, &stats_instrumentation, NULL, 0); |
| 664 | 664 |
| 665 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 665 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
| 666 scoped_refptr<Layer> clip_parent = Layer::Create(); | 666 scoped_refptr<Layer> clip_parent = Layer::Create(); |
| 667 scoped_refptr<Layer> intervening = Layer::Create(); | 667 scoped_refptr<Layer> intervening = Layer::Create(); |
| 668 scoped_refptr<Layer> clip_child1 = Layer::Create(); | 668 scoped_refptr<Layer> clip_child1 = Layer::Create(); |
| 669 scoped_refptr<Layer> clip_child2 = Layer::Create(); | 669 scoped_refptr<Layer> clip_child2 = Layer::Create(); |
| 670 layer_tree_root->AddChild(clip_parent); | 670 layer_tree_root->AddChild(clip_parent); |
| 671 clip_parent->AddChild(intervening); | 671 clip_parent->AddChild(intervening); |
| 672 intervening->AddChild(clip_child1); | 672 intervening->AddChild(clip_child1); |
| 673 intervening->AddChild(clip_child2); | 673 intervening->AddChild(clip_child2); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 host_impl->active_tree()); | 730 host_impl->active_tree()); |
| 731 | 731 |
| 732 // The clip children should have been unhooked. | 732 // The clip children should have been unhooked. |
| 733 EXPECT_EQ(2u, intervening->children().size()); | 733 EXPECT_EQ(2u, intervening->children().size()); |
| 734 EXPECT_FALSE(clip_child2->clip_parent()); | 734 EXPECT_FALSE(clip_child2->clip_parent()); |
| 735 EXPECT_FALSE(additional_clip_child->clip_parent()); | 735 EXPECT_FALSE(additional_clip_child->clip_parent()); |
| 736 } | 736 } |
| 737 | 737 |
| 738 } // namespace | 738 } // namespace |
| 739 } // namespace cc | 739 } // namespace cc |
| OLD | NEW |