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

Unified Diff: cc/scheduler_state_machine.cc

Issue 11571049: cc: Make the scheduler compositeAndReadback flow not race with WAITING_FOR_FIRST_DRAW (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: indents Created 8 years 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_state_machine.h ('k') | cc/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler_state_machine.cc
diff --git a/cc/scheduler_state_machine.cc b/cc/scheduler_state_machine.cc
index e840447695fb7342717fd7349c70945c4f0eccef..143efb3a84c72dbd0576a97e9628f064fea1ac8c 100644
--- a/cc/scheduler_state_machine.cc
+++ b/cc/scheduler_state_machine.cc
@@ -142,7 +142,7 @@ SchedulerStateMachine::Action SchedulerStateMachine::nextAction() const
case COMMIT_STATE_READY_TO_COMMIT:
return ACTION_COMMIT;
- case COMMIT_STATE_WAITING_FOR_FIRST_DRAW:
+ case COMMIT_STATE_WAITING_FOR_FIRST_DRAW: {
if (shouldDraw() || m_outputSurfaceState == OUTPUT_SURFACE_LOST)
return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POSSIBLE;
// COMMIT_STATE_WAITING_FOR_FIRST_DRAW wants to enforce a draw. If m_canDraw is false
@@ -152,6 +152,12 @@ SchedulerStateMachine::Action SchedulerStateMachine::nextAction() const
return ACTION_BEGIN_FRAME;
return ACTION_NONE;
}
+
+ case COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW:
+ if (m_needsForcedRedraw)
+ return ACTION_DRAW_FORCED;
+ return ACTION_NONE;
+ }
NOTREACHED();
return ACTION_NONE;
}
@@ -170,7 +176,10 @@ void SchedulerStateMachine::updateState(Action action)
return;
case ACTION_COMMIT:
- m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_DRAW;
+ if (m_expectImmediateBeginFrame)
+ m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW;
+ else
+ m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_DRAW;
m_needsRedraw = true;
if (m_drawIfPossibleFailed)
m_lastFrameNumberWhereDrawWasCalled = -1;
@@ -190,13 +199,12 @@ void SchedulerStateMachine::updateState(Action action)
m_drawIfPossibleFailed = false;
if (m_insideVSync)
m_lastFrameNumberWhereDrawWasCalled = m_currentFrameNumber;
- if (m_commitState == COMMIT_STATE_WAITING_FOR_FIRST_DRAW) {
- if (m_expectImmediateBeginFrame) {
- m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS;
- m_expectImmediateBeginFrame = false;
- } else
- m_commitState = COMMIT_STATE_IDLE;
- }
+ if (m_commitState == COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW) {
+ DCHECK(m_expectImmediateBeginFrame);
+ m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS;
+ m_expectImmediateBeginFrame = false;
+ } else if (m_commitState == COMMIT_STATE_WAITING_FOR_FIRST_DRAW)
+ m_commitState = COMMIT_STATE_IDLE;
if (m_textureState == LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD)
m_textureState = LAYER_TEXTURE_STATE_UNLOCKED;
return;
« no previous file with comments | « cc/scheduler_state_machine.h ('k') | cc/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698