| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Override this and call the base class to change what ContextProvider will | 142 // Override this and call the base class to change what ContextProvider will |
| 143 // be used, such as to prevent sharing the context with the | 143 // be used, such as to prevent sharing the context with the |
| 144 // CompositorFrameSink. Or override it and create your own OutputSurface to | 144 // CompositorFrameSink. Or override it and create your own OutputSurface to |
| 145 // change what type of OutputSurface is used, such as a real OutputSurface for | 145 // change what type of OutputSurface is used, such as a real OutputSurface for |
| 146 // pixel tests or a software-compositing OutputSurface. | 146 // pixel tests or a software-compositing OutputSurface. |
| 147 std::unique_ptr<OutputSurface> CreateDisplayOutputSurfaceOnThread( | 147 std::unique_ptr<OutputSurface> CreateDisplayOutputSurfaceOnThread( |
| 148 scoped_refptr<ContextProvider> compositor_context_provider) override; | 148 scoped_refptr<ContextProvider> compositor_context_provider) override; |
| 149 | 149 |
| 150 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); | 150 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); |
| 151 | 151 |
| 152 base::SingleThreadTaskRunner* image_worker_task_runner() const { |
| 153 return image_worker_->task_runner().get(); |
| 154 } |
| 155 |
| 152 private: | 156 private: |
| 153 virtual void DispatchAddAnimationToPlayer( | 157 virtual void DispatchAddAnimationToPlayer( |
| 154 AnimationPlayer* player_to_receive_animation, | 158 AnimationPlayer* player_to_receive_animation, |
| 155 double animation_duration); | 159 double animation_duration); |
| 156 void DispatchSetDeferCommits(bool defer_commits); | 160 void DispatchSetDeferCommits(bool defer_commits); |
| 157 void DispatchSetNeedsCommit(); | 161 void DispatchSetNeedsCommit(); |
| 158 void DispatchSetNeedsUpdateLayers(); | 162 void DispatchSetNeedsUpdateLayers(); |
| 159 void DispatchSetNeedsRedraw(); | 163 void DispatchSetNeedsRedraw(); |
| 160 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 164 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
| 161 void DispatchSetVisible(bool visible); | 165 void DispatchSetVisible(bool visible); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 179 bool started_ = false; | 183 bool started_ = false; |
| 180 bool ended_ = false; | 184 bool ended_ = false; |
| 181 | 185 |
| 182 int timeout_seconds_ = false; | 186 int timeout_seconds_ = false; |
| 183 | 187 |
| 184 std::unique_ptr<LayerTreeTestCompositorFrameSinkClient> | 188 std::unique_ptr<LayerTreeTestCompositorFrameSinkClient> |
| 185 compositor_frame_sink_client_; | 189 compositor_frame_sink_client_; |
| 186 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 190 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 187 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; | 191 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; |
| 188 std::unique_ptr<base::Thread> impl_thread_; | 192 std::unique_ptr<base::Thread> impl_thread_; |
| 193 std::unique_ptr<base::Thread> image_worker_; |
| 189 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_; | 194 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_; |
| 190 std::unique_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 195 std::unique_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| 191 std::unique_ptr<TestTaskGraphRunner> task_graph_runner_; | 196 std::unique_ptr<TestTaskGraphRunner> task_graph_runner_; |
| 192 base::CancelableClosure timeout_; | 197 base::CancelableClosure timeout_; |
| 193 scoped_refptr<TestContextProvider> compositor_contexts_; | 198 scoped_refptr<TestContextProvider> compositor_contexts_; |
| 194 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; | 199 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; |
| 195 base::WeakPtrFactory<LayerTreeTest> weak_factory_; | 200 base::WeakPtrFactory<LayerTreeTest> weak_factory_; |
| 196 }; | 201 }; |
| 197 | 202 |
| 198 } // namespace cc | 203 } // namespace cc |
| (...skipping 17 matching lines...) Expand all Loading... |
| 216 #define REMOTE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 221 #define REMOTE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 217 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 222 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 218 REMOTE_TEST_F(TEST_FIXTURE_NAME) | 223 REMOTE_TEST_F(TEST_FIXTURE_NAME) |
| 219 | 224 |
| 220 // Some tests want to control when notify ready for activation occurs, | 225 // Some tests want to control when notify ready for activation occurs, |
| 221 // but this is not supported in the single-threaded case. | 226 // but this is not supported in the single-threaded case. |
| 222 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 227 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 223 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 228 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 224 | 229 |
| 225 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 230 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |