Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 696413003: cc: Introduce forward_begin_frames_to_children and use_external_begin_frame_source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sep
Patch Set: rebase on master Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 } 600 }
601 601
602 void LayerTreeTest::WillBeginTest() { 602 void LayerTreeTest::WillBeginTest() {
603 layer_tree_host_->SetLayerTreeHostClientReady(); 603 layer_tree_host_->SetLayerTreeHostClientReady();
604 } 604 }
605 605
606 void LayerTreeTest::DoBeginTest() { 606 void LayerTreeTest::DoBeginTest() {
607 client_ = LayerTreeHostClientForTesting::Create(this); 607 client_ = LayerTreeHostClientForTesting::Create(this);
608 608
609 scoped_ptr<ExternalBeginFrameSourceForTest> external_begin_frame_source; 609 scoped_ptr<ExternalBeginFrameSourceForTest> external_begin_frame_source;
610 if (settings_.begin_frame_scheduling_enabled && 610 if (settings_.use_external_begin_frame_source &&
611 settings_.throttle_frame_production) { 611 settings_.throttle_frame_production) {
612 external_begin_frame_source.reset( 612 external_begin_frame_source.reset(
613 new ExternalBeginFrameSourceForTest(settings_.refresh_rate)); 613 new ExternalBeginFrameSourceForTest(settings_.refresh_rate));
614 external_begin_frame_source_ = external_begin_frame_source.get(); 614 external_begin_frame_source_ = external_begin_frame_source.get();
615 } 615 }
616 616
617 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); 617 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get());
618 layer_tree_host_ = LayerTreeHostForTesting::Create( 618 layer_tree_host_ = LayerTreeHostForTesting::Create(
619 this, 619 this,
620 client_.get(), 620 client_.get(),
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 784
785 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) { 785 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) {
786 scoped_ptr<FakeOutputSurface> output_surface = 786 scoped_ptr<FakeOutputSurface> output_surface =
787 CreateFakeOutputSurface(fallback); 787 CreateFakeOutputSurface(fallback);
788 if (output_surface) { 788 if (output_surface) {
789 DCHECK_EQ(delegating_renderer_, 789 DCHECK_EQ(delegating_renderer_,
790 output_surface->capabilities().delegated_rendering); 790 output_surface->capabilities().delegated_rendering);
791 } 791 }
792 output_surface_ = output_surface.get(); 792 output_surface_ = output_surface.get();
793 793
794 if (settings_.begin_frame_scheduling_enabled && 794 if (settings_.use_external_begin_frame_source &&
795 settings_.throttle_frame_production) { 795 settings_.throttle_frame_production) {
796 DCHECK(external_begin_frame_source_); 796 DCHECK(external_begin_frame_source_);
797 DCHECK(external_begin_frame_source_->is_ready()); 797 DCHECK(external_begin_frame_source_->is_ready());
798 } 798 }
799 return output_surface.Pass(); 799 return output_surface.Pass();
800 } 800 }
801 801
802 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface( 802 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface(
803 bool fallback) { 803 bool fallback) {
804 if (delegating_renderer_) 804 if (delegating_renderer_)
(...skipping 17 matching lines...) Expand all
822 return -1; 822 return -1;
823 } 823 }
824 824
825 void LayerTreeTest::DestroyLayerTreeHost() { 825 void LayerTreeTest::DestroyLayerTreeHost() {
826 if (layer_tree_host_ && layer_tree_host_->root_layer()) 826 if (layer_tree_host_ && layer_tree_host_->root_layer())
827 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); 827 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL);
828 layer_tree_host_ = nullptr; 828 layer_tree_host_ = nullptr;
829 } 829 }
830 830
831 } // namespace cc 831 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698