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

Unified Diff: cc/scheduler/scheduler.cc

Issue 2659123004: cc: Add scheduler support for invalidating content on impl thread. (Closed)
Patch Set: only inside deadline Created 3 years, 10 months 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 d8f9440227d4b858b6190b63fe3baab87aa513c9..391748dd70805cf21f9610b56c716dc8b5c7a1d1 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -66,6 +66,11 @@ void Scheduler::Stop() {
stopped_ = true;
}
+void Scheduler::SetNeedsImplSideInvalidation() {
+ state_machine_.SetNeedsImplSideInvalidation();
+ ProcessScheduledActions();
+}
+
base::TimeTicks Scheduler::Now() const {
base::TimeTicks now = base::TimeTicks::Now();
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.now"),
@@ -545,7 +550,8 @@ void Scheduler::OnBeginImplFrameDeadline() {
void Scheduler::DrawIfPossible() {
bool drawing_with_new_active_tree =
- state_machine_.active_tree_needs_first_draw();
+ state_machine_.active_tree_needs_first_draw() &&
+ !state_machine_.previous_pending_tree_was_impl_side();
brianderson 2017/02/22 19:31:20 Is there any way to avoid setting active_tree_need
Khushal 2017/02/22 20:19:29 I think we would want to set |active_tree_needs_fi
brianderson 2017/02/22 22:58:08 I think overwriting the active tree in this case m
Khushal 2017/02/22 23:20:24 "When a commit comes in while there's still a pend
brianderson 2017/02/22 23:42:33 I see. I completely misunderstood the merge mechan
bool main_thread_missed_last_deadline =
state_machine_.main_thread_missed_last_deadline();
compositor_timing_history_->WillDraw();
@@ -559,7 +565,8 @@ void Scheduler::DrawIfPossible() {
void Scheduler::DrawForced() {
bool drawing_with_new_active_tree =
- state_machine_.active_tree_needs_first_draw();
+ state_machine_.active_tree_needs_first_draw() &&
+ !state_machine_.previous_pending_tree_was_impl_side();
bool main_thread_missed_last_deadline =
state_machine_.main_thread_missed_last_deadline();
compositor_timing_history_->WillDraw();
@@ -620,6 +627,10 @@ void Scheduler::ProcessScheduledActions() {
client_->ScheduledActionActivateSyncTree();
compositor_timing_history_->DidActivate();
break;
+ case SchedulerStateMachine::ACTION_PERFORM_IMPL_SIDE_INVALIDATION:
+ state_machine_.WillPerformImplSideInvalidation();
+ client_->ScheduledActionPerformImplSideInvalidation();
+ break;
case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE:
DrawIfPossible();
break;

Powered by Google App Engine
This is Rietveld 408576698