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_COMMON_H_ | 5 #ifndef CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
6 #define CC_TEST_LAYER_TREE_TEST_COMMON_H_ | 6 #define CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
7 | 7 |
8 #include "cc/layer_tree_host.h" | 8 #include "cc/layer_tree_host.h" |
9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
10 #include "cc/layer_tree_host_impl.h" | 10 #include "cc/layer_tree_host_impl.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace WebKitTests { | 24 namespace WebKitTests { |
25 | 25 |
26 // Used by test stubs to notify the test when something interesting happens. | 26 // Used by test stubs to notify the test when something interesting happens. |
27 class TestHooks : public WebKit::WebAnimationDelegate { | 27 class TestHooks : public WebKit::WebAnimationDelegate { |
28 public: | 28 public: |
29 virtual void beginCommitOnThread(cc::LayerTreeHostImpl*) { } | 29 virtual void beginCommitOnThread(cc::LayerTreeHostImpl*) { } |
30 virtual void commitCompleteOnThread(cc::LayerTreeHostImpl*) { } | 30 virtual void commitCompleteOnThread(cc::LayerTreeHostImpl*) { } |
31 virtual bool prepareToDrawOnThread(cc::LayerTreeHostImpl*); | 31 virtual bool prepareToDrawOnThread(cc::LayerTreeHostImpl*); |
32 virtual void drawLayersOnThread(cc::LayerTreeHostImpl*) { } | 32 virtual void drawLayersOnThread(cc::LayerTreeHostImpl*) { } |
33 virtual void animateLayers(cc::LayerTreeHostImpl*, double monotonicTime) { } | 33 virtual void animateLayers(cc::LayerTreeHostImpl*, base::TimeTicks monotonic
Time) { } |
34 virtual void willAnimateLayers(cc::LayerTreeHostImpl*, double monotonicTime)
{ } | 34 virtual void willAnimateLayers(cc::LayerTreeHostImpl*, base::TimeTicks monot
onicTime) { } |
35 virtual void applyScrollAndScale(const cc::IntSize&, float) { } | 35 virtual void applyScrollAndScale(const cc::IntSize&, float) { } |
36 virtual void animate(double monotonicTime) { } | 36 virtual void animate(base::TimeTicks monotonicTime) { } |
37 virtual void layout() { } | 37 virtual void layout() { } |
38 virtual void didRecreateOutputSurface(bool succeeded) { } | 38 virtual void didRecreateOutputSurface(bool succeeded) { } |
39 virtual void didAddAnimation() { } | 39 virtual void didAddAnimation() { } |
40 virtual void didCommit() { } | 40 virtual void didCommit() { } |
41 virtual void didCommitAndDrawFrame() { } | 41 virtual void didCommitAndDrawFrame() { } |
42 virtual void scheduleComposite() { } | 42 virtual void scheduleComposite() { } |
43 virtual void didDeferCommit() { } | 43 virtual void didDeferCommit() { } |
44 | 44 |
45 // Implementation of WebAnimationDelegate | 45 // Implementation of WebAnimationDelegate |
46 virtual void notifyAnimationStarted(double time) OVERRIDE { } | 46 virtual void notifyAnimationStarted(double time) OVERRIDE { } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 virtual void beginCommit() OVERRIDE; | 151 virtual void beginCommit() OVERRIDE; |
152 virtual void commitComplete() OVERRIDE; | 152 virtual void commitComplete() OVERRIDE; |
153 virtual bool prepareToDraw(FrameData&) OVERRIDE; | 153 virtual bool prepareToDraw(FrameData&) OVERRIDE; |
154 virtual void drawLayers(const FrameData&) OVERRIDE; | 154 virtual void drawLayers(const FrameData&) OVERRIDE; |
155 | 155 |
156 // Make these public. | 156 // Make these public. |
157 typedef std::vector<cc::LayerImpl*> LayerList; | 157 typedef std::vector<cc::LayerImpl*> LayerList; |
158 using LayerTreeHostImpl::calculateRenderSurfaceLayerList; | 158 using LayerTreeHostImpl::calculateRenderSurfaceLayerList; |
159 | 159 |
160 protected: | 160 protected: |
161 virtual void animateLayers(double monotonicTime, double wallClockTime) OVERR
IDE; | 161 virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClo
ckTime) OVERRIDE; |
162 virtual base::TimeDelta lowFrequencyAnimationInterval() const OVERRIDE; | 162 virtual base::TimeDelta lowFrequencyAnimationInterval() const OVERRIDE; |
163 | 163 |
164 private: | 164 private: |
165 MockLayerTreeHostImpl(TestHooks*, const cc::LayerTreeSettings&, cc::LayerTre
eHostImplClient*); | 165 MockLayerTreeHostImpl(TestHooks*, const cc::LayerTreeSettings&, cc::LayerTre
eHostImplClient*); |
166 | 166 |
167 TestHooks* m_testHooks; | 167 TestHooks* m_testHooks; |
168 }; | 168 }; |
169 | 169 |
170 class CompositorFakeWebGraphicsContext3DWithTextureTracking : public WebKit::Com
positorFakeWebGraphicsContext3D { | 170 class CompositorFakeWebGraphicsContext3DWithTextureTracking : public WebKit::Com
positorFakeWebGraphicsContext3D { |
171 public: | 171 public: |
(...skipping 27 matching lines...) Expand all Loading... |
199 TEST_F(TEST_FIXTURE_NAME, runSingleThread) \ | 199 TEST_F(TEST_FIXTURE_NAME, runSingleThread) \ |
200 { \ | 200 { \ |
201 runTest(false); \ | 201 runTest(false); \ |
202 } \ | 202 } \ |
203 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ | 203 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ |
204 { \ | 204 { \ |
205 runTest(true); \ | 205 runTest(true); \ |
206 } | 206 } |
207 | 207 |
208 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ | 208 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
OLD | NEW |