diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 22:36:06 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 22:37:22 +0000 |
commit | 2decdd7866eea2d446a0e4873c070bcfc5f6fb8f (patch) | |
tree | bb8b35fc963e9e636fc5ebcdec3f996e7efd51a5 /cc/scheduler/scheduler.cc | |
parent | e838828785661869db162ef8316e271a48ec6b17 (diff) | |
download | chromium_src-2decdd7866eea2d446a0e4873c070bcfc5f6fb8f.zip chromium_src-2decdd7866eea2d446a0e4873c070bcfc5f6fb8f.tar.gz chromium_src-2decdd7866eea2d446a0e4873c070bcfc5f6fb8f.tar.bz2 |
Revert "Make SingleThreadProxy a SchedulerClient"
This reverts commit r288866 because of crashes.
Old patch: https://codereview.chromium.org/134623005/
NOTRY=true
TBR=danakj@chromium.org,boliu@chromium.org,piman@chromium.org,ben@chromium.org
BUG=402943,403400
Review URL: https://codereview.chromium.org/475483002
Cr-Commit-Position: refs/heads/master@{#289395}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/scheduler/scheduler.cc')
-rw-r--r-- | cc/scheduler/scheduler.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index a20bfd2b..1451237 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc @@ -79,11 +79,11 @@ Scheduler::Scheduler( SchedulerClient* client, const SchedulerSettings& scheduler_settings, int layer_tree_host_id, - const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) + const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner) : settings_(scheduler_settings), client_(client), layer_tree_host_id_(layer_tree_host_id), - task_runner_(task_runner), + impl_task_runner_(impl_task_runner), vsync_interval_(BeginFrameArgs::DefaultInterval()), last_set_needs_begin_frame_(false), begin_unthrottled_frame_posted_(false), @@ -128,7 +128,7 @@ Scheduler::~Scheduler() { void Scheduler::SetupSyntheticBeginFrames() { DCHECK(!synthetic_begin_frame_source_); synthetic_begin_frame_source_.reset( - new SyntheticBeginFrameSource(this, task_runner_.get())); + new SyntheticBeginFrameSource(this, impl_task_runner_.get())); } void Scheduler::CommitVSyncParameters(base::TimeTicks timebase, @@ -274,9 +274,6 @@ base::TimeTicks Scheduler::LastBeginImplFrameTime() { } void Scheduler::SetupNextBeginFrameIfNeeded() { - if (!task_runner_) - return; - bool needs_begin_frame = state_machine_.BeginFrameNeeded(); if (settings_.throttle_frame_production) { @@ -331,7 +328,7 @@ void Scheduler::SetupNextBeginFrameWhenVSyncThrottlingDisabled( } begin_unthrottled_frame_posted_ = true; - task_runner_->PostTask(FROM_HERE, begin_unthrottled_frame_closure_); + impl_task_runner_->PostTask(FROM_HERE, begin_unthrottled_frame_closure_); } // BeginUnthrottledFrame is used when we aren't throttling frame production. @@ -365,7 +362,7 @@ void Scheduler::SetupPollingMechanisms(bool needs_begin_frame) { base::TimeDelta delay = begin_impl_frame_args_.IsValid() ? begin_impl_frame_args_.interval : BeginFrameArgs::DefaultInterval(); - task_runner_->PostDelayedTask( + impl_task_runner_->PostDelayedTask( FROM_HERE, poll_for_draw_triggers_task_.callback(), delay); } } else { @@ -390,9 +387,9 @@ void Scheduler::SetupPollingMechanisms(bool needs_begin_frame) { // Since we'd rather get a BeginImplFrame by the normal mechanism, we // set the interval to twice the interval from the previous frame. advance_commit_state_task_.Reset(advance_commit_state_closure_); - task_runner_->PostDelayedTask(FROM_HERE, - advance_commit_state_task_.callback(), - begin_impl_frame_args_.interval * 2); + impl_task_runner_->PostDelayedTask(FROM_HERE, + advance_commit_state_task_.callback(), + begin_impl_frame_args_.interval * 2); } } else { advance_commit_state_task_.Cancel(); @@ -494,7 +491,7 @@ void Scheduler::PostBeginRetroFrameIfNeeded() { return; begin_retro_frame_posted_ = true; - task_runner_->PostTask(FROM_HERE, begin_retro_frame_closure_); + impl_task_runner_->PostTask(FROM_HERE, begin_retro_frame_closure_); } // BeginImplFrame starts a compositor frame that will wait up until a deadline @@ -502,8 +499,8 @@ void Scheduler::PostBeginRetroFrameIfNeeded() { // any asynchronous animation and scroll/pinch updates. void Scheduler::BeginImplFrame(const BeginFrameArgs& args) { TRACE_EVENT1("cc", "Scheduler::BeginImplFrame", "args", args.AsValue()); - DCHECK_EQ(state_machine_.begin_impl_frame_state(), - SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); + DCHECK(state_machine_.begin_impl_frame_state() == + SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); DCHECK(state_machine_.HasInitializedOutputSurface()); advance_commit_state_task_.Cancel(); @@ -570,7 +567,7 @@ void Scheduler::ScheduleBeginImplFrameDeadline(base::TimeTicks deadline) { base::TimeDelta delta = deadline - gfx::FrameTime::Now(); if (delta <= base::TimeDelta()) delta = base::TimeDelta(); - task_runner_->PostDelayedTask( + impl_task_runner_->PostDelayedTask( FROM_HERE, begin_impl_frame_deadline_task_.callback(), delta); } |