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

Unified Diff: cc/CCSchedulerStateMachine.cpp

Issue 10913261: cc: Remove awareness of incremental updates from state machine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/CCSchedulerStateMachine.h ('k') | cc/CCSchedulerStateMachineTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCSchedulerStateMachine.cpp
diff --git a/cc/CCSchedulerStateMachine.cpp b/cc/CCSchedulerStateMachine.cpp
index 2d8845024596faf3d17b425e6a7f091ca896b3bc..798521ae2fa11c601d2e6102187b379696011cdf 100644
--- a/cc/CCSchedulerStateMachine.cpp
+++ b/cc/CCSchedulerStateMachine.cpp
@@ -22,7 +22,7 @@ CCSchedulerStateMachine::CCSchedulerStateMachine()
, m_needsCommit(false)
, m_needsForcedCommit(false)
, m_mainThreadNeedsLayerTextures(false)
- , m_updateMoreResourcesPending(false)
+ , m_updateResourcesCompletePending(false)
, m_insideVSync(false)
, m_visible(false)
, m_canBeginFrame(false)
@@ -47,7 +47,7 @@ std::string CCSchedulerStateMachine::toString()
base::StringAppendF(&str, "m_needsCommit = %d; ", m_needsCommit);
base::StringAppendF(&str, "m_needsForcedCommit = %d; ", m_needsForcedCommit);
base::StringAppendF(&str, "m_mainThreadNeedsLayerTextures = %d; ", m_mainThreadNeedsLayerTextures);
- base::StringAppendF(&str, "m_updateMoreResourcesPending = %d; ", m_updateMoreResourcesPending);
+ base::StringAppendF(&str, "m_updateResourcesCompletePending = %d; ", m_updateResourcesCompletePending);
base::StringAppendF(&str, "m_insideVSync = %d; ", m_insideVSync);
base::StringAppendF(&str, "m_visible = %d; ", m_visible);
base::StringAppendF(&str, "m_canBeginFrame = %d; ", m_canBeginFrame);
@@ -143,8 +143,8 @@ CCSchedulerStateMachine::Action CCSchedulerStateMachine::nextAction() const
case COMMIT_STATE_UPDATING_RESOURCES:
if (shouldDraw())
return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POSSIBLE;
- if (!m_updateMoreResourcesPending)
- return ACTION_BEGIN_UPDATE_MORE_RESOURCES;
+ if (!m_updateResourcesCompletePending)
+ return ACTION_BEGIN_UPDATE_RESOURCES;
return ACTION_NONE;
case COMMIT_STATE_READY_TO_COMMIT:
@@ -177,9 +177,9 @@ void CCSchedulerStateMachine::updateState(Action action)
m_needsForcedCommit = false;
return;
- case ACTION_BEGIN_UPDATE_MORE_RESOURCES:
+ case ACTION_BEGIN_UPDATE_RESOURCES:
ASSERT(m_commitState == COMMIT_STATE_UPDATING_RESOURCES);
- m_updateMoreResourcesPending = true;
+ m_updateResourcesCompletePending = true;
return;
case ACTION_COMMIT:
@@ -234,7 +234,7 @@ void CCSchedulerStateMachine::setMainThreadNeedsLayerTextures()
bool CCSchedulerStateMachine::vsyncCallbackNeeded() const
{
// To prevent live-lock, we must always tick when updating resources.
- if (m_updateMoreResourcesPending || m_commitState == COMMIT_STATE_UPDATING_RESOURCES)
+ if (m_updateResourcesCompletePending || m_commitState == COMMIT_STATE_UPDATING_RESOURCES)
return true;
// If we can't draw, don't tick until we are notified that we can draw again.
@@ -300,10 +300,13 @@ void CCSchedulerStateMachine::setNeedsForcedCommit()
m_needsForcedCommit = true;
}
-void CCSchedulerStateMachine::beginFrameComplete()
+void CCSchedulerStateMachine::beginFrameComplete(bool hasResourceUpdates)
{
ASSERT(m_commitState == COMMIT_STATE_FRAME_IN_PROGRESS);
- m_commitState = COMMIT_STATE_UPDATING_RESOURCES;
+ if (hasResourceUpdates)
+ m_commitState = COMMIT_STATE_UPDATING_RESOURCES;
+ else
+ m_commitState = COMMIT_STATE_READY_TO_COMMIT;
}
void CCSchedulerStateMachine::beginFrameAborted()
@@ -313,13 +316,12 @@ void CCSchedulerStateMachine::beginFrameAborted()
setNeedsCommit();
}
-void CCSchedulerStateMachine::beginUpdateMoreResourcesComplete(bool morePending)
+void CCSchedulerStateMachine::updateResourcesComplete()
{
ASSERT(m_commitState == COMMIT_STATE_UPDATING_RESOURCES);
- ASSERT(m_updateMoreResourcesPending);
- m_updateMoreResourcesPending = false;
- if (!morePending)
- m_commitState = COMMIT_STATE_READY_TO_COMMIT;
+ ASSERT(m_updateResourcesCompletePending);
+ m_updateResourcesCompletePending = false;
+ m_commitState = COMMIT_STATE_READY_TO_COMMIT;
}
void CCSchedulerStateMachine::didLoseContext()
« no previous file with comments | « cc/CCSchedulerStateMachine.h ('k') | cc/CCSchedulerStateMachineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698