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/layers/delegated_renderer_layer.h" | 5 #include "cc/layers/delegated_renderer_layer.h" |
6 | 6 |
7 #include "cc/layers/delegated_frame_provider.h" | 7 #include "cc/layers/delegated_frame_provider.h" |
8 #include "cc/layers/delegated_frame_resource_collection.h" | 8 #include "cc/layers/delegated_frame_resource_collection.h" |
9 #include "cc/layers/solid_color_layer.h" | 9 #include "cc/layers/solid_color_layer.h" |
10 #include "cc/output/delegated_frame_data.h" | 10 #include "cc/output/delegated_frame_data.h" |
11 #include "cc/test/fake_delegated_renderer_layer.h" | 11 #include "cc/test/fake_delegated_renderer_layer.h" |
12 #include "cc/test/fake_layer_tree_host.h" | 12 #include "cc/test/fake_layer_tree_host.h" |
13 #include "cc/test/fake_proxy.h" | 13 #include "cc/test/fake_proxy.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 namespace { | 17 namespace { |
18 | 18 |
19 class DelegatedRendererLayerTest : public testing::Test { | 19 class DelegatedRendererLayerTest : public testing::Test { |
20 public: | 20 public: |
21 DelegatedRendererLayerTest() : proxy_() { | 21 DelegatedRendererLayerTest() |
| 22 : proxy_(), host_client_(FakeLayerTreeHostClient::DIRECT_3D) { |
22 LayerTreeSettings settings; | 23 LayerTreeSettings settings; |
23 settings.minimum_occlusion_tracking_size = gfx::Size(); | 24 settings.minimum_occlusion_tracking_size = gfx::Size(); |
24 | 25 |
25 host_impl_ = FakeLayerTreeHost::Create(settings); | 26 host_impl_ = FakeLayerTreeHost::Create(&host_client_, settings); |
26 host_impl_->SetViewportSize(gfx::Size(10, 10)); | 27 host_impl_->SetViewportSize(gfx::Size(10, 10)); |
27 } | 28 } |
28 | 29 |
29 protected: | 30 protected: |
30 FakeProxy proxy_; | 31 FakeProxy proxy_; |
| 32 FakeLayerTreeHostClient host_client_; |
31 TestSharedBitmapManager shared_bitmap_manager_; | 33 TestSharedBitmapManager shared_bitmap_manager_; |
32 scoped_ptr<LayerTreeHost> host_impl_; | 34 scoped_ptr<LayerTreeHost> host_impl_; |
33 }; | 35 }; |
34 | 36 |
35 class DelegatedRendererLayerTestSimple : public DelegatedRendererLayerTest { | 37 class DelegatedRendererLayerTestSimple : public DelegatedRendererLayerTest { |
36 public: | 38 public: |
37 DelegatedRendererLayerTestSimple() : DelegatedRendererLayerTest() { | 39 DelegatedRendererLayerTestSimple() : DelegatedRendererLayerTest() { |
38 scoped_ptr<RenderPass> root_pass(RenderPass::Create()); | 40 scoped_ptr<RenderPass> root_pass(RenderPass::Create()); |
39 root_pass->SetNew( | 41 root_pass->SetNew( |
40 RenderPassId(1, 1), gfx::Rect(1, 1), gfx::Rect(1, 1), gfx::Transform()); | 42 RenderPassId(1, 1), gfx::Rect(1, 1), gfx::Rect(1, 1), gfx::Transform()); |
(...skipping 27 matching lines...) Loading... |
68 EXPECT_EQ(0, delegated_renderer_layer_->NumDescendantsThatDrawContent()); | 70 EXPECT_EQ(0, delegated_renderer_layer_->NumDescendantsThatDrawContent()); |
69 EXPECT_EQ(1, root_layer_->NumDescendantsThatDrawContent()); | 71 EXPECT_EQ(1, root_layer_->NumDescendantsThatDrawContent()); |
70 delegated_renderer_layer_->SetIsDrawable(true); | 72 delegated_renderer_layer_->SetIsDrawable(true); |
71 EXPECT_EQ(1000, delegated_renderer_layer_->NumDescendantsThatDrawContent()); | 73 EXPECT_EQ(1000, delegated_renderer_layer_->NumDescendantsThatDrawContent()); |
72 EXPECT_EQ(1001, layer_before_->NumDescendantsThatDrawContent()); | 74 EXPECT_EQ(1001, layer_before_->NumDescendantsThatDrawContent()); |
73 EXPECT_EQ(1002, root_layer_->NumDescendantsThatDrawContent()); | 75 EXPECT_EQ(1002, root_layer_->NumDescendantsThatDrawContent()); |
74 } | 76 } |
75 | 77 |
76 } // namespace | 78 } // namespace |
77 } // namespace cc | 79 } // namespace cc |
OLD | NEW |