| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 test_hooks_->Animate(monotonic_time); | 284 test_hooks_->Animate(monotonic_time); |
| 285 } | 285 } |
| 286 | 286 |
| 287 virtual void Layout() OVERRIDE { test_hooks_->Layout(); } | 287 virtual void Layout() OVERRIDE { test_hooks_->Layout(); } |
| 288 | 288 |
| 289 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, | 289 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, |
| 290 float scale) OVERRIDE { | 290 float scale) OVERRIDE { |
| 291 test_hooks_->ApplyScrollAndScale(scroll_delta, scale); | 291 test_hooks_->ApplyScrollAndScale(scroll_delta, scale); |
| 292 } | 292 } |
| 293 | 293 |
| 294 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) | 294 virtual void RequestNewOutputSurface(bool fallback) OVERRIDE { |
| 295 OVERRIDE { | 295 test_hooks_->RequestNewOutputSurface(fallback); |
| 296 return test_hooks_->CreateOutputSurface(fallback); | |
| 297 } | 296 } |
| 298 | 297 |
| 299 virtual void DidInitializeOutputSurface() OVERRIDE { | 298 virtual void DidInitializeOutputSurface() OVERRIDE { |
| 300 test_hooks_->DidInitializeOutputSurface(); | 299 test_hooks_->DidInitializeOutputSurface(); |
| 301 } | 300 } |
| 302 | 301 |
| 303 virtual void DidFailToInitializeOutputSurface() OVERRIDE { | 302 virtual void DidFailToInitializeOutputSurface() OVERRIDE { |
| 304 test_hooks_->DidFailToInitializeOutputSurface(); | 303 test_hooks_->DidFailToInitializeOutputSurface(); |
| 305 } | 304 } |
| 306 | 305 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 FAIL() << "Test timed out"; | 656 FAIL() << "Test timed out"; |
| 658 return; | 657 return; |
| 659 } | 658 } |
| 660 AfterTest(); | 659 AfterTest(); |
| 661 } | 660 } |
| 662 | 661 |
| 663 void LayerTreeTest::RunTestWithImplSidePainting() { | 662 void LayerTreeTest::RunTestWithImplSidePainting() { |
| 664 RunTest(true, false, true); | 663 RunTest(true, false, true); |
| 665 } | 664 } |
| 666 | 665 |
| 666 void LayerTreeTest::RequestNewOutputSurface(bool fallback) { |
| 667 layer_tree_host_->SetOutputSurface(CreateOutputSurface(fallback)); |
| 668 } |
| 669 |
| 667 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) { | 670 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) { |
| 668 scoped_ptr<FakeOutputSurface> output_surface = | 671 scoped_ptr<FakeOutputSurface> output_surface = |
| 669 CreateFakeOutputSurface(fallback); | 672 CreateFakeOutputSurface(fallback); |
| 670 if (output_surface) { | 673 if (output_surface) { |
| 671 DCHECK_EQ(delegating_renderer_, | 674 DCHECK_EQ(delegating_renderer_, |
| 672 output_surface->capabilities().delegated_rendering); | 675 output_surface->capabilities().delegated_rendering); |
| 673 } | 676 } |
| 674 output_surface_ = output_surface.get(); | 677 output_surface_ = output_surface.get(); |
| 675 return output_surface.PassAs<OutputSurface>(); | 678 return output_surface.PassAs<OutputSurface>(); |
| 676 } | 679 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 698 return -1; | 701 return -1; |
| 699 } | 702 } |
| 700 | 703 |
| 701 void LayerTreeTest::DestroyLayerTreeHost() { | 704 void LayerTreeTest::DestroyLayerTreeHost() { |
| 702 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 705 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 703 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 706 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 704 layer_tree_host_.reset(); | 707 layer_tree_host_.reset(); |
| 705 } | 708 } |
| 706 | 709 |
| 707 } // namespace cc | 710 } // namespace cc |
| OLD | NEW |