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