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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 1428133003: cc: Add SetNeedsOneBeginImplFrame to the Scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: snanimate: . Created 5 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/scheduler_state_machine.h ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index aeda6dd6ede35a17456201bf6ea55234be1ba611..7e914715662fd8c9698b98fbaf0fe43ae621a3b6 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -39,6 +39,7 @@ SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings)
needs_animate_(false),
needs_prepare_tiles_(false),
needs_begin_main_frame_(false),
+ needs_one_begin_impl_frame_(false),
visible_(false),
resourceless_draw_(false),
can_draw_(false),
@@ -224,6 +225,7 @@ void SchedulerStateMachine::AsValueInto(
state->SetBoolean("needs_animate_", needs_animate_);
state->SetBoolean("needs_prepare_tiles", needs_prepare_tiles_);
state->SetBoolean("needs_begin_main_frame", needs_begin_main_frame_);
+ state->SetBoolean("needs_one_begin_impl_frame", needs_one_begin_impl_frame_);
state->SetBoolean("visible", visible_);
state->SetBoolean("can_draw", can_draw_);
state->SetBoolean("resourceless_draw", resourceless_draw_);
@@ -743,7 +745,7 @@ bool SchedulerStateMachine::BeginFrameRequiredForAction() const {
if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW)
return true;
- return needs_animate_ || needs_redraw_ ||
+ return needs_animate_ || needs_redraw_ || needs_one_begin_impl_frame_ ||
(needs_begin_main_frame_ && !defer_commits_);
}
@@ -799,6 +801,7 @@ void SchedulerStateMachine::OnBeginImplFrame() {
last_commit_had_no_updates_ = false;
did_request_swap_in_last_frame_ = false;
+ needs_one_begin_impl_frame_ = false;
// Clear funnels for any actions we perform during the frame.
animate_funnel_ = false;
@@ -939,7 +942,8 @@ void SchedulerStateMachine::SetNeedsAnimate() {
}
bool SchedulerStateMachine::OnlyImplSideUpdatesExpected() const {
- bool has_impl_updates = needs_redraw_ || needs_animate_;
+ bool has_impl_updates =
+ needs_redraw_ || needs_animate_ || needs_one_begin_impl_frame_;
bool main_updates_expected =
needs_begin_main_frame_ ||
begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE ||
@@ -1024,6 +1028,10 @@ void SchedulerStateMachine::SetNeedsBeginMainFrame() {
needs_begin_main_frame_ = true;
}
+void SchedulerStateMachine::SetNeedsOneBeginImplFrame() {
+ needs_one_begin_impl_frame_ = true;
+}
+
void SchedulerStateMachine::NotifyReadyToCommit() {
DCHECK(begin_main_frame_state_ == BEGIN_MAIN_FRAME_STATE_STARTED)
<< AsValue()->ToString();
« no previous file with comments | « cc/scheduler/scheduler_state_machine.h ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698