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

Unified Diff: cc/scheduler/scheduler.cc

Issue 246753008: cc: Unify use of DidSwapBuffers() and did_request_swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 7 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 9345561f7dd379c69bba874bfa41667d7bf30c83..7dea30268b573c3826460194b918d977c294d831 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -195,6 +195,10 @@ void Scheduler::SetMaxSwapsPending(int max) {
void Scheduler::DidSwapBuffers() {
state_machine_.DidSwapBuffers();
+
+ // Swap should not occur inside readback operation.
+ DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_DRAW_AND_READBACK));
+
// There is no need to call ProcessScheduledActions here because
// swapping should not trigger any new actions.
if (!inside_process_scheduled_actions_) {
@@ -604,18 +608,8 @@ bool Scheduler::IsBeginMainFrameSent() const {
}
void Scheduler::DrawAndSwapIfPossible() {
- DrawSwapReadbackResult result =
- client_->ScheduledActionDrawAndSwapIfPossible();
- state_machine_.DidDrawIfPossibleCompleted(result.draw_result);
-}
-
-void Scheduler::DrawAndSwapForced() {
- client_->ScheduledActionDrawAndSwapForced();
-}
-
-void Scheduler::DrawAndReadback() {
- DrawSwapReadbackResult result = client_->ScheduledActionDrawAndReadback();
- DCHECK(!result.did_request_swap);
+ DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible();
+ state_machine_.DidDrawIfPossibleCompleted(result);
}
void Scheduler::ProcessScheduledActions() {
@@ -659,14 +653,14 @@ void Scheduler::ProcessScheduledActions() {
DrawAndSwapIfPossible();
break;
case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED:
- DrawAndSwapForced();
+ client_->ScheduledActionDrawAndSwapForced();
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.
break;
case SchedulerStateMachine::ACTION_DRAW_AND_READBACK:
- DrawAndReadback();
+ client_->ScheduledActionDrawAndReadback();
break;
case SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION:
client_->ScheduledActionBeginOutputSurfaceCreation();
« 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