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

Unified Diff: cc/scheduler/scheduler.cc

Issue 723713003: cc: Add SetChildrenNeedBeginFrames() & SendBeginFramesToChildren() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More tests are added 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 side-by-side diff with in-line comments
Download patch
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index 5c515b2512e210919d95dcd82593359861777cdf..d88bfa42dee656486b830d92a686cd302e685d1c 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -398,6 +398,21 @@ void Scheduler::SetupPollingMechanisms(bool needs_begin_frame) {
bool Scheduler::OnBeginFrameMixInDelegate(const BeginFrameArgs& args) {
TRACE_EVENT1("cc", "Scheduler::BeginFrame", "args", args.AsValue());
+ // Deliver BeginFrames to children.
+ if (settings_.forward_begin_frames_to_children &&
+ state_machine_.children_need_begin_frames()) {
+ BeginFrameArgs adjusted_args_for_children(args);
+ // Adjust a deadline for child schedulers.
+ // TODO(simonhong): Once we have commitless update, we can get rid of
+ // BeginMainFrameToCommitDurationEstimate() +
+ // CommitToActivateDurationEstimate().
+ adjusted_args_for_children.deadline -=
+ (client_->BeginMainFrameToCommitDurationEstimate() +
+ client_->CommitToActivateDurationEstimate() +
+ client_->DrawDurationEstimate() + EstimatedParentDrawTime());
+ client_->SendBeginFramesToChildren(adjusted_args_for_children);
+ }
+
// We have just called SetNeedsBeginFrame(true) and the BeginFrameSource has
// sent us the last BeginFrame we have missed. As we might not be able to
// actually make rendering for this call, handle it like a "retro frame".
@@ -433,6 +448,13 @@ bool Scheduler::OnBeginFrameMixInDelegate(const BeginFrameArgs& args) {
return true;
}
+void Scheduler::SetChildrenNeedBeginFrames(bool children_need_begin_frames) {
+ DCHECK(settings_.forward_begin_frames_to_children);
+
+ state_machine_.SetChildrenNeedBeginFrames(children_need_begin_frames);
+ ProcessScheduledActions();
brianderson 2014/11/19 19:03:34 This should not trigger any new actions in the Bro
simonhong 2014/11/20 16:24:09 Done.
+}
+
// BeginRetroFrame is called for BeginFrames that we've deferred because
// the scheduler was in the middle of processing a previous BeginFrame.
void Scheduler::BeginRetroFrame() {

Powered by Google App Engine
This is Rietveld 408576698