| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual void WillBeginMainFrame() {} | 78 virtual void WillBeginMainFrame() {} |
| 79 virtual void DidBeginMainFrame() {} | 79 virtual void DidBeginMainFrame() {} |
| 80 virtual void Layout() {} | 80 virtual void Layout() {} |
| 81 virtual void DidInitializeOutputSurface() {} | 81 virtual void DidInitializeOutputSurface() {} |
| 82 virtual void DidFailToInitializeOutputSurface() {} | 82 virtual void DidFailToInitializeOutputSurface() {} |
| 83 virtual void DidAddAnimation() {} | 83 virtual void DidAddAnimation() {} |
| 84 virtual void WillCommit() {} | 84 virtual void WillCommit() {} |
| 85 virtual void DidCommit() {} | 85 virtual void DidCommit() {} |
| 86 virtual void DidCommitAndDrawFrame() {} | 86 virtual void DidCommitAndDrawFrame() {} |
| 87 virtual void DidCompleteSwapBuffers() {} | 87 virtual void DidCompleteSwapBuffers() {} |
| 88 virtual void DidDeferCommit() {} | |
| 89 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, | 88 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, |
| 90 bool visible) {} | 89 bool visible) {} |
| 91 virtual void ScheduleComposite() {} | 90 virtual void ScheduleComposite() {} |
| 92 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} | 91 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} |
| 93 | 92 |
| 94 // Hooks for SchedulerClient. | 93 // Hooks for SchedulerClient. |
| 95 virtual void ScheduledActionWillSendBeginMainFrame() {} | 94 virtual void ScheduledActionWillSendBeginMainFrame() {} |
| 96 virtual void ScheduledActionSendBeginMainFrame() {} | 95 virtual void ScheduledActionSendBeginMainFrame() {} |
| 97 virtual void ScheduledActionDrawAndSwapIfPossible() {} | 96 virtual void ScheduledActionDrawAndSwapIfPossible() {} |
| 98 virtual void ScheduledActionAnimate() {} | 97 virtual void ScheduledActionAnimate() {} |
| (...skipping 28 matching lines...) Expand all Loading... |
| 127 // | 126 // |
| 128 // The test continues until someone calls EndTest. EndTest can be called on any | 127 // The test continues until someone calls EndTest. EndTest can be called on any |
| 129 // thread, but be aware that ending the test is an asynchronous process. | 128 // thread, but be aware that ending the test is an asynchronous process. |
| 130 class LayerTreeTest : public testing::Test, public TestHooks { | 129 class LayerTreeTest : public testing::Test, public TestHooks { |
| 131 public: | 130 public: |
| 132 virtual ~LayerTreeTest(); | 131 virtual ~LayerTreeTest(); |
| 133 | 132 |
| 134 virtual void EndTest(); | 133 virtual void EndTest(); |
| 135 void EndTestAfterDelayMs(int delay_milliseconds); | 134 void EndTestAfterDelayMs(int delay_milliseconds); |
| 136 | 135 |
| 136 void PostSetDeferCommitsToMainThread(bool defer_commits); |
| 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 PostSetNeedsCommitToMainThread(); | 140 void PostSetNeedsCommitToMainThread(); |
| 141 void PostSetNeedsUpdateLayersToMainThread(); | 141 void PostSetNeedsUpdateLayersToMainThread(); |
| 142 void PostSetNeedsRedrawToMainThread(); | 142 void PostSetNeedsRedrawToMainThread(); |
| 143 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); | 143 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); |
| 144 void PostSetVisibleToMainThread(bool visible); | 144 void PostSetVisibleToMainThread(bool visible); |
| 145 void PostSetNextCommitForcesRedrawToMainThread(); | 145 void PostSetNextCommitForcesRedrawToMainThread(); |
| 146 void PostCompositeImmediatelyToMainThread(); | 146 void PostCompositeImmediatelyToMainThread(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 158 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 158 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
| 159 double animation_duration); | 159 double animation_duration); |
| 160 void DispatchSetNeedsCommit(); | 160 void DispatchSetNeedsCommit(); |
| 161 void DispatchSetNeedsUpdateLayers(); | 161 void DispatchSetNeedsUpdateLayers(); |
| 162 void DispatchSetNeedsRedraw(); | 162 void DispatchSetNeedsRedraw(); |
| 163 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 163 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
| 164 void DispatchSetVisible(bool visible); | 164 void DispatchSetVisible(bool visible); |
| 165 void DispatchSetNextCommitForcesRedraw(); | 165 void DispatchSetNextCommitForcesRedraw(); |
| 166 void DispatchDidAddAnimation(); | 166 void DispatchDidAddAnimation(); |
| 167 void DispatchCompositeImmediately(); | 167 void DispatchCompositeImmediately(); |
| 168 void DispatchSetDeferCommits(bool defer_commits); |
| 168 | 169 |
| 169 virtual void AfterTest() = 0; | 170 virtual void AfterTest() = 0; |
| 170 virtual void WillBeginTest(); | 171 virtual void WillBeginTest(); |
| 171 virtual void BeginTest() = 0; | 172 virtual void BeginTest() = 0; |
| 172 virtual void SetupTree(); | 173 virtual void SetupTree(); |
| 173 | 174 |
| 174 virtual void RunTest(bool threaded, | 175 virtual void RunTest(bool threaded, |
| 175 bool delegating_renderer, | 176 bool delegating_renderer, |
| 176 bool impl_side_painting); | 177 bool impl_side_painting); |
| 177 virtual void RunTestWithImplSidePainting(); | 178 virtual void RunTestWithImplSidePainting(); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 366 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
| 366 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 367 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
| 367 | 368 |
| 368 // Some tests want to control when notify ready for activation occurs, | 369 // Some tests want to control when notify ready for activation occurs, |
| 369 // but this is not supported in the single-threaded case. | 370 // but this is not supported in the single-threaded case. |
| 370 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 371 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 371 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 372 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
| 372 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 373 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 373 | 374 |
| 374 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 375 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |