| 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" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 141 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
| 142 } | 142 } |
| 143 Proxy* remote_client_proxy() const; | 143 Proxy* remote_client_proxy() const; |
| 144 TaskRunnerProvider* task_runner_provider() const; | 144 TaskRunnerProvider* task_runner_provider() const; |
| 145 TaskGraphRunner* task_graph_runner() const; | 145 TaskGraphRunner* task_graph_runner() const; |
| 146 bool TestEnded() const { return ended_; } | 146 bool TestEnded() const { return ended_; } |
| 147 | 147 |
| 148 LayerTreeHost* layer_tree_host(); | 148 LayerTreeHost* layer_tree_host(); |
| 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 FakeOutputSurface* output_surface() { return output_surface_; } | |
| 152 SharedBitmapManager* shared_bitmap_manager() const { | 151 SharedBitmapManager* shared_bitmap_manager() const { |
| 153 return shared_bitmap_manager_.get(); | 152 return shared_bitmap_manager_.get(); |
| 154 } | 153 } |
| 155 TestGpuMemoryBufferManager* gpu_memory_buffer_manager() { | 154 TestGpuMemoryBufferManager* gpu_memory_buffer_manager() { |
| 156 return gpu_memory_buffer_manager_.get(); | 155 return gpu_memory_buffer_manager_.get(); |
| 157 } | 156 } |
| 158 | 157 |
| 159 // Use these only for tests in threaded or remote mode. | 158 // Use these only for tests in threaded or remote mode. |
| 160 ProxyMainForTest* GetProxyMainForTest() const; | 159 ProxyMainForTest* GetProxyMainForTest() const; |
| 161 ProxyImplForTest* GetProxyImplForTest() const; | 160 ProxyImplForTest* GetProxyImplForTest() const; |
| 162 | 161 |
| 163 // Use this only for tests in threaded mode. | 162 // Use this only for tests in threaded mode. |
| 164 ThreadedChannelForTest* GetThreadedChannelForTest() const; | 163 ThreadedChannelForTest* GetThreadedChannelForTest() const; |
| 165 | 164 |
| 166 // Use this only for tests in remote mode. | 165 // Use this only for tests in remote mode. |
| 167 RemoteChannelImplForTest* GetRemoteChannelImplForTest() const; | 166 RemoteChannelImplForTest* GetRemoteChannelImplForTest() const; |
| 168 | 167 |
| 169 void DestroyLayerTreeHost(); | 168 void DestroyLayerTreeHost(); |
| 170 void DestroyRemoteClientHost() override; | 169 void DestroyRemoteClientHost() override; |
| 171 | 170 |
| 172 void CreateRemoteClientHost( | 171 void CreateRemoteClientHost( |
| 173 const proto::CompositorMessageToImpl& proto) override; | 172 const proto::CompositorMessageToImpl& proto) override; |
| 174 | 173 |
| 175 // By default, output surface recreation is synchronous. | 174 // By default, output surface recreation is synchronous. |
| 176 void RequestNewOutputSurface() override; | 175 void RequestNewOutputSurface() override; |
| 177 // Override this for pixel tests, where you need a real output surface. | 176 // Override this for pixel tests, where you need a real output surface, or |
| 177 // if you want to control the output surface used for drawing. |
| 178 virtual std::unique_ptr<OutputSurface> CreateOutputSurface(); | 178 virtual std::unique_ptr<OutputSurface> CreateOutputSurface(); |
| 179 // Override this for unit tests, which should not produce pixel output. | |
| 180 virtual std::unique_ptr<FakeOutputSurface> CreateFakeOutputSurface(); | |
| 181 | |
| 182 TestWebGraphicsContext3D* TestContext(); | |
| 183 | 179 |
| 184 bool IsRemoteTest() const; | 180 bool IsRemoteTest() const; |
| 185 | 181 |
| 186 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); | 182 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); |
| 187 | 183 |
| 188 private: | 184 private: |
| 189 LayerTreeSettings settings_; | 185 LayerTreeSettings settings_; |
| 190 | 186 |
| 191 CompositorMode mode_; | 187 CompositorMode mode_; |
| 192 | 188 |
| 193 std::unique_ptr<LayerTreeHostClientForTesting> client_; | 189 std::unique_ptr<LayerTreeHostClientForTesting> client_; |
| 194 std::unique_ptr<LayerTreeHost> layer_tree_host_; | 190 std::unique_ptr<LayerTreeHost> layer_tree_host_; |
| 195 | 191 |
| 196 // The LayerTreeHost created by the cc embedder on the client in remote mode. | 192 // The LayerTreeHost created by the cc embedder on the client in remote mode. |
| 197 std::unique_ptr<LayerTreeHostForTesting> remote_client_layer_tree_host_; | 193 std::unique_ptr<LayerTreeHostForTesting> remote_client_layer_tree_host_; |
| 198 | 194 |
| 199 FakeOutputSurface* output_surface_; | |
| 200 FakeExternalBeginFrameSource* external_begin_frame_source_; | 195 FakeExternalBeginFrameSource* external_begin_frame_source_; |
| 201 RemoteProtoChannelBridge remote_proto_channel_bridge_; | 196 RemoteProtoChannelBridge remote_proto_channel_bridge_; |
| 202 | 197 |
| 203 std::unique_ptr<ImageSerializationProcessor> image_serialization_processor_; | 198 std::unique_ptr<ImageSerializationProcessor> image_serialization_processor_; |
| 204 | 199 |
| 205 bool beginning_; | 200 bool beginning_; |
| 206 bool end_when_begin_returns_; | 201 bool end_when_begin_returns_; |
| 207 bool timed_out_; | 202 bool timed_out_; |
| 208 bool scheduled_; | 203 bool scheduled_; |
| 209 bool started_; | 204 bool started_; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 270 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 276 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 271 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
| 277 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 272 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
| 278 | 273 |
| 279 // Some tests want to control when notify ready for activation occurs, | 274 // Some tests want to control when notify ready for activation occurs, |
| 280 // but this is not supported in the single-threaded case. | 275 // but this is not supported in the single-threaded case. |
| 281 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 276 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 282 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 277 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 283 | 278 |
| 284 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 279 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |