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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 } | 573 } |
574 | 574 |
575 void LayerTreeTest::WillBeginTest() { | 575 void LayerTreeTest::WillBeginTest() { |
576 layer_tree_host_->SetLayerTreeHostClientReady(); | 576 layer_tree_host_->SetLayerTreeHostClientReady(); |
577 } | 577 } |
578 | 578 |
579 void LayerTreeTest::DoBeginTest() { | 579 void LayerTreeTest::DoBeginTest() { |
580 client_ = LayerTreeHostClientForTesting::Create(this); | 580 client_ = LayerTreeHostClientForTesting::Create(this); |
581 | 581 |
582 scoped_ptr<FakeExternalBeginFrameSource> external_begin_frame_source; | 582 scoped_ptr<FakeExternalBeginFrameSource> external_begin_frame_source; |
583 if (settings_.use_external_begin_frame_source && | 583 if (settings_.use_external_begin_frame_source) { |
584 settings_.throttle_frame_production) { | |
585 external_begin_frame_source.reset(new FakeExternalBeginFrameSource( | 584 external_begin_frame_source.reset(new FakeExternalBeginFrameSource( |
586 settings_.renderer_settings.refresh_rate)); | 585 settings_.renderer_settings.refresh_rate)); |
587 external_begin_frame_source_ = external_begin_frame_source.get(); | 586 external_begin_frame_source_ = external_begin_frame_source.get(); |
588 } | 587 } |
589 | 588 |
590 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); | 589 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); |
591 layer_tree_host_ = LayerTreeHostForTesting::Create( | 590 layer_tree_host_ = LayerTreeHostForTesting::Create( |
592 this, | 591 this, |
593 client_.get(), | 592 client_.get(), |
594 settings_, | 593 settings_, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 void LayerTreeTest::RequestNewOutputSurface() { | 754 void LayerTreeTest::RequestNewOutputSurface() { |
756 layer_tree_host_->SetOutputSurface(CreateOutputSurface()); | 755 layer_tree_host_->SetOutputSurface(CreateOutputSurface()); |
757 } | 756 } |
758 | 757 |
759 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface() { | 758 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface() { |
760 scoped_ptr<FakeOutputSurface> output_surface = CreateFakeOutputSurface(); | 759 scoped_ptr<FakeOutputSurface> output_surface = CreateFakeOutputSurface(); |
761 DCHECK_EQ(delegating_renderer_, | 760 DCHECK_EQ(delegating_renderer_, |
762 output_surface->capabilities().delegated_rendering); | 761 output_surface->capabilities().delegated_rendering); |
763 output_surface_ = output_surface.get(); | 762 output_surface_ = output_surface.get(); |
764 | 763 |
765 if (settings_.use_external_begin_frame_source && | 764 if (settings_.use_external_begin_frame_source) { |
766 settings_.throttle_frame_production) { | |
767 DCHECK(external_begin_frame_source_); | 765 DCHECK(external_begin_frame_source_); |
768 DCHECK(external_begin_frame_source_->is_ready()); | 766 DCHECK(external_begin_frame_source_->is_ready()); |
769 } | 767 } |
770 return output_surface.Pass(); | 768 return output_surface.Pass(); |
771 } | 769 } |
772 | 770 |
773 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface() { | 771 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface() { |
774 if (delegating_renderer_) | 772 if (delegating_renderer_) |
775 return FakeOutputSurface::CreateDelegating3d(); | 773 return FakeOutputSurface::CreateDelegating3d(); |
776 else | 774 else |
(...skipping 15 matching lines...) Expand all Loading... |
792 return -1; | 790 return -1; |
793 } | 791 } |
794 | 792 |
795 void LayerTreeTest::DestroyLayerTreeHost() { | 793 void LayerTreeTest::DestroyLayerTreeHost() { |
796 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 794 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
797 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 795 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
798 layer_tree_host_ = nullptr; | 796 layer_tree_host_ = nullptr; |
799 } | 797 } |
800 | 798 |
801 } // namespace cc | 799 } // namespace cc |
OLD | NEW |