Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Side by Side Diff: cc/test/layer_tree_test.h

Issue 1010663002: CC Animations: Redirect all compositor animation requests to AnimationHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@introduce
Patch Set: Add ported unittests. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "cc/trees/layer_tree_host.h" 11 #include "cc/trees/layer_tree_host.h"
12 #include "cc/trees/layer_tree_host_impl.h" 12 #include "cc/trees/layer_tree_host_impl.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace cc { 15 namespace cc {
16 class AnimationPlayer;
16 class FakeExternalBeginFrameSource; 17 class FakeExternalBeginFrameSource;
17 class FakeLayerTreeHostClient; 18 class FakeLayerTreeHostClient;
18 class FakeOutputSurface; 19 class FakeOutputSurface;
19 class LayerImpl; 20 class LayerImpl;
20 class LayerTreeHost; 21 class LayerTreeHost;
21 class LayerTreeHostClient; 22 class LayerTreeHostClient;
22 class LayerTreeHostImpl; 23 class LayerTreeHostImpl;
23 class TestContextProvider; 24 class TestContextProvider;
24 class TestGpuMemoryBufferManager; 25 class TestGpuMemoryBufferManager;
25 class TestWebGraphicsContext3D; 26 class TestWebGraphicsContext3D;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 class LayerTreeTest : public testing::Test, public TestHooks { 132 class LayerTreeTest : public testing::Test, public TestHooks {
132 public: 133 public:
133 ~LayerTreeTest() override; 134 ~LayerTreeTest() override;
134 135
135 virtual void EndTest(); 136 virtual void EndTest();
136 void EndTestAfterDelayMs(int delay_milliseconds); 137 void EndTestAfterDelayMs(int delay_milliseconds);
137 138
138 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); 139 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation);
139 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); 140 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation);
140 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); 141 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation);
142 void PostAddAnimationToMainThreadPlayer(
143 AnimationPlayer* player_to_receive_animation);
144 void PostAddInstantAnimationToMainThreadPlayer(
145 AnimationPlayer* player_to_receive_animation);
146 void PostAddLongAnimationToMainThreadPlayer(
147 AnimationPlayer* player_to_receive_animation);
141 void PostSetDeferCommitsToMainThread(bool defer_commits); 148 void PostSetDeferCommitsToMainThread(bool defer_commits);
142 void PostSetNeedsCommitToMainThread(); 149 void PostSetNeedsCommitToMainThread();
143 void PostSetNeedsUpdateLayersToMainThread(); 150 void PostSetNeedsUpdateLayersToMainThread();
144 void PostSetNeedsRedrawToMainThread(); 151 void PostSetNeedsRedrawToMainThread();
145 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); 152 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect);
146 void PostSetVisibleToMainThread(bool visible); 153 void PostSetVisibleToMainThread(bool visible);
147 void PostSetNextCommitForcesRedrawToMainThread(); 154 void PostSetNextCommitForcesRedrawToMainThread();
148 void PostCompositeImmediatelyToMainThread(); 155 void PostCompositeImmediatelyToMainThread();
149 156
150 void DoBeginTest(); 157 void DoBeginTest();
151 void Timeout(); 158 void Timeout();
152 159
153 bool verify_property_trees() const { return verify_property_trees_; } 160 bool verify_property_trees() const { return verify_property_trees_; }
154 void set_verify_property_trees(bool verify_property_trees) { 161 void set_verify_property_trees(bool verify_property_trees) {
155 verify_property_trees_ = verify_property_trees; 162 verify_property_trees_ = verify_property_trees;
156 } 163 }
157 164
158 protected: 165 protected:
159 LayerTreeTest(); 166 LayerTreeTest();
160 167
161 virtual void InitializeSettings(LayerTreeSettings* settings) {} 168 virtual void InitializeSettings(LayerTreeSettings* settings) {}
162 169
163 void RealEndTest(); 170 void RealEndTest();
164 171
165 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, 172 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation,
166 double animation_duration); 173 double animation_duration);
174 virtual void DispatchAddAnimationToPlayer(
175 AnimationPlayer* player_to_receive_animation,
176 double animation_duration);
167 void DispatchSetDeferCommits(bool defer_commits); 177 void DispatchSetDeferCommits(bool defer_commits);
168 void DispatchSetNeedsCommit(); 178 void DispatchSetNeedsCommit();
169 void DispatchSetNeedsUpdateLayers(); 179 void DispatchSetNeedsUpdateLayers();
170 void DispatchSetNeedsRedraw(); 180 void DispatchSetNeedsRedraw();
171 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); 181 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect);
172 void DispatchSetVisible(bool visible); 182 void DispatchSetVisible(bool visible);
173 void DispatchSetNextCommitForcesRedraw(); 183 void DispatchSetNextCommitForcesRedraw();
174 void DispatchDidAddAnimation(); 184 void DispatchDidAddAnimation();
175 void DispatchCompositeImmediately(); 185 void DispatchCompositeImmediately();
176 186
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ 389 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \
380 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) 390 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME)
381 391
382 // Some tests want to control when notify ready for activation occurs, 392 // Some tests want to control when notify ready for activation occurs,
383 // but this is not supported in the single-threaded case. 393 // but this is not supported in the single-threaded case.
384 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ 394 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \
385 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ 395 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \
386 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) 396 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME)
387 397
388 #endif // CC_TEST_LAYER_TREE_TEST_H_ 398 #endif // CC_TEST_LAYER_TREE_TEST_H_
OLDNEW
« cc/layers/layer.cc ('K') | « cc/layers/layer_utils.cc ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698