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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 virtual void WillBeginMainFrame() {} | 81 virtual void WillBeginMainFrame() {} |
82 virtual void DidBeginMainFrame() {} | 82 virtual void DidBeginMainFrame() {} |
83 virtual void Layout() {} | 83 virtual void Layout() {} |
84 virtual void DidInitializeOutputSurface() {} | 84 virtual void DidInitializeOutputSurface() {} |
85 virtual void DidFailToInitializeOutputSurface() {} | 85 virtual void DidFailToInitializeOutputSurface() {} |
86 virtual void DidAddAnimation() {} | 86 virtual void DidAddAnimation() {} |
87 virtual void WillCommit() {} | 87 virtual void WillCommit() {} |
88 virtual void DidCommit() {} | 88 virtual void DidCommit() {} |
89 virtual void DidCommitAndDrawFrame() {} | 89 virtual void DidCommitAndDrawFrame() {} |
90 virtual void DidCompleteSwapBuffers() {} | 90 virtual void DidCompleteSwapBuffers() {} |
91 virtual void DidDeferCommit() {} | |
92 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, | 91 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, |
93 bool visible) {} | 92 bool visible) {} |
94 virtual void ScheduleComposite() {} | 93 virtual void ScheduleComposite() {} |
95 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} | 94 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} |
96 | 95 |
97 // Hooks for SchedulerClient. | 96 // Hooks for SchedulerClient. |
| 97 virtual void WillBeginImplFrame(const BeginFrameArgs& args) {} |
98 virtual void ScheduledActionWillSendBeginMainFrame() {} | 98 virtual void ScheduledActionWillSendBeginMainFrame() {} |
99 virtual void ScheduledActionSendBeginMainFrame() {} | 99 virtual void ScheduledActionSendBeginMainFrame() {} |
100 virtual void ScheduledActionDrawAndSwapIfPossible() {} | 100 virtual void ScheduledActionDrawAndSwapIfPossible() {} |
101 virtual void ScheduledActionAnimate() {} | 101 virtual void ScheduledActionAnimate() {} |
102 virtual void ScheduledActionCommit() {} | 102 virtual void ScheduledActionCommit() {} |
103 virtual void ScheduledActionBeginOutputSurfaceCreation() {} | 103 virtual void ScheduledActionBeginOutputSurfaceCreation() {} |
104 virtual void ScheduledActionPrepareTiles() {} | 104 virtual void ScheduledActionPrepareTiles() {} |
105 | 105 |
106 // Implementation of AnimationDelegate: | 106 // Implementation of AnimationDelegate: |
107 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 107 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
(...skipping 26 matching lines...) Expand all Loading... |
134 class LayerTreeTest : public testing::Test, public TestHooks { | 134 class LayerTreeTest : public testing::Test, public TestHooks { |
135 public: | 135 public: |
136 ~LayerTreeTest() override; | 136 ~LayerTreeTest() override; |
137 | 137 |
138 virtual void EndTest(); | 138 virtual void EndTest(); |
139 void EndTestAfterDelayMs(int delay_milliseconds); | 139 void EndTestAfterDelayMs(int delay_milliseconds); |
140 | 140 |
141 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); | 141 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); |
142 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); | 142 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); |
143 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); | 143 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); |
| 144 void PostSetDeferCommitsToMainThread(bool defer_commits); |
144 void PostSetNeedsCommitToMainThread(); | 145 void PostSetNeedsCommitToMainThread(); |
145 void PostSetNeedsUpdateLayersToMainThread(); | 146 void PostSetNeedsUpdateLayersToMainThread(); |
146 void PostSetNeedsRedrawToMainThread(); | 147 void PostSetNeedsRedrawToMainThread(); |
147 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); | 148 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); |
148 void PostSetVisibleToMainThread(bool visible); | 149 void PostSetVisibleToMainThread(bool visible); |
149 void PostSetNextCommitForcesRedrawToMainThread(); | 150 void PostSetNextCommitForcesRedrawToMainThread(); |
150 void PostCompositeImmediatelyToMainThread(); | 151 void PostCompositeImmediatelyToMainThread(); |
151 | 152 |
152 void DoBeginTest(); | 153 void DoBeginTest(); |
153 void Timeout(); | 154 void Timeout(); |
154 | 155 |
155 bool verify_property_trees() const { return verify_property_trees_; } | 156 bool verify_property_trees() const { return verify_property_trees_; } |
156 void set_verify_property_trees(bool verify_property_trees) { | 157 void set_verify_property_trees(bool verify_property_trees) { |
157 verify_property_trees_ = verify_property_trees; | 158 verify_property_trees_ = verify_property_trees; |
158 } | 159 } |
159 | 160 |
160 protected: | 161 protected: |
161 LayerTreeTest(); | 162 LayerTreeTest(); |
162 | 163 |
163 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 164 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
164 | 165 |
165 void RealEndTest(); | 166 void RealEndTest(); |
166 | 167 |
167 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 168 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
168 double animation_duration); | 169 double animation_duration); |
| 170 void DispatchSetDeferCommits(bool defer_commits); |
169 void DispatchSetNeedsCommit(); | 171 void DispatchSetNeedsCommit(); |
170 void DispatchSetNeedsUpdateLayers(); | 172 void DispatchSetNeedsUpdateLayers(); |
171 void DispatchSetNeedsRedraw(); | 173 void DispatchSetNeedsRedraw(); |
172 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 174 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
173 void DispatchSetVisible(bool visible); | 175 void DispatchSetVisible(bool visible); |
174 void DispatchSetNextCommitForcesRedraw(); | 176 void DispatchSetNextCommitForcesRedraw(); |
175 void DispatchDidAddAnimation(); | 177 void DispatchDidAddAnimation(); |
176 void DispatchCompositeImmediately(); | 178 void DispatchCompositeImmediately(); |
177 | 179 |
178 virtual void AfterTest() = 0; | 180 virtual void AfterTest() = 0; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 376 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
375 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 377 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
376 | 378 |
377 // Some tests want to control when notify ready for activation occurs, | 379 // Some tests want to control when notify ready for activation occurs, |
378 // but this is not supported in the single-threaded case. | 380 // but this is not supported in the single-threaded case. |
379 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 381 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
380 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 382 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
381 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 383 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
382 | 384 |
383 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 385 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |