diff options
author | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 21:25:29 +0000 |
---|---|---|
committer | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 21:25:29 +0000 |
commit | 7e7bfb887402975231447ccbdb8a636aeba644d9 (patch) | |
tree | 935cc112922cdd1eab0ec68d21a0fefe72028190 /cc/scheduler/frame_rate_controller.cc | |
parent | 11b9a3b34801022a851e230088ecb4a9070982c7 (diff) | |
download | chromium_src-7e7bfb887402975231447ccbdb8a636aeba644d9.zip chromium_src-7e7bfb887402975231447ccbdb8a636aeba644d9.tar.gz chromium_src-7e7bfb887402975231447ccbdb8a636aeba644d9.tar.bz2 |
cc: Trigger BeginFrames that were just missed retroactively
If a SwapAck, SetNeedsBeginFrame, or a Swap occurs *just* after
a BeginFrame is received and skipped by the compositor, this
patch tries the BeginFrame retroactively if it's possible
we might still be able to produce a frame in time.
Also fixes the include guards of begin_frame_args.h.
BUG=243384,243500
Review URL: https://chromiumcodereview.appspot.com/17315011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/scheduler/frame_rate_controller.cc')
-rw-r--r-- | cc/scheduler/frame_rate_controller.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cc/scheduler/frame_rate_controller.cc b/cc/scheduler/frame_rate_controller.cc index 811892d..c2294ea 100644 --- a/cc/scheduler/frame_rate_controller.cc +++ b/cc/scheduler/frame_rate_controller.cc @@ -65,10 +65,11 @@ FrameRateController::~FrameRateController() { time_source_->SetActive(false); } -void FrameRateController::SetActive(bool active) { +BeginFrameArgs FrameRateController::SetActive(bool active) { if (active_ == active) - return; + return BeginFrameArgs(); TRACE_EVENT1("cc", "FrameRateController::SetActive", "active", active); + bool just_activated = active && !active_; active_ = active; if (is_time_source_throttling_) { @@ -79,6 +80,14 @@ void FrameRateController::SetActive(bool active) { else weak_factory_.InvalidateWeakPtrs(); } + + if (just_activated) { + // TODO(brianderson): Use an adaptive parent compositor deadline. + base::TimeTicks frame_time = NextTickTime() - interval_; + base::TimeTicks deadline = NextTickTime(); + return BeginFrameArgs::Create(frame_time, deadline, interval_); + } + return BeginFrameArgs(); } void FrameRateController::SetMaxSwapsPending(int max_swaps_pending) { |