OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "cc/layers/heads_up_display_layer_impl.h" | 7 #include "cc/layers/heads_up_display_layer_impl.h" |
8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace { | 21 namespace { |
22 | 22 |
23 class LayerTreeImplTest : public LayerTreeHostCommonTest { | 23 class LayerTreeImplTest : public LayerTreeHostCommonTest { |
24 public: | 24 public: |
25 LayerTreeImplTest() : output_surface_(FakeOutputSurface::Create3d()) { | 25 LayerTreeImplTest() : output_surface_(FakeOutputSurface::Create3d()) { |
26 LayerTreeSettings settings; | 26 LayerTreeSettings settings; |
27 settings.layer_transforms_should_scale_layer_contents = true; | 27 settings.layer_transforms_should_scale_layer_contents = true; |
28 settings.verify_property_trees = true; | 28 settings.verify_property_trees = true; |
29 host_impl_.reset(new FakeLayerTreeHostImpl( | 29 host_impl_.reset(new FakeLayerTreeHostImpl( |
30 settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_)); | 30 settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_)); |
| 31 host_impl_->SetVisible(true); |
31 EXPECT_TRUE(host_impl_->InitializeRenderer(output_surface_.get())); | 32 EXPECT_TRUE(host_impl_->InitializeRenderer(output_surface_.get())); |
32 } | 33 } |
33 | 34 |
34 FakeLayerTreeHostImpl& host_impl() { return *host_impl_; } | 35 FakeLayerTreeHostImpl& host_impl() { return *host_impl_; } |
35 | 36 |
36 LayerImpl* root_layer() { return host_impl_->active_tree()->root_layer(); } | 37 LayerImpl* root_layer() { return host_impl_->active_tree()->root_layer(); } |
37 | 38 |
38 const LayerImplList& RenderSurfaceLayerList() const { | 39 const LayerImplList& RenderSurfaceLayerList() const { |
39 return host_impl_->active_tree()->RenderSurfaceLayerList(); | 40 return host_impl_->active_tree()->RenderSurfaceLayerList(); |
40 } | 41 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Ensures that the viewport rect is correctly updated by the clip tree. | 97 // Ensures that the viewport rect is correctly updated by the clip tree. |
97 TestSharedBitmapManager shared_bitmap_manager; | 98 TestSharedBitmapManager shared_bitmap_manager; |
98 TestTaskGraphRunner task_graph_runner; | 99 TestTaskGraphRunner task_graph_runner; |
99 FakeImplProxy proxy; | 100 FakeImplProxy proxy; |
100 LayerTreeSettings settings; | 101 LayerTreeSettings settings; |
101 settings.verify_property_trees = true; | 102 settings.verify_property_trees = true; |
102 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | 103 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); |
103 scoped_ptr<FakeLayerTreeHostImpl> host_impl; | 104 scoped_ptr<FakeLayerTreeHostImpl> host_impl; |
104 host_impl.reset(new FakeLayerTreeHostImpl( | 105 host_impl.reset(new FakeLayerTreeHostImpl( |
105 settings, &proxy, &shared_bitmap_manager, &task_graph_runner)); | 106 settings, &proxy, &shared_bitmap_manager, &task_graph_runner)); |
| 107 host_impl->SetVisible(true); |
106 EXPECT_TRUE(host_impl->InitializeRenderer(output_surface.get())); | 108 EXPECT_TRUE(host_impl->InitializeRenderer(output_surface.get())); |
107 scoped_ptr<LayerImpl> root = | 109 scoped_ptr<LayerImpl> root = |
108 LayerImpl::Create(host_impl->active_tree(), 12345); | 110 LayerImpl::Create(host_impl->active_tree(), 12345); |
109 | 111 |
110 gfx::Transform identity_matrix; | 112 gfx::Transform identity_matrix; |
111 gfx::Point3F transform_origin; | 113 gfx::Point3F transform_origin; |
112 gfx::PointF position; | 114 gfx::PointF position; |
113 gfx::Size bounds(100, 100); | 115 gfx::Size bounds(100, 100); |
114 SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, | 116 SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, |
115 position, bounds, true, false, true); | 117 position, bounds, true, false, true); |
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); | 2083 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); |
2082 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); | 2084 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
2083 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); | 2085 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); |
2084 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); | 2086 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); |
2085 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); | 2087 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); |
2086 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); | 2088 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); |
2087 } | 2089 } |
2088 | 2090 |
2089 } // namespace | 2091 } // namespace |
2090 } // namespace cc | 2092 } // namespace cc |
OLD | NEW |