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

Unified Diff: cc/CCScheduler.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/CCScheduler.h ('k') | cc/CCSchedulerStateMachine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCScheduler.cpp
diff --git a/cc/CCScheduler.cpp b/cc/CCScheduler.cpp
index 367c1f1f931b2437f708babb4d5c2423d034e566..ce7f62d8817cef393b0e6907725d2a773673906f 100644
--- a/cc/CCScheduler.cpp
+++ b/cc/CCScheduler.cpp
@@ -13,8 +13,7 @@ namespace WebCore {
CCScheduler::CCScheduler(CCSchedulerClient* client, PassOwnPtr<CCFrameRateController> frameRateController)
: m_client(client)
, m_frameRateController(frameRateController)
- , m_hasMoreResourceUpdates(false)
- , m_updateMoreResourcesPending(false)
+ , m_updateResourcesCompletePending(false)
{
ASSERT(m_client);
m_frameRateController->setClient(this);
@@ -81,8 +80,7 @@ void CCScheduler::setMainThreadNeedsLayerTextures()
void CCScheduler::beginFrameComplete(bool hasResourceUpdates)
{
TRACE_EVENT0("cc", "CCScheduler::beginFrameComplete");
- m_hasMoreResourceUpdates = hasResourceUpdates;
- m_stateMachine.beginFrameComplete();
+ m_stateMachine.beginFrameComplete(hasResourceUpdates);
processScheduledActions();
}
@@ -131,26 +129,21 @@ void CCScheduler::setTimebaseAndInterval(double timebase, double intervalSeconds
void CCScheduler::vsyncTick()
{
- if (m_updateMoreResourcesPending) {
- m_updateMoreResourcesPending = false;
- ASSERT(m_hasMoreResourceUpdates);
- m_stateMachine.beginUpdateMoreResourcesComplete(true);
- }
TRACE_EVENT0("cc", "CCScheduler::vsyncTick");
-
m_stateMachine.didEnterVSync();
processScheduledActions();
m_stateMachine.didLeaveVSync();
+
+ // Allow resource updates until next vsync tick.
+ if (m_updateResourcesCompletePending)
+ m_client->scheduledActionUpdateMoreResources(m_frameRateController->nextTickTimeIfActivated());
}
void CCScheduler::updateResourcesComplete()
{
TRACE_EVENT0("cc", "CCScheduler::updateResourcesComplete");
- if (m_updateMoreResourcesPending) {
- m_updateMoreResourcesPending = false;
- m_stateMachine.beginUpdateMoreResourcesComplete(false);
- }
- m_hasMoreResourceUpdates = false;
+ m_stateMachine.updateResourcesComplete();
+ m_updateResourcesCompletePending = false;
processScheduledActions();
}
@@ -176,12 +169,10 @@ void CCScheduler::processScheduledActions()
case CCSchedulerStateMachine::ACTION_BEGIN_FRAME:
m_client->scheduledActionBeginFrame();
break;
- case CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES:
- if (m_hasMoreResourceUpdates) {
- m_client->scheduledActionUpdateMoreResources(m_frameRateController->nextTickTimeIfActivated());
- m_updateMoreResourcesPending = true;
- } else
- m_stateMachine.beginUpdateMoreResourcesComplete(false);
+ case CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_RESOURCES:
+ ASSERT(!m_updateResourcesCompletePending);
+ m_client->scheduledActionUpdateMoreResources(m_frameRateController->nextTickTimeIfActivated());
+ m_updateResourcesCompletePending = true;
break;
case CCSchedulerStateMachine::ACTION_COMMIT:
m_client->scheduledActionCommit();
« no previous file with comments | « cc/CCScheduler.h ('k') | cc/CCSchedulerStateMachine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698