Chromium Code Reviews| Index: cc/trees/layer_tree_host_unittest_occlusion.cc |
| diff --git a/cc/trees/layer_tree_host_unittest_occlusion.cc b/cc/trees/layer_tree_host_unittest_occlusion.cc |
| index 41d91da8152130e619b269ff2f8b57fdb2181f76..02a447f68f1bdbee0dca5b269ba4bcf39ca8b44e 100644 |
| --- a/cc/trees/layer_tree_host_unittest_occlusion.cc |
| +++ b/cc/trees/layer_tree_host_unittest_occlusion.cc |
| @@ -35,6 +35,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnLayer |
| root->SetIsDrawable(true); |
| scoped_refptr<Layer> child = Layer::Create(); |
| + child_ = child.get(); |
| child->SetBounds(gfx::Size(50, 60)); |
| child->SetPosition(gfx::PointF(10.f, 5.5f)); |
| child->SetContentsOpaque(true); |
| @@ -49,7 +50,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnLayer |
| void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| LayerImpl* root = impl->active_tree()->root_layer(); |
| - LayerImpl* child = root->children()[0]; |
| + LayerImpl* child = impl->active_tree()->LayerById(child_->id()); |
| // Verify the draw properties are valid. |
| EXPECT_TRUE(root->IsDrawnRenderSurfaceLayerListMember()); |
| @@ -67,6 +68,9 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnLayer |
| } |
| void AfterTest() override {} |
| + |
| + private: |
| + Layer* child_; |
|
ajuma
2016/04/20 21:40:52
scoped_refptr
sunxd
2016/04/21 17:31:15
Done.
|
| }; |
| SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestDrawPropertiesOnLayer); |
| @@ -81,6 +85,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnSurface |
| root->SetIsDrawable(true); |
| scoped_refptr<Layer> child = Layer::Create(); |
| + child_ = child.get(); |
| child->SetBounds(gfx::Size(1, 1)); |
| child->SetPosition(gfx::PointF(10.f, 5.5f)); |
| child->SetIsDrawable(true); |
| @@ -102,7 +107,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnSurface |
| void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| LayerImpl* root = impl->active_tree()->root_layer(); |
| - LayerImpl* child = root->children()[0]; |
| + LayerImpl* child = impl->active_tree()->LayerById(child_->id()); |
| RenderSurfaceImpl* surface = child->render_surface(); |
| // Verify the draw properties are valid. |
| @@ -119,6 +124,9 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnSurface |
| } |
| void AfterTest() override {} |
| + |
| + private: |
| + Layer* child_; |
|
ajuma
2016/04/20 21:40:52
scoped_refptr
sunxd
2016/04/21 17:31:15
Done.
|
| }; |
| SINGLE_AND_MULTI_THREAD_TEST_F( |
| @@ -134,6 +142,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnMask |
| root->SetIsDrawable(true); |
| scoped_refptr<Layer> child = Layer::Create(); |
| + child_ = child.get(); |
| child->SetBounds(gfx::Size(30, 40)); |
| child->SetPosition(gfx::PointF(10.f, 5.5f)); |
| child->SetIsDrawable(true); |
| @@ -166,7 +175,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnMask |
| void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| LayerImpl* root = impl->active_tree()->root_layer(); |
| - LayerImpl* child = root->children()[0]; |
| + LayerImpl* child = impl->active_tree()->LayerById(child_->id()); |
| RenderSurfaceImpl* surface = child->render_surface(); |
| LayerImpl* mask = child->mask_layer(); |
| @@ -188,7 +197,9 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnMask |
| void AfterTest() override {} |
| + private: |
| FakeContentLayerClient client_; |
| + Layer* child_; |
|
ajuma
2016/04/20 21:40:52
scoped_refptr
sunxd
2016/04/21 17:31:15
Done.
|
| }; |
| SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestDrawPropertiesOnMask); |
| @@ -206,6 +217,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnScaledMask |
| scale.Scale(2, 2); |
| scoped_refptr<Layer> child = Layer::Create(); |
| + child_ = child.get(); |
| child->SetBounds(gfx::Size(30, 40)); |
| child->SetTransform(scale); |
| root->AddChild(child); |
| @@ -236,8 +248,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnScaledMask |
| void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| - LayerImpl* root = impl->active_tree()->root_layer(); |
| - LayerImpl* child = root->children()[0]; |
| + LayerImpl* child = impl->active_tree()->LayerById(child_->id()); |
| LayerImpl* mask = child->mask_layer(); |
| gfx::Transform scale; |
| @@ -252,7 +263,9 @@ class LayerTreeHostOcclusionTestDrawPropertiesOnScaledMask |
| void AfterTest() override {} |
| + private: |
| FakeContentLayerClient client_; |
| + Layer* child_; |
|
ajuma
2016/04/20 21:40:52
scoped_refptr
sunxd
2016/04/21 17:31:16
Done.
|
| }; |
| SINGLE_AND_MULTI_THREAD_TEST_F( |
| @@ -271,6 +284,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesInsideReplica |
| root->SetIsDrawable(true); |
| scoped_refptr<Layer> child = Layer::Create(); |
| + child_ = child.get(); |
| child->SetBounds(gfx::Size(1, 1)); |
| child->SetPosition(gfx::PointF(10.f, 5.5f)); |
| child->SetIsDrawable(true); |
| @@ -304,7 +318,7 @@ class LayerTreeHostOcclusionTestDrawPropertiesInsideReplica |
| void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| LayerImpl* root = impl->active_tree()->root_layer(); |
| - LayerImpl* child = root->children()[0]; |
| + LayerImpl* child = impl->active_tree()->LayerById(child_->id()); |
| RenderSurfaceImpl* surface = child->render_surface(); |
| LayerImpl* mask = child->mask_layer(); |
| @@ -330,7 +344,9 @@ class LayerTreeHostOcclusionTestDrawPropertiesInsideReplica |
| void AfterTest() override {} |
| + private: |
| FakeContentLayerClient client_; |
| + Layer* child_; |
|
ajuma
2016/04/20 21:40:52
scoped_refptr
sunxd
2016/04/21 17:31:16
Done.
|
| }; |
| SINGLE_AND_MULTI_THREAD_TEST_F( |