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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); | 128 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); |
129 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); | 129 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); |
130 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); | 130 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); |
131 void PostSetNeedsCommitToMainThread(); | 131 void PostSetNeedsCommitToMainThread(); |
132 void PostSetNeedsUpdateLayersToMainThread(); | 132 void PostSetNeedsUpdateLayersToMainThread(); |
133 void PostSetNeedsRedrawToMainThread(); | 133 void PostSetNeedsRedrawToMainThread(); |
134 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); | 134 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); |
135 void PostSetVisibleToMainThread(bool visible); | 135 void PostSetVisibleToMainThread(bool visible); |
136 void PostSetNextCommitForcesRedrawToMainThread(); | 136 void PostSetNextCommitForcesRedrawToMainThread(); |
| 137 void PostCompositeImmediatelyToMainThread(); |
137 | 138 |
138 void DoBeginTest(); | 139 void DoBeginTest(); |
139 void Timeout(); | 140 void Timeout(); |
140 | 141 |
141 protected: | 142 protected: |
142 LayerTreeTest(); | 143 LayerTreeTest(); |
143 | 144 |
144 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 145 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
145 | 146 |
146 void RealEndTest(); | 147 void RealEndTest(); |
147 | 148 |
148 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 149 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
149 double animation_duration); | 150 double animation_duration); |
150 void DispatchSetNeedsCommit(); | 151 void DispatchSetNeedsCommit(); |
151 void DispatchSetNeedsUpdateLayers(); | 152 void DispatchSetNeedsUpdateLayers(); |
152 void DispatchSetNeedsRedraw(); | 153 void DispatchSetNeedsRedraw(); |
153 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 154 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
154 void DispatchSetVisible(bool visible); | 155 void DispatchSetVisible(bool visible); |
155 void DispatchSetNextCommitForcesRedraw(); | 156 void DispatchSetNextCommitForcesRedraw(); |
156 void DispatchDidAddAnimation(); | 157 void DispatchDidAddAnimation(); |
| 158 void DispatchCompositeImmediately(); |
157 | 159 |
158 virtual void AfterTest() = 0; | 160 virtual void AfterTest() = 0; |
159 virtual void WillBeginTest(); | 161 virtual void WillBeginTest(); |
160 virtual void BeginTest() = 0; | 162 virtual void BeginTest() = 0; |
161 virtual void SetupTree(); | 163 virtual void SetupTree(); |
162 | 164 |
163 virtual void RunTest(bool threaded, | 165 virtual void RunTest(bool threaded, |
164 bool delegating_renderer, | 166 bool delegating_renderer, |
165 bool impl_side_painting); | 167 bool impl_side_painting); |
166 virtual void RunTestWithImplSidePainting(); | 168 virtual void RunTestWithImplSidePainting(); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 322 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
321 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 323 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
322 | 324 |
323 // Some tests want to control when notify ready for activation occurs, | 325 // Some tests want to control when notify ready for activation occurs, |
324 // but this is not supported in the single-threaded case. | 326 // but this is not supported in the single-threaded case. |
325 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 327 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
326 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 328 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
327 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 329 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
328 | 330 |
329 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 331 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |