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

Unified Diff: cc/CCScheduler.cpp

Issue 10911262: cc: Scheduler will never process a commit until it receives a vsync tick. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/CCSchedulerTest.cpp » ('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 457cf05607a8f495cdea451a60664d3239e5795d..367c1f1f931b2437f708babb4d5c2423d034e566 100644
--- a/cc/CCScheduler.cpp
+++ b/cc/CCScheduler.cpp
@@ -13,6 +13,7 @@ namespace WebCore {
CCScheduler::CCScheduler(CCSchedulerClient* client, PassOwnPtr<CCFrameRateController> frameRateController)
: m_client(client)
, m_frameRateController(frameRateController)
+ , m_hasMoreResourceUpdates(false)
, m_updateMoreResourcesPending(false)
{
ASSERT(m_client);
@@ -77,9 +78,10 @@ void CCScheduler::setMainThreadNeedsLayerTextures()
processScheduledActions();
}
-void CCScheduler::beginFrameComplete()
+void CCScheduler::beginFrameComplete(bool hasResourceUpdates)
{
TRACE_EVENT0("cc", "CCScheduler::beginFrameComplete");
+ m_hasMoreResourceUpdates = hasResourceUpdates;
m_stateMachine.beginFrameComplete();
processScheduledActions();
}
@@ -131,7 +133,8 @@ void CCScheduler::vsyncTick()
{
if (m_updateMoreResourcesPending) {
m_updateMoreResourcesPending = false;
- m_stateMachine.beginUpdateMoreResourcesComplete(m_client->hasMoreResourceUpdates());
+ ASSERT(m_hasMoreResourceUpdates);
+ m_stateMachine.beginUpdateMoreResourcesComplete(true);
}
TRACE_EVENT0("cc", "CCScheduler::vsyncTick");
@@ -140,6 +143,17 @@ void CCScheduler::vsyncTick()
m_stateMachine.didLeaveVSync();
}
+void CCScheduler::updateResourcesComplete()
+{
+ TRACE_EVENT0("cc", "CCScheduler::updateResourcesComplete");
+ if (m_updateMoreResourcesPending) {
+ m_updateMoreResourcesPending = false;
+ m_stateMachine.beginUpdateMoreResourcesComplete(false);
+ }
+ m_hasMoreResourceUpdates = false;
+ processScheduledActions();
+}
+
void CCScheduler::processScheduledActions()
{
// Early out so we don't spam TRACE_EVENTS with useless processScheduledActions.
@@ -163,7 +177,7 @@ void CCScheduler::processScheduledActions()
m_client->scheduledActionBeginFrame();
break;
case CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES:
- if (m_client->hasMoreResourceUpdates()) {
+ if (m_hasMoreResourceUpdates) {
m_client->scheduledActionUpdateMoreResources(m_frameRateController->nextTickTimeIfActivated());
m_updateMoreResourcesPending = true;
} else
« no previous file with comments | « cc/CCScheduler.h ('k') | cc/CCSchedulerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698