| 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 scoped_refptr<ContextProvider> compositor_context_provider, | 142 scoped_refptr<ContextProvider> compositor_context_provider, |
| 143 scoped_refptr<ContextProvider> worker_context_provider); | 143 scoped_refptr<ContextProvider> worker_context_provider); |
| 144 // Override this and call the base class to change what ContextProvider will | 144 // Override this and call the base class to change what ContextProvider will |
| 145 // be used, such as to prevent sharing the context with the | 145 // be used, such as to prevent sharing the context with the |
| 146 // CompositorFrameSink. Or override it and create your own OutputSurface to | 146 // CompositorFrameSink. Or override it and create your own OutputSurface to |
| 147 // change what type of OutputSurface is used, such as a real OutputSurface for | 147 // change what type of OutputSurface is used, such as a real OutputSurface for |
| 148 // pixel tests or a software-compositing OutputSurface. | 148 // pixel tests or a software-compositing OutputSurface. |
| 149 std::unique_ptr<OutputSurface> CreateDisplayOutputSurfaceOnThread( | 149 std::unique_ptr<OutputSurface> CreateDisplayOutputSurfaceOnThread( |
| 150 scoped_refptr<ContextProvider> compositor_context_provider) override; | 150 scoped_refptr<ContextProvider> compositor_context_provider) override; |
| 151 | 151 |
| 152 bool IsRemoteTest() const; | |
| 153 | |
| 154 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); | 152 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); |
| 155 | 153 |
| 156 private: | 154 private: |
| 157 virtual void DispatchAddAnimationToPlayer( | 155 virtual void DispatchAddAnimationToPlayer( |
| 158 AnimationPlayer* player_to_receive_animation, | 156 AnimationPlayer* player_to_receive_animation, |
| 159 double animation_duration); | 157 double animation_duration); |
| 160 void DispatchSetDeferCommits(bool defer_commits); | 158 void DispatchSetDeferCommits(bool defer_commits); |
| 161 void DispatchSetNeedsCommit(); | 159 void DispatchSetNeedsCommit(); |
| 162 void DispatchSetNeedsUpdateLayers(); | 160 void DispatchSetNeedsUpdateLayers(); |
| 163 void DispatchSetNeedsRedraw(); | 161 void DispatchSetNeedsRedraw(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 RunTest(CompositorMode::SINGLE_THREADED); \ | 205 RunTest(CompositorMode::SINGLE_THREADED); \ |
| 208 } \ | 206 } \ |
| 209 class SingleThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 207 class SingleThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
| 210 | 208 |
| 211 #define MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 209 #define MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 212 TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DelegatingRenderer) { \ | 210 TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DelegatingRenderer) { \ |
| 213 RunTest(CompositorMode::THREADED); \ | 211 RunTest(CompositorMode::THREADED); \ |
| 214 } \ | 212 } \ |
| 215 class MultiThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 213 class MultiThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
| 216 | 214 |
| 217 #define REMOTE_TEST_F(TEST_FIXTURE_NAME) \ | |
| 218 TEST_F(TEST_FIXTURE_NAME, RunRemote_DelegatingRenderer) { \ | |
| 219 RunTest(CompositorMode::REMOTE); \ | |
| 220 } \ | |
| 221 class RemoteDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} | |
| 222 | |
| 223 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 215 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 224 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 216 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 225 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 217 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 226 | 218 |
| 227 #define REMOTE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 219 #define REMOTE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 228 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 220 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 229 REMOTE_TEST_F(TEST_FIXTURE_NAME) | 221 REMOTE_TEST_F(TEST_FIXTURE_NAME) |
| 230 | 222 |
| 231 #define SINGLE_MULTI_AND_REMOTE_TEST_F(TEST_FIXTURE_NAME) \ | |
| 232 SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | |
| 233 REMOTE_TEST_F(TEST_FIXTURE_NAME) | |
| 234 | |
| 235 // Some tests want to control when notify ready for activation occurs, | 223 // Some tests want to control when notify ready for activation occurs, |
| 236 // but this is not supported in the single-threaded case. | 224 // but this is not supported in the single-threaded case. |
| 237 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 225 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 238 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 226 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 239 | 227 |
| 240 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 228 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |