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