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_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 5213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5224 | 5224 |
5225 child_ptr = root_layer->layer_tree_impl()->LayerById(2); | 5225 child_ptr = root_layer->layer_tree_impl()->LayerById(2); |
5226 tree = root_layer->layer_tree_impl()->property_trees()->effect_tree; | 5226 tree = root_layer->layer_tree_impl()->property_trees()->effect_tree; |
5227 node = tree.Node(child_ptr->effect_tree_index()); | 5227 node = tree.Node(child_ptr->effect_tree_index()); |
5228 EXPECT_TRUE(node->data.is_drawn); | 5228 EXPECT_TRUE(node->data.is_drawn); |
5229 EXPECT_TRUE(tree.ContributesToDrawnSurface(child_ptr->effect_tree_index())); | 5229 EXPECT_TRUE(tree.ContributesToDrawnSurface(child_ptr->effect_tree_index())); |
5230 | 5230 |
5231 // But if the opacity of the layer remains 0 after activation, it should not | 5231 // But if the opacity of the layer remains 0 after activation, it should not |
5232 // be drawn. | 5232 // be drawn. |
5233 host_impl.ActivateSyncTree(); | 5233 host_impl.ActivateSyncTree(); |
5234 host_impl.active_tree()->SetRootLayerFromLayerListForTesting(); | 5234 LayerImpl* active_root = host_impl.active_tree()->LayerById(root_layer->id()); |
5235 LayerImpl* active_root = host_impl.active_tree()->root_layer_for_testing(); | |
5236 LayerImpl* active_child = host_impl.active_tree()->LayerById(child_ptr->id()); | 5235 LayerImpl* active_child = host_impl.active_tree()->LayerById(child_ptr->id()); |
5237 | 5236 |
5238 EffectTree& active_effect_tree = | 5237 EffectTree& active_effect_tree = |
5239 host_impl.active_tree()->property_trees()->effect_tree; | 5238 host_impl.active_tree()->property_trees()->effect_tree; |
5240 EXPECT_TRUE(active_effect_tree.needs_update()); | 5239 EXPECT_TRUE(active_effect_tree.needs_update()); |
5241 | 5240 |
5242 ExecuteCalculateDrawProperties(active_root); | 5241 ExecuteCalculateDrawProperties(active_root); |
5243 | 5242 |
5244 node = active_effect_tree.Node(active_child->effect_tree_index()); | 5243 node = active_effect_tree.Node(active_child->effect_tree_index()); |
5245 EXPECT_FALSE(node->data.is_drawn); | 5244 EXPECT_FALSE(node->data.is_drawn); |
(...skipping 5148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10394 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10393 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
10395 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10394 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
10396 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10395 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
10397 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10396 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
10398 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10397 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
10399 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10398 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
10400 } | 10399 } |
10401 | 10400 |
10402 } // namespace | 10401 } // namespace |
10403 } // namespace cc | 10402 } // namespace cc |
OLD | NEW |