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 #ifndef CC_TEST_LAYER_TREE_TEST_H_ | 5 #ifndef CC_TEST_LAYER_TREE_TEST_H_ |
6 #define CC_TEST_LAYER_TREE_TEST_H_ | 6 #define CC_TEST_LAYER_TREE_TEST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "cc/animation/animation_delegate.h" | 10 #include "cc/animation/animation_delegate.h" |
11 #include "cc/test/proxy_impl_for_test.h" | |
12 #include "cc/test/proxy_main_for_test.h" | |
13 #include "cc/test/remote_proto_channel_bridge.h" | 11 #include "cc/test/remote_proto_channel_bridge.h" |
14 #include "cc/test/test_hooks.h" | 12 #include "cc/test/test_hooks.h" |
15 #include "cc/trees/layer_tree_host.h" | 13 #include "cc/trees/layer_tree_host.h" |
16 #include "cc/trees/layer_tree_host_impl.h" | 14 #include "cc/trees/layer_tree_host_impl.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
18 | 16 |
19 namespace cc { | 17 namespace cc { |
20 class AnimationPlayer; | 18 class AnimationPlayer; |
21 class FakeExternalBeginFrameSource; | 19 class FakeExternalBeginFrameSource; |
22 class FakeLayerTreeHostClient; | 20 class FakeLayerTreeHostClient; |
23 class FakeOutputSurface; | 21 class FakeOutputSurface; |
24 class LayerImpl; | 22 class LayerImpl; |
25 class LayerTreeHost; | 23 class LayerTreeHost; |
26 class LayerTreeHostForTesting; | 24 class LayerTreeHostForTesting; |
27 class LayerTreeHostClient; | 25 class LayerTreeHostClient; |
28 class LayerTreeHostImpl; | 26 class LayerTreeHostImpl; |
| 27 class ProxyImpl; |
| 28 class ProxyMain; |
29 class RemoteChannelImplForTest; | 29 class RemoteChannelImplForTest; |
30 class TestContextProvider; | 30 class TestContextProvider; |
31 class TestGpuMemoryBufferManager; | 31 class TestGpuMemoryBufferManager; |
32 class TestTaskGraphRunner; | 32 class TestTaskGraphRunner; |
33 class TestWebGraphicsContext3D; | 33 class TestWebGraphicsContext3D; |
34 class ThreadedChannelForTest; | 34 class ThreadedChannelForTest; |
35 | 35 |
36 // Creates the virtual viewport layer hierarchy under the given root_layer. | 36 // Creates the virtual viewport layer hierarchy under the given root_layer. |
37 // Convenient overload of the method below that creates a scrolling layer as | 37 // Convenient overload of the method below that creates a scrolling layer as |
38 // the outer viewport scroll layer. | 38 // the outer viewport scroll layer. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 LayerTreeHost* remote_client_layer_tree_host(); | 149 LayerTreeHost* remote_client_layer_tree_host(); |
150 bool delegating_renderer() const { return delegating_renderer_; } | 150 bool delegating_renderer() const { return delegating_renderer_; } |
151 SharedBitmapManager* shared_bitmap_manager() const { | 151 SharedBitmapManager* shared_bitmap_manager() const { |
152 return shared_bitmap_manager_.get(); | 152 return shared_bitmap_manager_.get(); |
153 } | 153 } |
154 TestGpuMemoryBufferManager* gpu_memory_buffer_manager() { | 154 TestGpuMemoryBufferManager* gpu_memory_buffer_manager() { |
155 return gpu_memory_buffer_manager_.get(); | 155 return gpu_memory_buffer_manager_.get(); |
156 } | 156 } |
157 | 157 |
158 // Use these only for tests in threaded or remote mode. | 158 // Use these only for tests in threaded or remote mode. |
159 ProxyMainForTest* GetProxyMainForTest() const; | 159 ProxyMain* GetProxyMain() const; |
160 ProxyImplForTest* GetProxyImplForTest() const; | |
161 | |
162 // Use this only for tests in threaded mode. | |
163 ThreadedChannelForTest* GetThreadedChannelForTest() const; | |
164 | |
165 // Use this only for tests in remote mode. | |
166 RemoteChannelImplForTest* GetRemoteChannelImplForTest() const; | |
167 | 160 |
168 void DestroyLayerTreeHost(); | 161 void DestroyLayerTreeHost(); |
169 void DestroyRemoteClientHost() override; | 162 void DestroyRemoteClientHost() override; |
170 | 163 |
171 void CreateRemoteClientHost( | 164 void CreateRemoteClientHost( |
172 const proto::CompositorMessageToImpl& proto) override; | 165 const proto::CompositorMessageToImpl& proto) override; |
173 | 166 |
174 // By default, output surface recreation is synchronous. | 167 // By default, output surface recreation is synchronous. |
175 void RequestNewOutputSurface() override; | 168 void RequestNewOutputSurface() override; |
176 // Override this for pixel tests, where you need a real output surface, or | 169 // Override this for pixel tests, where you need a real output surface, or |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 263 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
271 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 264 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
272 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 265 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
273 | 266 |
274 // Some tests want to control when notify ready for activation occurs, | 267 // Some tests want to control when notify ready for activation occurs, |
275 // but this is not supported in the single-threaded case. | 268 // but this is not supported in the single-threaded case. |
276 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 269 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
277 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 270 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
278 | 271 |
279 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 272 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |