OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
8 #include "cc/test/layer_tree_test.h" | 8 #include "cc/test/layer_tree_test.h" |
9 #include "cc/test/occlusion_tracker_test_common.h" | 9 #include "cc/test/occlusion_tracker_test_common.h" |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void VerifyOcclusion(TestLayer* layer) const { | 74 void VerifyOcclusion(TestLayer* layer) const { |
75 EXPECT_EQ(layer->expected_occlusion().ToString(), | 75 EXPECT_EQ(layer->expected_occlusion().ToString(), |
76 layer->occlusion().ToString()); | 76 layer->occlusion().ToString()); |
77 | 77 |
78 for (size_t i = 0; i < layer->children().size(); ++i) { | 78 for (size_t i = 0; i < layer->children().size(); ++i) { |
79 TestLayer* child = static_cast<TestLayer*>(layer->children()[i].get()); | 79 TestLayer* child = static_cast<TestLayer*>(layer->children()[i].get()); |
80 VerifyOcclusion(child); | 80 VerifyOcclusion(child); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void SetLayerPropertiesForTesting( | 84 void SetLayerPropertiesForTesting(TestLayer* layer, |
85 TestLayer* layer, TestLayer* parent, const gfx::Transform& transform, | 85 TestLayer* parent, |
86 const gfx::PointF& position, const gfx::Size& bounds, bool opaque) const { | 86 const gfx::Transform& transform, |
| 87 gfx::PointF position, |
| 88 gfx::Size bounds, |
| 89 bool opaque) const { |
87 layer->RemoveAllChildren(); | 90 layer->RemoveAllChildren(); |
88 if (parent) | 91 if (parent) |
89 parent->AddChild(layer); | 92 parent->AddChild(layer); |
90 layer->SetTransform(transform); | 93 layer->SetTransform(transform); |
91 layer->SetPosition(position); | 94 layer->SetPosition(position); |
92 layer->SetBounds(bounds); | 95 layer->SetBounds(bounds); |
93 layer->SetContentsOpaque(opaque); | 96 layer->SetContentsOpaque(opaque); |
94 | 97 |
95 layer->SetAnchorPoint(gfx::PointF()); | 98 layer->SetAnchorPoint(gfx::PointF()); |
96 } | 99 } |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 469 |
467 layer_tree_host()->SetRootLayer(layers[0]); | 470 layer_tree_host()->SetRootLayer(layers[0]); |
468 LayerTreeTest::SetupTree(); | 471 LayerTreeTest::SetupTree(); |
469 } | 472 } |
470 }; | 473 }; |
471 | 474 |
472 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestManySurfaces); | 475 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestManySurfaces); |
473 | 476 |
474 } // namespace | 477 } // namespace |
475 } // namespace cc | 478 } // namespace cc |
OLD | NEW |