diff options
author | bajones <bajones@chromium.org> | 2015-01-06 12:53:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-06 20:55:41 +0000 |
commit | 274110611d66427435521032dcbaceca8a502455 (patch) | |
tree | d9f61a62f7d8de721bc5ad298e4d81d4954ac9d4 /cc/test/scheduler_test_common.cc | |
parent | d2352889de5bb734efdad0855d39734036cd49ae (diff) | |
download | chromium_src-274110611d66427435521032dcbaceca8a502455.zip chromium_src-274110611d66427435521032dcbaceca8a502455.tar.gz chromium_src-274110611d66427435521032dcbaceca8a502455.tar.bz2 |
Added ability to dynamically toggle frame throttling in the scheduler.
In order to allow Vsync to be toggled by dev tools we need to both set the swap
interval to 0 on systems that support it and prevent the scheduler from
throttling frames.
BUG=437172
Review URL: https://codereview.chromium.org/811523002
Cr-Commit-Position: refs/heads/master@{#310139}
Diffstat (limited to 'cc/test/scheduler_test_common.cc')
-rw-r--r-- | cc/test/scheduler_test_common.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/cc/test/scheduler_test_common.cc b/cc/test/scheduler_test_common.cc index 61ef0cf..03e65ab 100644 --- a/cc/test/scheduler_test_common.cc +++ b/cc/test/scheduler_test_common.cc @@ -74,17 +74,7 @@ TestSchedulerFrameSourcesConstructor::~TestSchedulerFrameSourcesConstructor() { BeginFrameSource* TestSchedulerFrameSourcesConstructor::ConstructPrimaryFrameSource( Scheduler* scheduler) { - if (!scheduler->settings_.throttle_frame_production) { - TRACE_EVENT1( - "cc", - "TestSchedulerFrameSourcesConstructor::ConstructPrimaryFrameSource", - "source", - "TestBackToBackBeginFrameSource"); - DCHECK(!scheduler->primary_frame_source_internal_); - scheduler->primary_frame_source_internal_ = - TestBackToBackBeginFrameSource::Create(now_src_, test_task_runner_); - return scheduler->primary_frame_source_internal_.get(); - } else if (scheduler->settings_.use_external_begin_frame_source) { + if (scheduler->settings_.use_external_begin_frame_source) { return SchedulerFrameSourcesConstructor::ConstructPrimaryFrameSource( scheduler); } else { @@ -121,6 +111,19 @@ TestSchedulerFrameSourcesConstructor::ConstructBackgroundFrameSource( return scheduler->background_frame_source_internal_.get(); } +BeginFrameSource* +TestSchedulerFrameSourcesConstructor::ConstructUnthrottledFrameSource( + Scheduler* scheduler) { + TRACE_EVENT1( + "cc", + "TestSchedulerFrameSourcesConstructor::ConstructUnthrottledFrameSource", + "source", "TestBackToBackBeginFrameSource"); + DCHECK(!scheduler->unthrottled_frame_source_internal_); + scheduler->unthrottled_frame_source_internal_ = + TestBackToBackBeginFrameSource::Create(now_src_, test_task_runner_); + return scheduler->unthrottled_frame_source_internal_.get(); +} + TestScheduler::TestScheduler( scoped_refptr<TestNowSource> now_src, SchedulerClient* client, |