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() {} |
87 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, | 88 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, |
88 bool visible) {} | 89 bool visible) {} |
89 virtual void ScheduleComposite() {} | 90 virtual void ScheduleComposite() {} |
90 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} | 91 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} |
91 | 92 |
92 // Hooks for SchedulerClient. | 93 // 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); | |
141 void PostSetNeedsCommitToMainThread(); | 140 void PostSetNeedsCommitToMainThread(); |
142 void PostSetNeedsUpdateLayersToMainThread(); | 141 void PostSetNeedsUpdateLayersToMainThread(); |
143 void PostSetNeedsRedrawToMainThread(); | 142 void PostSetNeedsRedrawToMainThread(); |
144 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); | 143 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); |
145 void PostSetVisibleToMainThread(bool visible); | 144 void PostSetVisibleToMainThread(bool visible); |
146 void PostSetNextCommitForcesRedrawToMainThread(); | 145 void PostSetNextCommitForcesRedrawToMainThread(); |
147 void PostCompositeImmediatelyToMainThread(); | 146 void PostCompositeImmediatelyToMainThread(); |
148 | 147 |
149 void DoBeginTest(); | 148 void DoBeginTest(); |
150 void Timeout(); | 149 void Timeout(); |
151 | 150 |
152 bool verify_property_trees() const { return verify_property_trees_; } | 151 bool verify_property_trees() const { return verify_property_trees_; } |
153 void set_verify_property_trees(bool verify_property_trees) { | 152 void set_verify_property_trees(bool verify_property_trees) { |
154 verify_property_trees_ = verify_property_trees; | 153 verify_property_trees_ = verify_property_trees; |
155 } | 154 } |
156 | 155 |
157 protected: | 156 protected: |
158 LayerTreeTest(); | 157 LayerTreeTest(); |
159 | 158 |
160 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 159 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
161 | 160 |
162 void RealEndTest(); | 161 void RealEndTest(); |
163 | 162 |
164 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 163 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
165 double animation_duration); | 164 double animation_duration); |
166 void DispatchSetDeferCommits(bool defer_commits); | |
167 void DispatchSetNeedsCommit(); | 165 void DispatchSetNeedsCommit(); |
168 void DispatchSetNeedsUpdateLayers(); | 166 void DispatchSetNeedsUpdateLayers(); |
169 void DispatchSetNeedsRedraw(); | 167 void DispatchSetNeedsRedraw(); |
170 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 168 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
171 void DispatchSetVisible(bool visible); | 169 void DispatchSetVisible(bool visible); |
172 void DispatchSetNextCommitForcesRedraw(); | 170 void DispatchSetNextCommitForcesRedraw(); |
173 void DispatchDidAddAnimation(); | 171 void DispatchDidAddAnimation(); |
174 void DispatchCompositeImmediately(); | 172 void DispatchCompositeImmediately(); |
175 | 173 |
176 virtual void AfterTest() = 0; | 174 virtual void AfterTest() = 0; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 370 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
373 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 371 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
374 | 372 |
375 // Some tests want to control when notify ready for activation occurs, | 373 // Some tests want to control when notify ready for activation occurs, |
376 // but this is not supported in the single-threaded case. | 374 // but this is not supported in the single-threaded case. |
377 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 375 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
378 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 376 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
379 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 377 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
380 | 378 |
381 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 379 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |