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

Unified Diff: cc/scheduler/scheduler.cc

Issue 1265023005: cc: Add SchedulerStateMachine::DidDraw and use for forced draws (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WillDidAction0
Patch Set: Sunny's comments 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/draw_result.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 70884d14125014c9418130225994cc9b70bc254e..085ed59cc787b98e0f645bfff3535e54122970d8 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -646,16 +646,19 @@ void Scheduler::OnBeginImplFrameDeadline() {
}
void Scheduler::DrawAndSwapIfPossible() {
+ state_machine_.WillDraw();
compositor_timing_history_->WillDraw();
DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible();
- state_machine_.DidDrawIfPossibleCompleted(result);
compositor_timing_history_->DidDraw();
+ state_machine_.DidDraw(result);
}
void Scheduler::DrawAndSwapForced() {
+ state_machine_.WillDraw();
compositor_timing_history_->WillDraw();
- client_->ScheduledActionDrawAndSwapForced();
+ DrawResult result = client_->ScheduledActionDrawAndSwapForced();
compositor_timing_history_->DidDraw();
+ state_machine_.DidDraw(result);
}
void Scheduler::SetDeferCommits(bool defer_commits) {
@@ -720,22 +723,16 @@ void Scheduler::ProcessScheduledActions() {
tracked_objects::ScopedTracker tracking_profile6(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"461509 Scheduler::ProcessScheduledActions6"));
- bool did_request_swap = true;
- state_machine_.WillDraw(did_request_swap);
DrawAndSwapIfPossible();
break;
}
- case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED: {
- bool did_request_swap = true;
- state_machine_.WillDraw(did_request_swap);
+ case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED:
DrawAndSwapForced();
break;
- }
case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: {
// No action is actually performed, but this allows the state machine to
- // advance out of its waiting to draw state without actually drawing.
- bool did_request_swap = false;
- state_machine_.WillDraw(did_request_swap);
+ // drain the pipeline without actually drawing.
+ state_machine_.AbortDrawAndSwap();
break;
}
case SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION:
« no previous file with comments | « cc/scheduler/draw_result.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698