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/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 ++expected_push_properties_grandchild_; | 3097 ++expected_push_properties_grandchild_; |
3098 ++expected_push_properties_child2_; | 3098 ++expected_push_properties_child2_; |
3099 break; | 3099 break; |
3100 case 5: | 3100 case 5: |
3101 layer_tree_host()->SetNeedsCommit(); | 3101 layer_tree_host()->SetNeedsCommit(); |
3102 // No layers need commit. | 3102 // No layers need commit. |
3103 break; | 3103 break; |
3104 case 6: | 3104 case 6: |
3105 child_->RemoveFromParent(); | 3105 child_->RemoveFromParent(); |
3106 // No layers need commit. | 3106 // No layers need commit. |
| 3107 ++expected_push_properties_root_; |
3107 break; | 3108 break; |
3108 case 7: | 3109 case 7: |
3109 root_->AddChild(child_); | 3110 root_->AddChild(child_); |
3110 // Layers added to the tree get committed. | 3111 // Layers added to the tree get committed. |
3111 ++expected_push_properties_child_; | 3112 ++expected_push_properties_child_; |
3112 ++expected_push_properties_grandchild_; | 3113 ++expected_push_properties_grandchild_; |
| 3114 ++expected_push_properties_root_; |
3113 break; | 3115 break; |
3114 case 8: | 3116 case 8: |
| 3117 ++expected_push_properties_root_; |
| 3118 ++expected_push_properties_child_; |
3115 grandchild_->RemoveFromParent(); | 3119 grandchild_->RemoveFromParent(); |
3116 // No layers need commit. | 3120 // No layers need commit. |
3117 break; | 3121 break; |
3118 case 9: | 3122 case 9: |
3119 child_->AddChild(grandchild_); | 3123 child_->AddChild(grandchild_); |
3120 // Layers added to the tree get committed. | 3124 // Layers added to the tree get committed. |
3121 ++expected_push_properties_grandchild_; | 3125 ++expected_push_properties_grandchild_; |
| 3126 ++expected_push_properties_root_; |
| 3127 ++expected_push_properties_child_; |
3122 break; | 3128 break; |
3123 case 10: | 3129 case 10: |
3124 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); | 3130 layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); |
3125 // No layers need commit. | 3131 // No layers need commit. |
3126 break; | 3132 break; |
3127 case 11: | 3133 case 11: |
3128 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.8f, 1.1f); | 3134 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.8f, 1.1f); |
3129 // No layers need commit. | 3135 // No layers need commit. |
3130 break; | 3136 break; |
3131 case 12: | 3137 case 12: |
3132 child_->SetPosition(gfx::Point(1, 1)); | 3138 child_->SetPosition(gfx::Point(1, 1)); |
3133 // The modified layer needs commit | 3139 // The modified layer needs commit |
3134 ++expected_push_properties_child_; | 3140 ++expected_push_properties_child_; |
3135 break; | 3141 break; |
3136 case 13: | 3142 case 13: |
3137 child2_->SetPosition(gfx::Point(1, 1)); | 3143 child2_->SetPosition(gfx::Point(1, 1)); |
3138 // The modified layer needs commit | 3144 // The modified layer needs commit |
3139 ++expected_push_properties_child2_; | 3145 ++expected_push_properties_child2_; |
3140 break; | 3146 break; |
3141 case 14: | 3147 case 14: |
3142 child_->RemoveFromParent(); | 3148 child_->RemoveFromParent(); |
3143 root_->AddChild(child_); | 3149 root_->AddChild(child_); |
3144 // Layers added to the tree get committed. | 3150 // Layers added to the tree get committed. |
3145 ++expected_push_properties_child_; | 3151 ++expected_push_properties_child_; |
3146 ++expected_push_properties_grandchild_; | 3152 ++expected_push_properties_grandchild_; |
| 3153 ++expected_push_properties_root_; |
3147 break; | 3154 break; |
3148 case 15: | 3155 case 15: |
3149 grandchild_->SetPosition(gfx::Point(1, 1)); | 3156 grandchild_->SetPosition(gfx::Point(1, 1)); |
3150 // The modified layer needs commit | 3157 // The modified layer needs commit |
3151 ++expected_push_properties_grandchild_; | 3158 ++expected_push_properties_grandchild_; |
3152 break; | 3159 break; |
3153 case 16: | 3160 case 16: |
3154 // SetNeedsDisplay does not always set needs commit (so call it | 3161 // SetNeedsDisplay does not always set needs commit (so call it |
3155 // explicitly), but is a property change. | 3162 // explicitly), but is a property change. |
3156 child_->SetNeedsDisplay(); | 3163 child_->SetNeedsDisplay(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3249 expected_push_properties_child_impl_ = | 3256 expected_push_properties_child_impl_ = |
3250 expected_push_properties_child2_impl_; | 3257 expected_push_properties_child2_impl_; |
3251 expected_push_properties_child2_impl_ = 0; | 3258 expected_push_properties_child2_impl_ = 0; |
3252 // grandchild_impl becomes grandchild2_impl. | 3259 // grandchild_impl becomes grandchild2_impl. |
3253 expected_push_properties_grandchild_impl_ = | 3260 expected_push_properties_grandchild_impl_ = |
3254 expected_push_properties_grandchild2_impl_; | 3261 expected_push_properties_grandchild2_impl_; |
3255 expected_push_properties_grandchild2_impl_ = 0; | 3262 expected_push_properties_grandchild2_impl_ = 0; |
3256 | 3263 |
3257 // grandchild_impl is now the leaf that always pushes. It is pushed. | 3264 // grandchild_impl is now the leaf that always pushes. It is pushed. |
3258 ++expected_push_properties_grandchild_impl_; | 3265 ++expected_push_properties_grandchild_impl_; |
| 3266 ++expected_push_properties_root_impl_; |
3259 break; | 3267 break; |
3260 case 7: | 3268 case 7: |
3261 // The leaf that always pushes is pushed. | 3269 // The leaf that always pushes is pushed. |
3262 ++expected_push_properties_grandchild_impl_; | 3270 ++expected_push_properties_grandchild_impl_; |
3263 | 3271 |
3264 // Child is added back. New layers are initialized. | 3272 // Child is added back. New layers are initialized. |
3265 ++expected_push_properties_grandchild2_impl_; | 3273 ++expected_push_properties_grandchild2_impl_; |
3266 ++expected_push_properties_child2_impl_; | 3274 ++expected_push_properties_child2_impl_; |
| 3275 ++expected_push_properties_root_impl_; |
3267 break; | 3276 break; |
3268 case 8: | 3277 case 8: |
3269 // Leaf is removed. | 3278 // Leaf is removed. |
3270 expected_push_properties_grandchild2_impl_ = 0; | 3279 expected_push_properties_grandchild2_impl_ = 0; |
3271 | 3280 |
3272 // Always pushing. | 3281 // Always pushing. |
3273 ++expected_push_properties_grandchild_impl_; | 3282 ++expected_push_properties_grandchild_impl_; |
| 3283 ++expected_push_properties_child2_impl_; |
| 3284 ++expected_push_properties_root_impl_; |
3274 break; | 3285 break; |
3275 case 9: | 3286 case 9: |
3276 // Leaf is added back | 3287 // Leaf is added back |
3277 ++expected_push_properties_grandchild2_impl_; | 3288 ++expected_push_properties_grandchild2_impl_; |
3278 | 3289 |
3279 // The leaf that always pushes is pushed. | 3290 // The leaf that always pushes is pushed. |
3280 ++expected_push_properties_grandchild_impl_; | 3291 ++expected_push_properties_grandchild_impl_; |
| 3292 ++expected_push_properties_root_impl_; |
| 3293 ++expected_push_properties_child2_impl_; |
3281 break; | 3294 break; |
3282 case 10: | 3295 case 10: |
3283 // The leaf that always pushes is pushed. | 3296 // The leaf that always pushes is pushed. |
3284 ++expected_push_properties_grandchild_impl_; | 3297 ++expected_push_properties_grandchild_impl_; |
3285 break; | 3298 break; |
3286 case 11: | 3299 case 11: |
3287 // The leaf that always pushes is pushed. | 3300 // The leaf that always pushes is pushed. |
3288 ++expected_push_properties_grandchild_impl_; | 3301 ++expected_push_properties_grandchild_impl_; |
3289 break; | 3302 break; |
3290 case 12: | 3303 case 12: |
(...skipping 14 matching lines...) Expand all Loading... |
3305 // Second child is removed from tree. Don't discard counts because | 3318 // Second child is removed from tree. Don't discard counts because |
3306 // they are added back before commit. | 3319 // they are added back before commit. |
3307 | 3320 |
3308 // The leaf that always pushes is pushed. | 3321 // The leaf that always pushes is pushed. |
3309 ++expected_push_properties_grandchild_impl_; | 3322 ++expected_push_properties_grandchild_impl_; |
3310 | 3323 |
3311 // Second child added back. | 3324 // Second child added back. |
3312 ++expected_push_properties_child2_impl_; | 3325 ++expected_push_properties_child2_impl_; |
3313 ++expected_push_properties_grandchild2_impl_; | 3326 ++expected_push_properties_grandchild2_impl_; |
3314 | 3327 |
| 3328 ++expected_push_properties_root_impl_; |
3315 break; | 3329 break; |
3316 case 15: | 3330 case 15: |
3317 // The position of this child was changed. | 3331 // The position of this child was changed. |
3318 ++expected_push_properties_grandchild2_impl_; | 3332 ++expected_push_properties_grandchild2_impl_; |
3319 | 3333 |
3320 // The leaf that always pushes is pushed. | 3334 // The leaf that always pushes is pushed. |
3321 ++expected_push_properties_grandchild_impl_; | 3335 ++expected_push_properties_grandchild_impl_; |
3322 break; | 3336 break; |
3323 case 16: | 3337 case 16: |
3324 // Second child is invalidated with SetNeedsDisplay | 3338 // Second child is invalidated with SetNeedsDisplay |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3544 EXPECT_FALSE(grandchild1_->needs_push_properties()); | 3558 EXPECT_FALSE(grandchild1_->needs_push_properties()); |
3545 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3559 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3546 EXPECT_FALSE(grandchild2_->needs_push_properties()); | 3560 EXPECT_FALSE(grandchild2_->needs_push_properties()); |
3547 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3561 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3548 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3562 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3549 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3563 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3550 | 3564 |
3551 grandchild1_->RemoveFromParent(); | 3565 grandchild1_->RemoveFromParent(); |
3552 grandchild1_->SetPosition(gfx::Point(1, 1)); | 3566 grandchild1_->SetPosition(gfx::Point(1, 1)); |
3553 | 3567 |
3554 EXPECT_FALSE(root_->needs_push_properties()); | 3568 EXPECT_TRUE(root_->needs_push_properties()); |
3555 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3569 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3556 EXPECT_FALSE(child_->needs_push_properties()); | 3570 EXPECT_TRUE(child_->needs_push_properties()); |
3557 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3571 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
3558 EXPECT_FALSE(grandchild2_->needs_push_properties()); | 3572 EXPECT_FALSE(grandchild2_->needs_push_properties()); |
3559 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3573 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3560 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3574 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3561 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3575 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3562 | 3576 |
3563 child_->AddChild(grandchild1_); | 3577 child_->AddChild(grandchild1_); |
3564 | 3578 |
3565 EXPECT_FALSE(root_->needs_push_properties()); | 3579 EXPECT_TRUE(root_->needs_push_properties()); |
3566 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3580 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3567 EXPECT_FALSE(child_->needs_push_properties()); | 3581 EXPECT_TRUE(child_->needs_push_properties()); |
3568 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3582 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3569 EXPECT_TRUE(grandchild1_->needs_push_properties()); | 3583 EXPECT_TRUE(grandchild1_->needs_push_properties()); |
3570 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3584 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3571 EXPECT_FALSE(grandchild2_->needs_push_properties()); | 3585 EXPECT_FALSE(grandchild2_->needs_push_properties()); |
3572 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3586 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3573 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3587 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3574 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3588 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3575 | 3589 |
3576 grandchild2_->SetPosition(gfx::Point(1, 1)); | 3590 grandchild2_->SetPosition(gfx::Point(1, 1)); |
3577 | 3591 |
3578 EXPECT_FALSE(root_->needs_push_properties()); | 3592 EXPECT_TRUE(root_->needs_push_properties()); |
3579 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3593 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3580 EXPECT_FALSE(child_->needs_push_properties()); | 3594 EXPECT_TRUE(child_->needs_push_properties()); |
3581 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3595 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3582 EXPECT_TRUE(grandchild1_->needs_push_properties()); | 3596 EXPECT_TRUE(grandchild1_->needs_push_properties()); |
3583 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3597 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3584 EXPECT_TRUE(grandchild2_->needs_push_properties()); | 3598 EXPECT_TRUE(grandchild2_->needs_push_properties()); |
3585 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3599 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3586 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3600 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3587 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3601 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3588 | 3602 |
3589 // grandchild2_ will still need a push properties. | 3603 // grandchild2_ will still need a push properties. |
3590 grandchild1_->RemoveFromParent(); | 3604 grandchild1_->RemoveFromParent(); |
3591 | 3605 |
3592 EXPECT_FALSE(root_->needs_push_properties()); | 3606 EXPECT_TRUE(root_->needs_push_properties()); |
3593 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3607 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3594 EXPECT_FALSE(child_->needs_push_properties()); | 3608 EXPECT_TRUE(child_->needs_push_properties()); |
3595 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3609 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3596 | 3610 |
3597 // grandchild3_ does not need a push properties, so recursing should | 3611 // grandchild3_ does not need a push properties, so recursing should |
3598 // no longer be needed. | 3612 // no longer be needed. |
3599 grandchild2_->RemoveFromParent(); | 3613 grandchild2_->RemoveFromParent(); |
3600 | 3614 |
3601 EXPECT_FALSE(root_->needs_push_properties()); | 3615 EXPECT_TRUE(root_->needs_push_properties()); |
3602 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3616 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3603 EXPECT_FALSE(child_->needs_push_properties()); | 3617 EXPECT_TRUE(child_->needs_push_properties()); |
3604 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3618 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
3605 EndTest(); | 3619 EndTest(); |
3606 break; | 3620 break; |
3607 } | 3621 } |
3608 } | 3622 } |
3609 }; | 3623 }; |
3610 | 3624 |
3611 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion); | 3625 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion); |
3612 | 3626 |
3613 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence | 3627 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence |
(...skipping 15 matching lines...) Expand all Loading... |
3629 EXPECT_TRUE(grandchild1_->needs_push_properties()); | 3643 EXPECT_TRUE(grandchild1_->needs_push_properties()); |
3630 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3644 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3631 EXPECT_TRUE(grandchild2_->needs_push_properties()); | 3645 EXPECT_TRUE(grandchild2_->needs_push_properties()); |
3632 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3646 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3633 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3647 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3634 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3648 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3635 | 3649 |
3636 // grandchild2_ will still need a push properties. | 3650 // grandchild2_ will still need a push properties. |
3637 grandchild1_->RemoveFromParent(); | 3651 grandchild1_->RemoveFromParent(); |
3638 | 3652 |
3639 EXPECT_FALSE(root_->needs_push_properties()); | 3653 // We will need push properties because our drawable children changed |
| 3654 EXPECT_TRUE(root_->needs_push_properties()); |
3640 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3655 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3641 EXPECT_FALSE(child_->needs_push_properties()); | 3656 EXPECT_TRUE(child_->needs_push_properties()); |
3642 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3657 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3643 | 3658 |
3644 // grandchild3_ does not need a push properties, so recursing should | 3659 // grandchild3_ does not need a push properties, so recursing should |
3645 // no longer be needed. | 3660 // no longer be needed. |
3646 grandchild2_->RemoveFromParent(); | 3661 grandchild2_->RemoveFromParent(); |
3647 | 3662 |
3648 EXPECT_FALSE(root_->needs_push_properties()); | 3663 EXPECT_TRUE(root_->needs_push_properties()); |
3649 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3664 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3650 EXPECT_FALSE(child_->needs_push_properties()); | 3665 EXPECT_TRUE(child_->needs_push_properties()); |
3651 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3666 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
3652 EndTest(); | 3667 EndTest(); |
3653 break; | 3668 break; |
3654 } | 3669 } |
3655 } | 3670 } |
3656 }; | 3671 }; |
3657 | 3672 |
3658 MULTI_THREAD_TEST_F( | 3673 MULTI_THREAD_TEST_F( |
3659 LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence); | 3674 LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence); |
3660 | 3675 |
(...skipping 17 matching lines...) Expand all Loading... |
3678 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3693 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3679 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3694 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3680 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3695 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3681 | 3696 |
3682 // Change grandchildren while their parent is not in the tree. | 3697 // Change grandchildren while their parent is not in the tree. |
3683 child_->RemoveFromParent(); | 3698 child_->RemoveFromParent(); |
3684 grandchild1_->SetPosition(gfx::Point(1, 1)); | 3699 grandchild1_->SetPosition(gfx::Point(1, 1)); |
3685 grandchild2_->SetPosition(gfx::Point(1, 1)); | 3700 grandchild2_->SetPosition(gfx::Point(1, 1)); |
3686 root_->AddChild(child_); | 3701 root_->AddChild(child_); |
3687 | 3702 |
3688 EXPECT_FALSE(root_->needs_push_properties()); | 3703 EXPECT_TRUE(root_->needs_push_properties()); |
3689 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3704 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3690 EXPECT_TRUE(child_->needs_push_properties()); | 3705 EXPECT_TRUE(child_->needs_push_properties()); |
3691 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3706 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3692 EXPECT_TRUE(grandchild1_->needs_push_properties()); | 3707 EXPECT_TRUE(grandchild1_->needs_push_properties()); |
3693 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3708 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3694 EXPECT_TRUE(grandchild2_->needs_push_properties()); | 3709 EXPECT_TRUE(grandchild2_->needs_push_properties()); |
3695 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3710 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3696 EXPECT_TRUE(grandchild3_->needs_push_properties()); | 3711 EXPECT_TRUE(grandchild3_->needs_push_properties()); |
3697 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3712 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3698 | 3713 |
3699 grandchild1_->RemoveFromParent(); | 3714 grandchild1_->RemoveFromParent(); |
3700 | 3715 |
3701 EXPECT_FALSE(root_->needs_push_properties()); | 3716 EXPECT_TRUE(root_->needs_push_properties()); |
3702 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3717 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3703 EXPECT_TRUE(child_->needs_push_properties()); | 3718 EXPECT_TRUE(child_->needs_push_properties()); |
3704 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3719 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3705 | 3720 |
3706 grandchild2_->RemoveFromParent(); | 3721 grandchild2_->RemoveFromParent(); |
3707 | 3722 |
3708 EXPECT_FALSE(root_->needs_push_properties()); | 3723 EXPECT_TRUE(root_->needs_push_properties()); |
3709 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3724 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3710 EXPECT_TRUE(child_->needs_push_properties()); | 3725 EXPECT_TRUE(child_->needs_push_properties()); |
3711 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3726 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3712 | 3727 |
3713 grandchild3_->RemoveFromParent(); | 3728 grandchild3_->RemoveFromParent(); |
3714 | 3729 |
3715 EXPECT_FALSE(root_->needs_push_properties()); | 3730 EXPECT_TRUE(root_->needs_push_properties()); |
3716 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3731 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3717 EXPECT_TRUE(child_->needs_push_properties()); | 3732 EXPECT_TRUE(child_->needs_push_properties()); |
3718 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3733 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
3719 | 3734 |
3720 EndTest(); | 3735 EndTest(); |
3721 break; | 3736 break; |
3722 } | 3737 } |
3723 } | 3738 } |
3724 }; | 3739 }; |
3725 | 3740 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3757 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3772 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3758 EXPECT_TRUE(grandchild1_->needs_push_properties()); | 3773 EXPECT_TRUE(grandchild1_->needs_push_properties()); |
3759 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3774 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3760 EXPECT_TRUE(grandchild2_->needs_push_properties()); | 3775 EXPECT_TRUE(grandchild2_->needs_push_properties()); |
3761 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3776 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3762 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3777 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3763 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3778 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3764 | 3779 |
3765 grandchild1_->RemoveFromParent(); | 3780 grandchild1_->RemoveFromParent(); |
3766 | 3781 |
3767 EXPECT_FALSE(root_->needs_push_properties()); | 3782 EXPECT_TRUE(root_->needs_push_properties()); |
3768 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3783 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3769 EXPECT_TRUE(child_->needs_push_properties()); | 3784 EXPECT_TRUE(child_->needs_push_properties()); |
3770 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3785 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3771 | 3786 |
3772 grandchild2_->RemoveFromParent(); | 3787 grandchild2_->RemoveFromParent(); |
3773 | 3788 |
3774 EXPECT_FALSE(root_->needs_push_properties()); | 3789 EXPECT_TRUE(root_->needs_push_properties()); |
3775 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3790 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3776 EXPECT_TRUE(child_->needs_push_properties()); | 3791 EXPECT_TRUE(child_->needs_push_properties()); |
3777 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3792 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
3778 | 3793 |
3779 child_->RemoveFromParent(); | 3794 child_->RemoveFromParent(); |
3780 | 3795 |
3781 EXPECT_FALSE(root_->needs_push_properties()); | 3796 EXPECT_TRUE(root_->needs_push_properties()); |
3782 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3797 EXPECT_FALSE(root_->descendant_needs_push_properties()); |
3783 | 3798 |
3784 EndTest(); | 3799 EndTest(); |
3785 break; | 3800 break; |
3786 } | 3801 } |
3787 } | 3802 } |
3788 }; | 3803 }; |
3789 | 3804 |
3790 MULTI_THREAD_TEST_F( | 3805 MULTI_THREAD_TEST_F( |
3791 LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild); | 3806 LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild); |
(...skipping 29 matching lines...) Expand all Loading... |
3821 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3836 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3822 EXPECT_TRUE(grandchild1_->needs_push_properties()); | 3837 EXPECT_TRUE(grandchild1_->needs_push_properties()); |
3823 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); | 3838 EXPECT_FALSE(grandchild1_->descendant_needs_push_properties()); |
3824 EXPECT_TRUE(grandchild2_->needs_push_properties()); | 3839 EXPECT_TRUE(grandchild2_->needs_push_properties()); |
3825 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); | 3840 EXPECT_FALSE(grandchild2_->descendant_needs_push_properties()); |
3826 EXPECT_FALSE(grandchild3_->needs_push_properties()); | 3841 EXPECT_FALSE(grandchild3_->needs_push_properties()); |
3827 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); | 3842 EXPECT_FALSE(grandchild3_->descendant_needs_push_properties()); |
3828 | 3843 |
3829 grandchild1_->RemoveFromParent(); | 3844 grandchild1_->RemoveFromParent(); |
3830 | 3845 |
3831 EXPECT_FALSE(root_->needs_push_properties()); | 3846 EXPECT_TRUE(root_->needs_push_properties()); |
3832 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3847 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3833 EXPECT_TRUE(child_->needs_push_properties()); | 3848 EXPECT_TRUE(child_->needs_push_properties()); |
3834 EXPECT_TRUE(child_->descendant_needs_push_properties()); | 3849 EXPECT_TRUE(child_->descendant_needs_push_properties()); |
3835 | 3850 |
3836 grandchild2_->RemoveFromParent(); | 3851 grandchild2_->RemoveFromParent(); |
3837 | 3852 |
3838 EXPECT_FALSE(root_->needs_push_properties()); | 3853 EXPECT_TRUE(root_->needs_push_properties()); |
3839 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3854 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3840 EXPECT_TRUE(child_->needs_push_properties()); | 3855 EXPECT_TRUE(child_->needs_push_properties()); |
3841 EXPECT_FALSE(child_->descendant_needs_push_properties()); | 3856 EXPECT_FALSE(child_->descendant_needs_push_properties()); |
3842 | 3857 |
3843 child_->RemoveFromParent(); | 3858 child_->RemoveFromParent(); |
3844 | 3859 |
3845 EXPECT_FALSE(root_->needs_push_properties()); | 3860 EXPECT_TRUE(root_->needs_push_properties()); |
3846 EXPECT_FALSE(root_->descendant_needs_push_properties()); | 3861 EXPECT_FALSE(root_->descendant_needs_push_properties()); |
3847 | 3862 |
3848 EndTest(); | 3863 EndTest(); |
3849 break; | 3864 break; |
3850 } | 3865 } |
3851 } | 3866 } |
3852 }; | 3867 }; |
3853 | 3868 |
3854 MULTI_THREAD_TEST_F( | 3869 MULTI_THREAD_TEST_F( |
3855 LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent); | 3870 LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent); |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4898 const gfx::Size bounds_; | 4913 const gfx::Size bounds_; |
4899 FakeContentLayerClient client_; | 4914 FakeContentLayerClient client_; |
4900 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; | 4915 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; |
4901 scoped_refptr<FakePictureLayer> picture_layer_; | 4916 scoped_refptr<FakePictureLayer> picture_layer_; |
4902 Layer* child_layer_; | 4917 Layer* child_layer_; |
4903 }; | 4918 }; |
4904 | 4919 |
4905 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); | 4920 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); |
4906 | 4921 |
4907 } // namespace cc | 4922 } // namespace cc |
OLD | NEW |