Index: cc/scheduler/scheduler.cc |
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc |
index b92b8a515b705c4a55ef5cb13a5e5479c03ec3d7..bc79776b83b4dbf1cdb1f56b833bb47e2bac6c17 100644 |
--- a/cc/scheduler/scheduler.cc |
+++ b/cc/scheduler/scheduler.cc |
@@ -80,6 +80,7 @@ Scheduler::Scheduler( |
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
base::PowerMonitor* power_monitor, |
scoped_ptr<BeginFrameSource> external_begin_frame_source, |
+ ProxyBeginFrameSource* proxy_begin_frame_source, |
SchedulerFrameSourcesConstructor* frame_sources_constructor) |
: frame_source_(), |
primary_frame_source_(NULL), |
@@ -96,6 +97,7 @@ Scheduler::Scheduler( |
state_machine_(scheduler_settings), |
inside_process_scheduled_actions_(false), |
inside_action_(SchedulerStateMachine::ACTION_NONE), |
+ proxy_begin_frame_source_(proxy_begin_frame_source), |
weak_factory_(this) { |
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), |
"Scheduler::Scheduler", |
@@ -104,6 +106,11 @@ Scheduler::Scheduler( |
DCHECK(client_); |
DCHECK(!state_machine_.BeginFrameNeeded()); |
+ if (settings_.forward_begin_frames_to_children) { |
+ DCHECK(proxy_begin_frame_source_); |
+ proxy_begin_frame_source_->set_delegate(this); |
+ } |
+ |
begin_retro_frame_closure_ = |
base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); |
begin_impl_frame_deadline_closure_ = base::Bind( |
@@ -139,6 +146,9 @@ Scheduler::~Scheduler() { |
TeardownPowerMonitoring(); |
if (frame_source_->NeedsBeginFrames()) |
frame_source_->SetNeedsBeginFrames(false); |
+ |
+ if (proxy_begin_frame_source_) |
+ proxy_begin_frame_source_->set_delegate(nullptr); |
} |
base::TimeTicks Scheduler::Now() const { |
@@ -413,7 +423,7 @@ bool Scheduler::OnBeginFrameMixInDelegate(const BeginFrameArgs& args) { |
(client_->BeginMainFrameToCommitDurationEstimate() + |
client_->CommitToActivateDurationEstimate() + |
client_->DrawDurationEstimate() + EstimatedParentDrawTime()); |
- client_->SendBeginFramesToChildren(adjusted_args_for_children); |
+ proxy_begin_frame_source_->BeginFrames(adjusted_args_for_children); |
} |
// We have just called SetNeedsBeginFrame(true) and the BeginFrameSource has |