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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
11 #include "cc/animation/transform_operations.h" | 11 #include "cc/animation/transform_operations.h" |
12 #include "cc/base/math_util.h" | 12 #include "cc/base/math_util.h" |
13 #include "cc/layers/content_layer.h" | 13 #include "cc/layers/content_layer.h" |
14 #include "cc/layers/content_layer_client.h" | 14 #include "cc/layers/content_layer_client.h" |
15 #include "cc/layers/layer.h" | 15 #include "cc/layers/layer.h" |
16 #include "cc/layers/layer_client.h" | 16 #include "cc/layers/layer_client.h" |
17 #include "cc/layers/layer_impl.h" | 17 #include "cc/layers/layer_impl.h" |
18 #include "cc/layers/layer_iterator.h" | 18 #include "cc/layers/layer_iterator.h" |
19 #include "cc/layers/render_surface.h" | 19 #include "cc/layers/render_surface.h" |
20 #include "cc/layers/render_surface_impl.h" | 20 #include "cc/layers/render_surface_impl.h" |
21 #include "cc/output/copy_output_request.h" | 21 #include "cc/output/copy_output_request.h" |
22 #include "cc/output/copy_output_result.h" | 22 #include "cc/output/copy_output_result.h" |
23 #include "cc/test/animation_test_common.h" | 23 #include "cc/test/animation_test_common.h" |
24 #include "cc/test/fake_content_layer.h" | |
25 #include "cc/test/fake_content_layer_client.h" | 24 #include "cc/test/fake_content_layer_client.h" |
26 #include "cc/test/fake_content_layer_impl.h" | |
27 #include "cc/test/fake_impl_proxy.h" | 25 #include "cc/test/fake_impl_proxy.h" |
28 #include "cc/test/fake_layer_tree_host.h" | 26 #include "cc/test/fake_layer_tree_host.h" |
29 #include "cc/test/fake_layer_tree_host_impl.h" | 27 #include "cc/test/fake_layer_tree_host_impl.h" |
30 #include "cc/test/fake_picture_layer.h" | 28 #include "cc/test/fake_picture_layer.h" |
31 #include "cc/test/fake_picture_layer_impl.h" | 29 #include "cc/test/fake_picture_layer_impl.h" |
32 #include "cc/test/geometry_test_utils.h" | 30 #include "cc/test/geometry_test_utils.h" |
33 #include "cc/test/layer_tree_host_common_test.h" | 31 #include "cc/test/layer_tree_host_common_test.h" |
34 #include "cc/test/test_task_graph_runner.h" | 32 #include "cc/test/test_task_graph_runner.h" |
35 #include "cc/trees/layer_tree_impl.h" | 33 #include "cc/trees/layer_tree_impl.h" |
36 #include "cc/trees/proxy.h" | 34 #include "cc/trees/proxy.h" |
(...skipping 9311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9348 } | 9346 } |
9349 | 9347 |
9350 TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) { | 9348 TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) { |
9351 gfx::Transform identity; | 9349 gfx::Transform identity; |
9352 FakeContentLayerClient client; | 9350 FakeContentLayerClient client; |
9353 scoped_refptr<Layer> root = Layer::Create(layer_settings()); | 9351 scoped_refptr<Layer> root = Layer::Create(layer_settings()); |
9354 scoped_refptr<LayerWithForcedDrawsContent> child = | 9352 scoped_refptr<LayerWithForcedDrawsContent> child = |
9355 make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings())); | 9353 make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings())); |
9356 scoped_refptr<LayerWithForcedDrawsContent> grandchild = | 9354 scoped_refptr<LayerWithForcedDrawsContent> grandchild = |
9357 make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings())); | 9355 make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings())); |
9358 scoped_refptr<FakeContentLayer> greatgrandchild( | 9356 scoped_refptr<FakePictureLayer> greatgrandchild( |
9359 FakeContentLayer::Create(layer_settings(), &client)); | 9357 FakePictureLayer::Create(layer_settings(), &client)); |
9360 SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), | 9358 SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), |
9361 gfx::PointF(), gfx::Size(100, 100), true, false); | 9359 gfx::PointF(), gfx::Size(100, 100), true, false); |
9362 SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(), | 9360 SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(), |
9363 gfx::PointF(), gfx::Size(10, 10), true, false); | 9361 gfx::PointF(), gfx::Size(10, 10), true, false); |
9364 SetLayerPropertiesForTesting(grandchild.get(), identity, gfx::Point3F(), | 9362 SetLayerPropertiesForTesting(grandchild.get(), identity, gfx::Point3F(), |
9365 gfx::PointF(), gfx::Size(10, 10), true, false); | 9363 gfx::PointF(), gfx::Size(10, 10), true, false); |
9366 SetLayerPropertiesForTesting(greatgrandchild.get(), identity, gfx::Point3F(), | 9364 SetLayerPropertiesForTesting(greatgrandchild.get(), identity, gfx::Point3F(), |
9367 gfx::PointF(), gfx::Size(10, 10), true, false); | 9365 gfx::PointF(), gfx::Size(10, 10), true, false); |
9368 | 9366 |
9369 root->AddChild(child); | 9367 root->AddChild(child); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9421 FakeImplProxy proxy; | 9419 FakeImplProxy proxy; |
9422 TestSharedBitmapManager shared_bitmap_manager; | 9420 TestSharedBitmapManager shared_bitmap_manager; |
9423 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr); | 9421 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr); |
9424 | 9422 |
9425 gfx::Transform identity; | 9423 gfx::Transform identity; |
9426 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); | 9424 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); |
9427 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); | 9425 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); |
9428 scoped_ptr<LayerImpl> grandchild = | 9426 scoped_ptr<LayerImpl> grandchild = |
9429 LayerImpl::Create(host_impl.active_tree(), 3); | 9427 LayerImpl::Create(host_impl.active_tree(), 3); |
9430 | 9428 |
9431 scoped_ptr<FakeContentLayerImpl> greatgrandchild( | 9429 scoped_ptr<FakePictureLayerImpl> greatgrandchild( |
9432 FakeContentLayerImpl::Create(host_impl.active_tree(), 4)); | 9430 FakePictureLayerImpl::Create(host_impl.active_tree(), 4)); |
9433 | 9431 |
9434 child->SetDrawsContent(true); | 9432 child->SetDrawsContent(true); |
9435 grandchild->SetDrawsContent(true); | 9433 grandchild->SetDrawsContent(true); |
9436 greatgrandchild->SetDrawsContent(true); | 9434 greatgrandchild->SetDrawsContent(true); |
9437 | 9435 |
9438 SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), | 9436 SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), |
9439 gfx::PointF(), gfx::Size(100, 100), true, false, | 9437 gfx::PointF(), gfx::Size(100, 100), true, false, |
9440 true); | 9438 true); |
9441 SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(), | 9439 SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(), |
9442 gfx::PointF(), gfx::Size(10, 10), true, false, | 9440 gfx::PointF(), gfx::Size(10, 10), true, false, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9685 EXPECT_FALSE(root->layer_or_descendant_is_drawn()); | 9683 EXPECT_FALSE(root->layer_or_descendant_is_drawn()); |
9686 EXPECT_FALSE(root->visited()); | 9684 EXPECT_FALSE(root->visited()); |
9687 EXPECT_FALSE(root->sorted_for_recursion()); | 9685 EXPECT_FALSE(root->sorted_for_recursion()); |
9688 EXPECT_FALSE(child->layer_or_descendant_is_drawn()); | 9686 EXPECT_FALSE(child->layer_or_descendant_is_drawn()); |
9689 EXPECT_FALSE(child->visited()); | 9687 EXPECT_FALSE(child->visited()); |
9690 EXPECT_FALSE(child->sorted_for_recursion()); | 9688 EXPECT_FALSE(child->sorted_for_recursion()); |
9691 } | 9689 } |
9692 | 9690 |
9693 } // namespace | 9691 } // namespace |
9694 } // namespace cc | 9692 } // namespace cc |
OLD | NEW |