| 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 } | 601 } |
| 602 | 602 |
| 603 void LayerTreeTest::WillBeginTest() { | 603 void LayerTreeTest::WillBeginTest() { |
| 604 layer_tree_host_->SetLayerTreeHostClientReady(); | 604 layer_tree_host_->SetLayerTreeHostClientReady(); |
| 605 } | 605 } |
| 606 | 606 |
| 607 void LayerTreeTest::DoBeginTest() { | 607 void LayerTreeTest::DoBeginTest() { |
| 608 client_ = LayerTreeHostClientForTesting::Create(this); | 608 client_ = LayerTreeHostClientForTesting::Create(this); |
| 609 | 609 |
| 610 scoped_ptr<ExternalBeginFrameSourceForTest> external_begin_frame_source; | 610 scoped_ptr<ExternalBeginFrameSourceForTest> external_begin_frame_source; |
| 611 if (settings_.begin_frame_scheduling_enabled && | 611 if (settings_.begin_frame_receiver && settings_.throttle_frame_production) { |
| 612 settings_.throttle_frame_production) { | |
| 613 external_begin_frame_source.reset( | 612 external_begin_frame_source.reset( |
| 614 new ExternalBeginFrameSourceForTest(settings_.refresh_rate)); | 613 new ExternalBeginFrameSourceForTest(settings_.refresh_rate)); |
| 615 external_begin_frame_source_ = external_begin_frame_source.get(); | 614 external_begin_frame_source_ = external_begin_frame_source.get(); |
| 616 } | 615 } |
| 617 | 616 |
| 618 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); | 617 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); |
| 619 layer_tree_host_ = LayerTreeHostForTesting::Create( | 618 layer_tree_host_ = LayerTreeHostForTesting::Create( |
| 620 this, | 619 this, |
| 621 client_.get(), | 620 client_.get(), |
| 622 settings_, | 621 settings_, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 | 783 |
| 785 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) { | 784 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) { |
| 786 scoped_ptr<FakeOutputSurface> output_surface = | 785 scoped_ptr<FakeOutputSurface> output_surface = |
| 787 CreateFakeOutputSurface(fallback); | 786 CreateFakeOutputSurface(fallback); |
| 788 if (output_surface) { | 787 if (output_surface) { |
| 789 DCHECK_EQ(delegating_renderer_, | 788 DCHECK_EQ(delegating_renderer_, |
| 790 output_surface->capabilities().delegated_rendering); | 789 output_surface->capabilities().delegated_rendering); |
| 791 } | 790 } |
| 792 output_surface_ = output_surface.get(); | 791 output_surface_ = output_surface.get(); |
| 793 | 792 |
| 794 if (settings_.begin_frame_scheduling_enabled && | 793 if (settings_.begin_frame_receiver && settings_.throttle_frame_production) { |
| 795 settings_.throttle_frame_production) { | |
| 796 DCHECK(external_begin_frame_source_); | 794 DCHECK(external_begin_frame_source_); |
| 797 DCHECK(external_begin_frame_source_->is_ready()); | 795 DCHECK(external_begin_frame_source_->is_ready()); |
| 798 } | 796 } |
| 799 return output_surface.Pass(); | 797 return output_surface.Pass(); |
| 800 } | 798 } |
| 801 | 799 |
| 802 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface( | 800 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface( |
| 803 bool fallback) { | 801 bool fallback) { |
| 804 if (delegating_renderer_) | 802 if (delegating_renderer_) |
| 805 return FakeOutputSurface::CreateDelegating3d(); | 803 return FakeOutputSurface::CreateDelegating3d(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 822 return -1; | 820 return -1; |
| 823 } | 821 } |
| 824 | 822 |
| 825 void LayerTreeTest::DestroyLayerTreeHost() { | 823 void LayerTreeTest::DestroyLayerTreeHost() { |
| 826 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 824 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 827 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 825 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 828 layer_tree_host_ = nullptr; | 826 layer_tree_host_ = nullptr; |
| 829 } | 827 } |
| 830 | 828 |
| 831 } // namespace cc | 829 } // namespace cc |
| OLD | NEW |