| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 3203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3214 // Root is swapped here. | 3214 // Root is swapped here. |
| 3215 // Clear the expected push properties the tree will be rebuilt. | 3215 // Clear the expected push properties the tree will be rebuilt. |
| 3216 expected_push_properties_root_impl_ = 0; | 3216 expected_push_properties_root_impl_ = 0; |
| 3217 expected_push_properties_child_impl_ = 0; | 3217 expected_push_properties_child_impl_ = 0; |
| 3218 expected_push_properties_grandchild_impl_ = 0; | 3218 expected_push_properties_grandchild_impl_ = 0; |
| 3219 expected_push_properties_child2_impl_ = 0; | 3219 expected_push_properties_child2_impl_ = 0; |
| 3220 expected_push_properties_grandchild2_impl_ = 0; | 3220 expected_push_properties_grandchild2_impl_ = 0; |
| 3221 | 3221 |
| 3222 // Make sure the new root is pushed. | 3222 // Make sure the new root is pushed. |
| 3223 EXPECT_EQ(1u, static_cast<PushPropertiesCountingLayerImpl*>( | 3223 EXPECT_EQ(1u, static_cast<PushPropertiesCountingLayerImpl*>( |
| 3224 host_impl->RootLayer())->push_properties_count()); | 3224 host_impl->active_tree()->root_layer()) |
| 3225 ->push_properties_count()); |
| 3225 return; | 3226 return; |
| 3226 case 4: | 3227 case 4: |
| 3227 // Root is swapped back all of the layers in the tree get pushed. | 3228 // Root is swapped back all of the layers in the tree get pushed. |
| 3228 ++expected_push_properties_root_impl_; | 3229 ++expected_push_properties_root_impl_; |
| 3229 ++expected_push_properties_child_impl_; | 3230 ++expected_push_properties_child_impl_; |
| 3230 ++expected_push_properties_grandchild_impl_; | 3231 ++expected_push_properties_grandchild_impl_; |
| 3231 ++expected_push_properties_child2_impl_; | 3232 ++expected_push_properties_child2_impl_; |
| 3232 ++expected_push_properties_grandchild2_impl_; | 3233 ++expected_push_properties_grandchild2_impl_; |
| 3233 break; | 3234 break; |
| 3234 case 5: | 3235 case 5: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3319 | 3320 |
| 3320 PushPropertiesCountingLayerImpl* root_impl_ = NULL; | 3321 PushPropertiesCountingLayerImpl* root_impl_ = NULL; |
| 3321 PushPropertiesCountingLayerImpl* child_impl_ = NULL; | 3322 PushPropertiesCountingLayerImpl* child_impl_ = NULL; |
| 3322 PushPropertiesCountingLayerImpl* child2_impl_ = NULL; | 3323 PushPropertiesCountingLayerImpl* child2_impl_ = NULL; |
| 3323 PushPropertiesCountingLayerImpl* grandchild_impl_ = NULL; | 3324 PushPropertiesCountingLayerImpl* grandchild_impl_ = NULL; |
| 3324 PushPropertiesCountingLayerImpl* leaf_always_pushing_layer_impl_ = NULL; | 3325 PushPropertiesCountingLayerImpl* leaf_always_pushing_layer_impl_ = NULL; |
| 3325 | 3326 |
| 3326 // Pull the layers that we need from the tree assuming the same structure | 3327 // Pull the layers that we need from the tree assuming the same structure |
| 3327 // as LayerTreeHostTestLayersPushProperties | 3328 // as LayerTreeHostTestLayersPushProperties |
| 3328 root_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( | 3329 root_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( |
| 3329 host_impl->RootLayer()); | 3330 host_impl->active_tree()->root_layer()); |
| 3330 | 3331 |
| 3331 LayerTreeImpl* impl = root_impl_->layer_tree_impl(); | 3332 LayerTreeImpl* impl = root_impl_->layer_tree_impl(); |
| 3332 if (impl->LayerById(child_->id())) { | 3333 if (impl->LayerById(child_->id())) { |
| 3333 child_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( | 3334 child_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( |
| 3334 impl->LayerById(child_->id())); | 3335 impl->LayerById(child_->id())); |
| 3335 | 3336 |
| 3336 if (impl->LayerById(grandchild_->id())) | 3337 if (impl->LayerById(grandchild_->id())) |
| 3337 grandchild_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( | 3338 grandchild_impl_ = static_cast<PushPropertiesCountingLayerImpl*>( |
| 3338 impl->LayerById(grandchild_->id())); | 3339 impl->LayerById(grandchild_->id())); |
| 3339 } | 3340 } |
| (...skipping 3328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6668 EndTest(); | 6669 EndTest(); |
| 6669 } | 6670 } |
| 6670 | 6671 |
| 6671 void AfterTest() override {} | 6672 void AfterTest() override {} |
| 6672 }; | 6673 }; |
| 6673 | 6674 |
| 6674 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6675 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
| 6675 | 6676 |
| 6676 } // namespace | 6677 } // namespace |
| 6677 } // namespace cc | 6678 } // namespace cc |
| OLD | NEW |