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

Unified Diff: cc/scheduler/scheduler.cc

Issue 2659123004: cc: Add scheduler support for invalidating content on impl thread. (Closed)
Patch Set: no DCHECK 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
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index 85cfddd08a48d270719078c7c0c89ccac05f3c0d..6e8172608c195a47d8c09f242d6ca5b56c90cab6 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"),
@@ -549,7 +554,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();
bool main_thread_missed_last_deadline =
state_machine_.main_thread_missed_last_deadline();
compositor_timing_history_->WillDraw();
@@ -563,7 +569,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();
@@ -624,6 +631,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;
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698