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

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

Issue 675083002: Add cc::RendererSettings for use in with cc::Display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/surfaces/display.cc ('k') | cc/test/pixel_test.h » ('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 void LayerTreeTest::WillBeginTest() { 600 void LayerTreeTest::WillBeginTest() {
601 layer_tree_host_->SetLayerTreeHostClientReady(); 601 layer_tree_host_->SetLayerTreeHostClientReady();
602 } 602 }
603 603
604 void LayerTreeTest::DoBeginTest() { 604 void LayerTreeTest::DoBeginTest() {
605 client_ = LayerTreeHostClientForTesting::Create(this); 605 client_ = LayerTreeHostClientForTesting::Create(this);
606 606
607 scoped_ptr<ExternalBeginFrameSourceForTest> external_begin_frame_source; 607 scoped_ptr<ExternalBeginFrameSourceForTest> external_begin_frame_source;
608 if (settings_.use_external_begin_frame_source && 608 if (settings_.use_external_begin_frame_source &&
609 settings_.throttle_frame_production) { 609 settings_.throttle_frame_production) {
610 external_begin_frame_source.reset( 610 external_begin_frame_source.reset(new ExternalBeginFrameSourceForTest(
611 new ExternalBeginFrameSourceForTest(settings_.refresh_rate)); 611 settings_.renderer_settings.refresh_rate));
612 external_begin_frame_source_ = external_begin_frame_source.get(); 612 external_begin_frame_source_ = external_begin_frame_source.get();
613 } 613 }
614 614
615 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); 615 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get());
616 layer_tree_host_ = LayerTreeHostForTesting::Create( 616 layer_tree_host_ = LayerTreeHostForTesting::Create(
617 this, 617 this,
618 client_.get(), 618 client_.get(),
619 settings_, 619 settings_,
620 base::MessageLoopProxy::current(), 620 base::MessageLoopProxy::current(),
621 impl_thread_ ? impl_thread_->message_loop_proxy() : NULL, 621 impl_thread_ ? impl_thread_->message_loop_proxy() : NULL,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 impl_thread_.reset(new base::Thread("Compositor")); 734 impl_thread_.reset(new base::Thread("Compositor"));
735 ASSERT_TRUE(impl_thread_->Start()); 735 ASSERT_TRUE(impl_thread_->Start());
736 } 736 }
737 737
738 main_task_runner_ = base::MessageLoopProxy::current(); 738 main_task_runner_ = base::MessageLoopProxy::current();
739 739
740 delegating_renderer_ = delegating_renderer; 740 delegating_renderer_ = delegating_renderer;
741 741
742 // Spend less time waiting for BeginFrame because the output is 742 // Spend less time waiting for BeginFrame because the output is
743 // mocked out. 743 // mocked out.
744 settings_.refresh_rate = 200.0; 744 settings_.renderer_settings.refresh_rate = 200.0;
745 settings_.background_animation_rate = 200.0; 745 settings_.background_animation_rate = 200.0;
746 settings_.impl_side_painting = impl_side_painting; 746 settings_.impl_side_painting = impl_side_painting;
747 InitializeSettings(&settings_); 747 InitializeSettings(&settings_);
748 748
749 main_task_runner_->PostTask( 749 main_task_runner_->PostTask(
750 FROM_HERE, 750 FROM_HERE,
751 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this))); 751 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this)));
752 752
753 if (timeout_seconds_) { 753 if (timeout_seconds_) {
754 timeout_.Reset(base::Bind(&LayerTreeTest::Timeout, base::Unretained(this))); 754 timeout_.Reset(base::Bind(&LayerTreeTest::Timeout, base::Unretained(this)));
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 return -1; 820 return -1;
821 } 821 }
822 822
823 void LayerTreeTest::DestroyLayerTreeHost() { 823 void LayerTreeTest::DestroyLayerTreeHost() {
824 if (layer_tree_host_ && layer_tree_host_->root_layer()) 824 if (layer_tree_host_ && layer_tree_host_->root_layer())
825 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); 825 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL);
826 layer_tree_host_ = nullptr; 826 layer_tree_host_ = nullptr;
827 } 827 }
828 828
829 } // namespace cc 829 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/test/pixel_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698