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/layers/picture_layer.h" | 8 #include "cc/layers/picture_layer.h" |
9 #include "cc/test/fake_content_layer_client.h" | 9 #include "cc/test/fake_content_layer_client.h" |
10 #include "cc/test/layer_tree_test.h" | 10 #include "cc/test/layer_tree_test.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 scoped_refptr<Layer> child2 = Layer::Create(layer_settings()); | 153 scoped_refptr<Layer> child2 = Layer::Create(layer_settings()); |
154 child2->SetBounds(gfx::Size(10, 12)); | 154 child2->SetBounds(gfx::Size(10, 12)); |
155 child2->SetPosition(gfx::PointF(13.f, 8.5f)); | 155 child2->SetPosition(gfx::PointF(13.f, 8.5f)); |
156 child2->SetContentsOpaque(true); | 156 child2->SetContentsOpaque(true); |
157 child2->SetIsDrawable(true); | 157 child2->SetIsDrawable(true); |
158 root->AddChild(child2); | 158 root->AddChild(child2); |
159 | 159 |
160 layer_tree_host()->SetRootLayer(root); | 160 layer_tree_host()->SetRootLayer(root); |
161 LayerTreeTest::SetupTree(); | 161 LayerTreeTest::SetupTree(); |
| 162 client_.set_bounds(root->bounds()); |
162 } | 163 } |
163 | 164 |
164 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 165 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
165 | 166 |
166 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { | 167 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
167 LayerImpl* root = impl->active_tree()->root_layer(); | 168 LayerImpl* root = impl->active_tree()->root_layer(); |
168 LayerImpl* child = root->children()[0].get(); | 169 LayerImpl* child = root->children()[0].get(); |
169 RenderSurfaceImpl* surface = child->render_surface(); | 170 RenderSurfaceImpl* surface = child->render_surface(); |
170 LayerImpl* mask = child->mask_layer(); | 171 LayerImpl* mask = child->mask_layer(); |
171 | 172 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 225 |
225 scoped_refptr<Layer> child2 = Layer::Create(layer_settings()); | 226 scoped_refptr<Layer> child2 = Layer::Create(layer_settings()); |
226 child2->SetBounds(gfx::Size(10, 12)); | 227 child2->SetBounds(gfx::Size(10, 12)); |
227 child2->SetPosition(gfx::PointF(13.f, 8.5f)); | 228 child2->SetPosition(gfx::PointF(13.f, 8.5f)); |
228 child2->SetContentsOpaque(true); | 229 child2->SetContentsOpaque(true); |
229 child2->SetIsDrawable(true); | 230 child2->SetIsDrawable(true); |
230 root->AddChild(child2); | 231 root->AddChild(child2); |
231 | 232 |
232 layer_tree_host()->SetRootLayer(root); | 233 layer_tree_host()->SetRootLayer(root); |
233 LayerTreeTest::SetupTree(); | 234 LayerTreeTest::SetupTree(); |
| 235 client_.set_bounds(root->bounds()); |
234 } | 236 } |
235 | 237 |
236 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 238 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
237 | 239 |
238 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { | 240 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
239 LayerImpl* root = impl->active_tree()->root_layer(); | 241 LayerImpl* root = impl->active_tree()->root_layer(); |
240 LayerImpl* child = root->children()[0].get(); | 242 LayerImpl* child = root->children()[0].get(); |
241 RenderSurfaceImpl* surface = child->render_surface(); | 243 RenderSurfaceImpl* surface = child->render_surface(); |
242 LayerImpl* mask = child->mask_layer(); | 244 LayerImpl* mask = child->mask_layer(); |
243 | 245 |
(...skipping 19 matching lines...) Expand all Loading... |
263 void AfterTest() override {} | 265 void AfterTest() override {} |
264 | 266 |
265 FakeContentLayerClient client_; | 267 FakeContentLayerClient client_; |
266 }; | 268 }; |
267 | 269 |
268 SINGLE_AND_MULTI_THREAD_TEST_F( | 270 SINGLE_AND_MULTI_THREAD_TEST_F( |
269 LayerTreeHostOcclusionTestDrawPropertiesInsideReplica); | 271 LayerTreeHostOcclusionTestDrawPropertiesInsideReplica); |
270 | 272 |
271 } // namespace | 273 } // namespace |
272 } // namespace cc | 274 } // namespace cc |
OLD | NEW |