| 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 16 matching lines...) Expand all Loading... |
| 27 class TestWebGraphicsContext3D; | 27 class TestWebGraphicsContext3D; |
| 28 | 28 |
| 29 // Used by test stubs to notify the test when something interesting happens. | 29 // Used by test stubs to notify the test when something interesting happens. |
| 30 class TestHooks : public AnimationDelegate { | 30 class TestHooks : public AnimationDelegate { |
| 31 public: | 31 public: |
| 32 TestHooks(); | 32 TestHooks(); |
| 33 ~TestHooks() override; | 33 ~TestHooks() override; |
| 34 | 34 |
| 35 void ReadSettings(const LayerTreeSettings& settings); | 35 void ReadSettings(const LayerTreeSettings& settings); |
| 36 | 36 |
| 37 virtual void CreateResourceAndRasterWorkerPool( |
| 38 LayerTreeHostImpl* host_impl, |
| 39 scoped_ptr<RasterWorkerPool>* raster_worker_pool, |
| 40 scoped_ptr<ResourcePool>* resource_pool, |
| 41 scoped_ptr<ResourcePool>* staging_resource_pool); |
| 37 virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, | 42 virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, |
| 38 const BeginFrameArgs& args) {} | 43 const BeginFrameArgs& args) {} |
| 39 virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, | 44 virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, |
| 40 bool did_handle) {} | 45 bool did_handle) {} |
| 41 virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) {} | 46 virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) {} |
| 42 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) {} | 47 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) {} |
| 43 virtual void WillActivateTreeOnThread(LayerTreeHostImpl* host_impl) {} | 48 virtual void WillActivateTreeOnThread(LayerTreeHostImpl* host_impl) {} |
| 44 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) {} | 49 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) {} |
| 45 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, | 50 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, |
| 46 bool success) {} | 51 bool success) {} |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 132 |
| 128 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); | 133 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); |
| 129 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); | 134 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); |
| 130 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); | 135 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); |
| 131 void PostSetNeedsCommitToMainThread(); | 136 void PostSetNeedsCommitToMainThread(); |
| 132 void PostSetNeedsUpdateLayersToMainThread(); | 137 void PostSetNeedsUpdateLayersToMainThread(); |
| 133 void PostSetNeedsRedrawToMainThread(); | 138 void PostSetNeedsRedrawToMainThread(); |
| 134 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); | 139 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); |
| 135 void PostSetVisibleToMainThread(bool visible); | 140 void PostSetVisibleToMainThread(bool visible); |
| 136 void PostSetNextCommitForcesRedrawToMainThread(); | 141 void PostSetNextCommitForcesRedrawToMainThread(); |
| 142 void PostCompositeImmediatelyToMainThread(); |
| 137 | 143 |
| 138 void DoBeginTest(); | 144 void DoBeginTest(); |
| 139 void Timeout(); | 145 void Timeout(); |
| 140 | 146 |
| 141 protected: | 147 protected: |
| 142 LayerTreeTest(); | 148 LayerTreeTest(); |
| 143 | 149 |
| 144 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 150 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
| 145 | 151 |
| 146 void RealEndTest(); | 152 void RealEndTest(); |
| 147 | 153 |
| 148 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 154 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
| 149 double animation_duration); | 155 double animation_duration); |
| 150 void DispatchSetNeedsCommit(); | 156 void DispatchSetNeedsCommit(); |
| 151 void DispatchSetNeedsUpdateLayers(); | 157 void DispatchSetNeedsUpdateLayers(); |
| 152 void DispatchSetNeedsRedraw(); | 158 void DispatchSetNeedsRedraw(); |
| 153 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 159 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
| 154 void DispatchSetVisible(bool visible); | 160 void DispatchSetVisible(bool visible); |
| 155 void DispatchSetNextCommitForcesRedraw(); | 161 void DispatchSetNextCommitForcesRedraw(); |
| 156 void DispatchDidAddAnimation(); | 162 void DispatchDidAddAnimation(); |
| 163 void DispatchCompositeImmediately(); |
| 157 | 164 |
| 158 virtual void AfterTest() = 0; | 165 virtual void AfterTest() = 0; |
| 159 virtual void WillBeginTest(); | 166 virtual void WillBeginTest(); |
| 160 virtual void BeginTest() = 0; | 167 virtual void BeginTest() = 0; |
| 161 virtual void SetupTree(); | 168 virtual void SetupTree(); |
| 162 | 169 |
| 163 virtual void RunTest(bool threaded, | 170 virtual void RunTest(bool threaded, |
| 164 bool delegating_renderer, | 171 bool delegating_renderer, |
| 165 bool impl_side_painting); | 172 bool impl_side_painting); |
| 166 virtual void RunTestWithImplSidePainting(); | 173 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); \ | 327 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
| 321 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 328 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
| 322 | 329 |
| 323 // Some tests want to control when notify ready for activation occurs, | 330 // Some tests want to control when notify ready for activation occurs, |
| 324 // but this is not supported in the single-threaded case. | 331 // but this is not supported in the single-threaded case. |
| 325 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 332 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 326 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 333 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
| 327 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 334 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 328 | 335 |
| 329 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 336 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |