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

Unified Diff: cc/CCScheduler.cpp

Issue 10907075: Roll cc snapshot up to 127605 (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 1840b4a1dbaeb0bee461c87058d9ec3c697a4485..457cf05607a8f495cdea451a60664d3239e5795d 100644
--- a/cc/CCScheduler.cpp
+++ b/cc/CCScheduler.cpp
@@ -37,6 +37,16 @@ void CCScheduler::setVisible(bool visible)
processScheduledActions();
}
+void CCScheduler::setCanDraw(bool canDraw)
+{
+ m_stateMachine.setCanDraw(canDraw);
+
+ // Defer processScheduleActions so we don't recurse and commit/draw
+ // multiple frames. We can call processScheduledActions directly
+ // once it is no longer re-entrant.
+ m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded());
+}
+
void CCScheduler::setNeedsCommit()
{
m_stateMachine.setNeedsCommit();
@@ -86,6 +96,11 @@ void CCScheduler::setMaxFramesPending(int maxFramesPending)
m_frameRateController->setMaxFramesPending(maxFramesPending);
}
+void CCScheduler::setSwapBuffersCompleteSupported(bool supported)
+{
+ m_frameRateController->setSwapBuffersCompleteSupported(supported);
+}
+
void CCScheduler::didSwapBuffersComplete()
{
TRACE_EVENT0("cc", "CCScheduler::didSwapBuffersComplete");
@@ -125,16 +140,10 @@ void CCScheduler::vsyncTick()
m_stateMachine.didLeaveVSync();
}
-CCSchedulerStateMachine::Action CCScheduler::nextAction()
-{
- m_stateMachine.setCanDraw(m_client->canDraw());
- return m_stateMachine.nextAction();
-}
-
void CCScheduler::processScheduledActions()
{
// Early out so we don't spam TRACE_EVENTS with useless processScheduledActions.
- if (nextAction() == CCSchedulerStateMachine::ACTION_NONE) {
+ if (m_stateMachine.nextAction() == CCSchedulerStateMachine::ACTION_NONE) {
m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded());
return;
}
@@ -143,7 +152,7 @@ void CCScheduler::processScheduledActions()
// setNeedsCommit. Proceeed with caution.
CCSchedulerStateMachine::Action action;
do {
- action = nextAction();
+ action = m_stateMachine.nextAction();
m_stateMachine.updateState(action);
TRACE_EVENT1("cc", "CCScheduler::processScheduledActions()", "action", action);
« 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