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 #include "cc/test/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 // Implementation of LayerTreeHost callback interface. | 227 // Implementation of LayerTreeHost callback interface. |
228 class LayerTreeHostClientForTesting : public LayerTreeHostClient { | 228 class LayerTreeHostClientForTesting : public LayerTreeHostClient { |
229 public: | 229 public: |
230 static scoped_ptr<LayerTreeHostClientForTesting> Create( | 230 static scoped_ptr<LayerTreeHostClientForTesting> Create( |
231 TestHooks* test_hooks) { | 231 TestHooks* test_hooks) { |
232 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); | 232 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); |
233 } | 233 } |
234 virtual ~LayerTreeHostClientForTesting() {} | 234 virtual ~LayerTreeHostClientForTesting() {} |
235 | 235 |
236 virtual void WillBeginFrame() OVERRIDE {} | 236 virtual void WillBeginFrame() OVERRIDE { |
| 237 test_hooks_->WillBeginFrame(); |
| 238 } |
237 | 239 |
238 virtual void DidBeginFrame() OVERRIDE {} | 240 virtual void DidBeginFrame() OVERRIDE { |
| 241 test_hooks_->DidBeginFrame(); |
| 242 } |
239 | 243 |
240 virtual void Animate(double monotonic_time) OVERRIDE { | 244 virtual void Animate(double monotonic_time) OVERRIDE { |
241 test_hooks_->Animate(base::TimeTicks::FromInternalValue( | 245 test_hooks_->Animate(base::TimeTicks::FromInternalValue( |
242 monotonic_time * base::Time::kMicrosecondsPerSecond)); | 246 monotonic_time * base::Time::kMicrosecondsPerSecond)); |
243 } | 247 } |
244 | 248 |
245 virtual void Layout() OVERRIDE { | 249 virtual void Layout() OVERRIDE { |
246 test_hooks_->Layout(); | 250 test_hooks_->Layout(); |
247 } | 251 } |
248 | 252 |
249 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, | 253 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, |
250 float scale) OVERRIDE { | 254 float scale) OVERRIDE { |
251 test_hooks_->ApplyScrollAndScale(scroll_delta, scale); | 255 test_hooks_->ApplyScrollAndScale(scroll_delta, scale); |
252 } | 256 } |
253 | 257 |
254 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { | 258 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { |
255 return test_hooks_->CreateOutputSurface(); | 259 return test_hooks_->CreateOutputSurface(); |
256 } | 260 } |
257 | 261 |
258 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE { | 262 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE { |
259 test_hooks_->DidInitializeOutputSurface(succeeded); | 263 test_hooks_->DidInitializeOutputSurface(succeeded); |
260 } | 264 } |
261 | 265 |
262 virtual void DidFailToInitializeOutputSurface() OVERRIDE { | 266 virtual void DidFailToInitializeOutputSurface() OVERRIDE { |
263 test_hooks_->DidFailToInitializeOutputSurface(); | 267 test_hooks_->DidFailToInitializeOutputSurface(); |
264 } | 268 } |
265 | 269 |
266 virtual void WillCommit() OVERRIDE {} | 270 virtual void WillCommit() OVERRIDE { |
| 271 test_hooks_->WillCommit(); |
| 272 } |
267 | 273 |
268 virtual void DidCommit() OVERRIDE { | 274 virtual void DidCommit() OVERRIDE { |
269 test_hooks_->DidCommit(); | 275 test_hooks_->DidCommit(); |
270 } | 276 } |
271 | 277 |
272 virtual void DidCommitAndDrawFrame() OVERRIDE { | 278 virtual void DidCommitAndDrawFrame() OVERRIDE { |
273 test_hooks_->DidCommitAndDrawFrame(); | 279 test_hooks_->DidCommitAndDrawFrame(); |
274 } | 280 } |
275 | 281 |
276 virtual void DidCompleteSwapBuffers() OVERRIDE { | 282 virtual void DidCompleteSwapBuffers() OVERRIDE { |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 631 |
626 scoped_refptr<cc::ContextProvider> LayerTreeTest:: | 632 scoped_refptr<cc::ContextProvider> LayerTreeTest:: |
627 OffscreenContextProviderForCompositorThread() { | 633 OffscreenContextProviderForCompositorThread() { |
628 if (!compositor_thread_contexts_.get() || | 634 if (!compositor_thread_contexts_.get() || |
629 compositor_thread_contexts_->DestroyedOnMainThread()) | 635 compositor_thread_contexts_->DestroyedOnMainThread()) |
630 compositor_thread_contexts_ = FakeContextProvider::Create(); | 636 compositor_thread_contexts_ = FakeContextProvider::Create(); |
631 return compositor_thread_contexts_; | 637 return compositor_thread_contexts_; |
632 } | 638 } |
633 | 639 |
634 } // namespace cc | 640 } // namespace cc |
OLD | NEW |