| 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 11 matching lines...) Expand all Loading... |
| 22 class FakeLayerTreeHostClient; | 22 class FakeLayerTreeHostClient; |
| 23 class LayerImpl; | 23 class LayerImpl; |
| 24 class LayerTreeHost; | 24 class LayerTreeHost; |
| 25 class LayerTreeHostForTesting; | 25 class LayerTreeHostForTesting; |
| 26 class LayerTreeHostClient; | 26 class LayerTreeHostClient; |
| 27 class LayerTreeHostImpl; | 27 class LayerTreeHostImpl; |
| 28 class LayerTreeTestCompositorFrameSinkClient; | 28 class LayerTreeTestCompositorFrameSinkClient; |
| 29 class Proxy; | 29 class Proxy; |
| 30 class ProxyImpl; | 30 class ProxyImpl; |
| 31 class ProxyMain; | 31 class ProxyMain; |
| 32 class RemoteChannelImplForTest; | |
| 33 class TestContextProvider; | 32 class TestContextProvider; |
| 34 class TestCompositorFrameSink; | 33 class TestCompositorFrameSink; |
| 35 class TestGpuMemoryBufferManager; | 34 class TestGpuMemoryBufferManager; |
| 36 class TestTaskGraphRunner; | 35 class TestTaskGraphRunner; |
| 37 class TestWebGraphicsContext3D; | 36 class TestWebGraphicsContext3D; |
| 38 | 37 |
| 39 // Creates the virtual viewport layer hierarchy under the given root_layer. | 38 // Creates the virtual viewport layer hierarchy under the given root_layer. |
| 40 // Convenient overload of the method below that creates a scrolling layer as | 39 // Convenient overload of the method below that creates a scrolling layer as |
| 41 // the outer viewport scroll layer. | 40 // the outer viewport scroll layer. |
| 42 void CreateVirtualViewportLayers(Layer* root_layer, | 41 void CreateVirtualViewportLayers(Layer* root_layer, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 bool HasImplThread() const { return !!impl_thread_; } | 130 bool HasImplThread() const { return !!impl_thread_; } |
| 132 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { | 131 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { |
| 133 return impl_task_runner_.get(); | 132 return impl_task_runner_.get(); |
| 134 } | 133 } |
| 135 base::SingleThreadTaskRunner* MainThreadTaskRunner() { | 134 base::SingleThreadTaskRunner* MainThreadTaskRunner() { |
| 136 return main_task_runner_.get(); | 135 return main_task_runner_.get(); |
| 137 } | 136 } |
| 138 Proxy* proxy() const { | 137 Proxy* proxy() const { |
| 139 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 138 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
| 140 } | 139 } |
| 141 Proxy* remote_client_proxy() const; | |
| 142 TaskRunnerProvider* task_runner_provider() const; | 140 TaskRunnerProvider* task_runner_provider() const; |
| 143 TaskGraphRunner* task_graph_runner() const { | 141 TaskGraphRunner* task_graph_runner() const { |
| 144 return task_graph_runner_.get(); | 142 return task_graph_runner_.get(); |
| 145 } | 143 } |
| 146 bool TestEnded() const { return ended_; } | 144 bool TestEnded() const { return ended_; } |
| 147 | 145 |
| 148 LayerTreeHostInProcess* layer_tree_host(); | 146 LayerTreeHostInProcess* layer_tree_host(); |
| 149 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } | 147 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } |
| 150 LayerTreeHost* remote_client_layer_tree_host(); | |
| 151 SharedBitmapManager* shared_bitmap_manager() const { | 148 SharedBitmapManager* shared_bitmap_manager() const { |
| 152 return shared_bitmap_manager_.get(); | 149 return shared_bitmap_manager_.get(); |
| 153 } | 150 } |
| 154 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { | 151 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { |
| 155 return gpu_memory_buffer_manager_.get(); | 152 return gpu_memory_buffer_manager_.get(); |
| 156 } | 153 } |
| 157 | 154 |
| 158 void DestroyLayerTreeHost(); | 155 void DestroyLayerTreeHost(); |
| 159 | 156 |
| 160 // By default, output surface recreation is synchronous. | 157 // By default, output surface recreation is synchronous. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 178 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); | 175 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); |
| 179 | 176 |
| 180 private: | 177 private: |
| 181 LayerTreeSettings settings_; | 178 LayerTreeSettings settings_; |
| 182 | 179 |
| 183 CompositorMode mode_; | 180 CompositorMode mode_; |
| 184 | 181 |
| 185 std::unique_ptr<LayerTreeHostClientForTesting> client_; | 182 std::unique_ptr<LayerTreeHostClientForTesting> client_; |
| 186 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_; | 183 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_; |
| 187 | 184 |
| 188 // The LayerTreeHost created by the cc embedder on the client in remote mode. | |
| 189 std::unique_ptr<LayerTreeHostForTesting> remote_client_layer_tree_host_; | |
| 190 | |
| 191 RemoteProtoChannelBridge remote_proto_channel_bridge_; | |
| 192 | |
| 193 std::unique_ptr<ImageSerializationProcessor> image_serialization_processor_; | |
| 194 | |
| 195 bool beginning_ = false; | 185 bool beginning_ = false; |
| 196 bool end_when_begin_returns_ = false; | 186 bool end_when_begin_returns_ = false; |
| 197 bool timed_out_ = false; | 187 bool timed_out_ = false; |
| 198 bool scheduled_ = false; | 188 bool scheduled_ = false; |
| 199 bool started_ = false; | 189 bool started_ = false; |
| 200 bool ended_ = false; | 190 bool ended_ = false; |
| 201 | 191 |
| 202 int timeout_seconds_ = false; | 192 int timeout_seconds_ = false; |
| 203 | 193 |
| 204 std::unique_ptr<LayerTreeTestCompositorFrameSinkClient> | 194 std::unique_ptr<LayerTreeTestCompositorFrameSinkClient> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 232 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 222 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 233 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 223 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 234 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 224 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 235 | 225 |
| 236 // Some tests want to control when notify ready for activation occurs, | 226 // Some tests want to control when notify ready for activation occurs, |
| 237 // but this is not supported in the single-threaded case. | 227 // but this is not supported in the single-threaded case. |
| 238 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 228 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 239 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 229 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 240 | 230 |
| 241 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 231 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |