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

Unified Diff: cc/scheduler/frame_rate_controller.cc

Issue 67023003: cc: Don't double-tick unthrottled FrameRateController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pull out change to disable deadline scheduling. Created 7 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
« no previous file with comments | « cc/scheduler/frame_rate_controller.h ('k') | cc/scheduler/frame_rate_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/frame_rate_controller.cc
diff --git a/cc/scheduler/frame_rate_controller.cc b/cc/scheduler/frame_rate_controller.cc
index 2729748859bf030b1c5cd88576542ef1b6d7f782..243ef6b62918a1f4b753e24cf70e93d4ac3050dc 100644
--- a/cc/scheduler/frame_rate_controller.cc
+++ b/cc/scheduler/frame_rate_controller.cc
@@ -44,6 +44,7 @@ FrameRateController::FrameRateController(scoped_refptr<TimeSource> timer)
time_source_(timer),
active_(false),
is_time_source_throttling_(true),
+ manual_tick_pending_(false),
task_runner_(NULL),
weak_factory_(this) {
time_source_client_adapter_ =
@@ -59,6 +60,7 @@ FrameRateController::FrameRateController(
interval_(BeginFrameArgs::DefaultInterval()),
active_(false),
is_time_source_throttling_(false),
+ manual_tick_pending_(false),
task_runner_(task_runner),
weak_factory_(this) {}
@@ -81,10 +83,12 @@ BeginFrameArgs FrameRateController::SetActive(bool active) {
missed_tick_time, deadline + deadline_adjustment_, interval_);
}
} else {
- if (active)
+ if (active) {
PostManualTick();
- else
+ } else {
weak_factory_.InvalidateWeakPtrs();
+ manual_tick_pending_ = false;
+ }
}
return BeginFrameArgs();
@@ -129,7 +133,8 @@ void FrameRateController::OnTimerTick() {
}
void FrameRateController::PostManualTick() {
- if (active_) {
+ if (active_ && !manual_tick_pending_) {
+ manual_tick_pending_ = true;
task_runner_->PostTask(FROM_HERE,
base::Bind(&FrameRateController::ManualTick,
weak_factory_.GetWeakPtr()));
@@ -137,6 +142,7 @@ void FrameRateController::PostManualTick() {
}
void FrameRateController::ManualTick() {
+ manual_tick_pending_ = false;
OnTimerTick();
}
« no previous file with comments | « cc/scheduler/frame_rate_controller.h ('k') | cc/scheduler/frame_rate_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698