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

Unified Diff: cc/scheduler_state_machine.cc

Issue 11450019: Finish the rename from cc::GraphicsContext to cc::OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
Index: cc/scheduler_state_machine.cc
diff --git a/cc/scheduler_state_machine.cc b/cc/scheduler_state_machine.cc
index 7b2ce7b5be7111d48594b507264dbf92a3d84441..e840447695fb7342717fd7349c70945c4f0eccef 100644
--- a/cc/scheduler_state_machine.cc
+++ b/cc/scheduler_state_machine.cc
@@ -28,7 +28,7 @@ SchedulerStateMachine::SchedulerStateMachine()
, m_canDraw(false)
, m_drawIfPossibleFailed(false)
, m_textureState(LAYER_TEXTURE_STATE_UNLOCKED)
- , m_contextState(CONTEXT_ACTIVE)
+ , m_outputSurfaceState(OUTPUT_SURFACE_ACTIVE)
{
}
@@ -53,7 +53,7 @@ std::string SchedulerStateMachine::toString()
base::StringAppendF(&str, "m_canDraw = %d; ", m_canDraw);
base::StringAppendF(&str, "m_drawIfPossibleFailed = %d; ", m_drawIfPossibleFailed);
base::StringAppendF(&str, "m_textureState = %d; ", m_textureState);
- base::StringAppendF(&str, "m_contextState = %d; ", m_contextState);
+ base::StringAppendF(&str, "m_outputSurfaceState = %d; ", m_outputSurfaceState);
return str;
}
@@ -93,7 +93,7 @@ bool SchedulerStateMachine::shouldDraw() const
return false;
if (hasDrawnThisFrame())
return false;
- if (m_contextState != CONTEXT_ACTIVE)
+ if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE)
return false;
return true;
}
@@ -120,13 +120,13 @@ SchedulerStateMachine::Action SchedulerStateMachine::nextAction() const
return ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD;
switch (m_commitState) {
case COMMIT_STATE_IDLE:
- if (m_contextState != CONTEXT_ACTIVE && m_needsForcedRedraw)
+ if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE && m_needsForcedRedraw)
return ACTION_DRAW_FORCED;
- if (m_contextState != CONTEXT_ACTIVE && m_needsForcedCommit)
+ if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE && m_needsForcedCommit)
return ACTION_BEGIN_FRAME;
- if (m_contextState == CONTEXT_LOST)
- return ACTION_BEGIN_CONTEXT_RECREATION;
- if (m_contextState == CONTEXT_RECREATING)
+ if (m_outputSurfaceState == OUTPUT_SURFACE_LOST)
+ return ACTION_BEGIN_OUTPUT_SURFACE_RECREATION;
+ if (m_outputSurfaceState == OUTPUT_SURFACE_RECREATING)
return ACTION_NONE;
if (shouldDraw())
return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POSSIBLE;
@@ -143,7 +143,7 @@ SchedulerStateMachine::Action SchedulerStateMachine::nextAction() const
return ACTION_COMMIT;
case COMMIT_STATE_WAITING_FOR_FIRST_DRAW:
- if (shouldDraw() || m_contextState == CONTEXT_LOST)
+ 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
// or textures are not available, proceed to the next step (similar as in COMMIT_STATE_IDLE).
@@ -201,10 +201,10 @@ void SchedulerStateMachine::updateState(Action action)
m_textureState = LAYER_TEXTURE_STATE_UNLOCKED;
return;
- case ACTION_BEGIN_CONTEXT_RECREATION:
+ case ACTION_BEGIN_OUTPUT_SURFACE_RECREATION:
DCHECK(m_commitState == COMMIT_STATE_IDLE);
- DCHECK(m_contextState == CONTEXT_LOST);
- m_contextState = CONTEXT_RECREATING;
+ DCHECK(m_outputSurfaceState == OUTPUT_SURFACE_LOST);
+ m_outputSurfaceState = OUTPUT_SURFACE_RECREATING;
return;
case ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD:
@@ -232,7 +232,7 @@ bool SchedulerStateMachine::vsyncCallbackNeeded() const
if (m_needsForcedRedraw)
return true;
- return m_needsRedraw && m_visible && m_contextState == CONTEXT_ACTIVE;
+ return m_needsRedraw && m_visible && m_outputSurfaceState == OUTPUT_SURFACE_ACTIVE;
}
void SchedulerStateMachine::didEnterVSync()
@@ -307,17 +307,17 @@ void SchedulerStateMachine::beginFrameAborted()
}
}
-void SchedulerStateMachine::didLoseContext()
+void SchedulerStateMachine::didLoseOutputSurface()
{
- if (m_contextState == CONTEXT_LOST || m_contextState == CONTEXT_RECREATING)
+ if (m_outputSurfaceState == OUTPUT_SURFACE_LOST || m_outputSurfaceState == OUTPUT_SURFACE_RECREATING)
return;
- m_contextState = CONTEXT_LOST;
+ m_outputSurfaceState = OUTPUT_SURFACE_LOST;
}
-void SchedulerStateMachine::didRecreateContext()
+void SchedulerStateMachine::didRecreateOutputSurface()
{
- DCHECK(m_contextState == CONTEXT_RECREATING);
- m_contextState = CONTEXT_ACTIVE;
+ DCHECK(m_outputSurfaceState == OUTPUT_SURFACE_RECREATING);
+ m_outputSurfaceState = OUTPUT_SURFACE_ACTIVE;
setNeedsCommit();
}

Powered by Google App Engine
This is Rietveld 408576698