| 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/remote_proto_channel_bridge.h" | 11 #include "cc/test/remote_proto_channel_bridge.h" |
| 12 #include "cc/test/test_gpu_memory_buffer_manager.h" | 12 #include "cc/test/test_gpu_memory_buffer_manager.h" |
| 13 #include "cc/test/test_hooks.h" | 13 #include "cc/test/test_hooks.h" |
| 14 #include "cc/test/test_task_graph_runner.h" | 14 #include "cc/test/test_task_graph_runner.h" |
| 15 #include "cc/trees/layer_tree_host.h" | 15 #include "cc/trees/compositor_mode.h" |
| 16 #include "cc/trees/layer_tree_host_impl.h" | 16 #include "cc/trees/layer_tree_host_impl.h" |
| 17 #include "cc/trees/layer_tree_host_in_process.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 19 |
| 19 namespace cc { | 20 namespace cc { |
| 20 class AnimationPlayer; | 21 class AnimationPlayer; |
| 21 class FakeLayerTreeHostClient; | 22 class FakeLayerTreeHostClient; |
| 22 class FakeOutputSurface; | 23 class FakeOutputSurface; |
| 23 class LayerImpl; | 24 class LayerImpl; |
| 24 class LayerTreeHost; | 25 class LayerTreeHost; |
| 25 class LayerTreeHostForTesting; | 26 class LayerTreeHostForTesting; |
| 26 class LayerTreeHostClient; | 27 class LayerTreeHostClient; |
| 27 class LayerTreeHostImpl; | 28 class LayerTreeHostImpl; |
| 28 class LayerTreeTestDelegatingOutputSurfaceClient; | 29 class LayerTreeTestDelegatingOutputSurfaceClient; |
| 30 class Proxy; |
| 29 class ProxyImpl; | 31 class ProxyImpl; |
| 30 class ProxyMain; | 32 class ProxyMain; |
| 31 class RemoteChannelImplForTest; | 33 class RemoteChannelImplForTest; |
| 32 class TestContextProvider; | 34 class TestContextProvider; |
| 33 class TestDelegatingOutputSurface; | 35 class TestDelegatingOutputSurface; |
| 34 class TestGpuMemoryBufferManager; | 36 class TestGpuMemoryBufferManager; |
| 35 class TestTaskGraphRunner; | 37 class TestTaskGraphRunner; |
| 36 class TestWebGraphicsContext3D; | 38 class TestWebGraphicsContext3D; |
| 37 | 39 |
| 38 // Creates the virtual viewport layer hierarchy under the given root_layer. | 40 // Creates the virtual viewport layer hierarchy under the given root_layer. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 Proxy* proxy() const { | 138 Proxy* proxy() const { |
| 137 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 139 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
| 138 } | 140 } |
| 139 Proxy* remote_client_proxy() const; | 141 Proxy* remote_client_proxy() const; |
| 140 TaskRunnerProvider* task_runner_provider() const; | 142 TaskRunnerProvider* task_runner_provider() const; |
| 141 TaskGraphRunner* task_graph_runner() const { | 143 TaskGraphRunner* task_graph_runner() const { |
| 142 return task_graph_runner_.get(); | 144 return task_graph_runner_.get(); |
| 143 } | 145 } |
| 144 bool TestEnded() const { return ended_; } | 146 bool TestEnded() const { return ended_; } |
| 145 | 147 |
| 146 LayerTreeHost* layer_tree_host(); | 148 LayerTreeHostInProcess* layer_tree_host(); |
| 147 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } | 149 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } |
| 148 LayerTreeHost* remote_client_layer_tree_host(); | 150 LayerTreeHost* remote_client_layer_tree_host(); |
| 149 SharedBitmapManager* shared_bitmap_manager() const { | 151 SharedBitmapManager* shared_bitmap_manager() const { |
| 150 return shared_bitmap_manager_.get(); | 152 return shared_bitmap_manager_.get(); |
| 151 } | 153 } |
| 152 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { | 154 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { |
| 153 return gpu_memory_buffer_manager_.get(); | 155 return gpu_memory_buffer_manager_.get(); |
| 154 } | 156 } |
| 155 | 157 |
| 156 void DestroyLayerTreeHost(); | 158 void DestroyLayerTreeHost(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 175 bool IsRemoteTest() const; | 177 bool IsRemoteTest() const; |
| 176 | 178 |
| 177 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); | 179 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); |
| 178 | 180 |
| 179 private: | 181 private: |
| 180 LayerTreeSettings settings_; | 182 LayerTreeSettings settings_; |
| 181 | 183 |
| 182 CompositorMode mode_; | 184 CompositorMode mode_; |
| 183 | 185 |
| 184 std::unique_ptr<LayerTreeHostClientForTesting> client_; | 186 std::unique_ptr<LayerTreeHostClientForTesting> client_; |
| 185 std::unique_ptr<LayerTreeHost> layer_tree_host_; | 187 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_; |
| 186 | 188 |
| 187 // The LayerTreeHost created by the cc embedder on the client in remote mode. | 189 // The LayerTreeHost created by the cc embedder on the client in remote mode. |
| 188 std::unique_ptr<LayerTreeHostForTesting> remote_client_layer_tree_host_; | 190 std::unique_ptr<LayerTreeHostForTesting> remote_client_layer_tree_host_; |
| 189 | 191 |
| 190 RemoteProtoChannelBridge remote_proto_channel_bridge_; | 192 RemoteProtoChannelBridge remote_proto_channel_bridge_; |
| 191 | 193 |
| 192 std::unique_ptr<ImageSerializationProcessor> image_serialization_processor_; | 194 std::unique_ptr<ImageSerializationProcessor> image_serialization_processor_; |
| 193 | 195 |
| 194 bool beginning_ = false; | 196 bool beginning_ = false; |
| 195 bool end_when_begin_returns_ = false; | 197 bool end_when_begin_returns_ = false; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 233 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 232 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 234 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 233 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 235 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 234 | 236 |
| 235 // Some tests want to control when notify ready for activation occurs, | 237 // Some tests want to control when notify ready for activation occurs, |
| 236 // but this is not supported in the single-threaded case. | 238 // but this is not supported in the single-threaded case. |
| 237 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 239 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 238 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 240 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 239 | 241 |
| 240 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 242 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |