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

Unified Diff: cc/CCThreadProxy.cpp

Issue 10956006: Convert CC scheduler logic to use base::TimeTicks/Delta instead of doubles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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/CCThreadProxy.h ('k') | cc/CCThreadedTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCThreadProxy.cpp
diff --git a/cc/CCThreadProxy.cpp b/cc/CCThreadProxy.cpp
index c36a561e66e0f069bafa6eccc10effebc1a69c40..57ea3d3d5a27de3d5f3a06ffecddf58cb9f473ef 100644
--- a/cc/CCThreadProxy.cpp
+++ b/cc/CCThreadProxy.cpp
@@ -319,7 +319,9 @@ void CCThreadProxy::onVSyncParametersChanged(double monotonicTimebase, double in
{
ASSERT(isImplThread());
TRACE_EVENT2("cc", "CCThreadProxy::onVSyncParametersChanged", "monotonicTimebase", monotonicTimebase, "intervalInSeconds", intervalInSeconds);
- m_schedulerOnImplThread->setTimebaseAndInterval(monotonicTimebase, intervalInSeconds);
+ base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimebase * base::Time::kMicrosecondsPerSecond);
+ base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSeconds * base::Time::kMicrosecondsPerSecond);
+ m_schedulerOnImplThread->setTimebaseAndInterval(timebase, interval);
}
void CCThreadProxy::onCanDrawStateChanged(bool canDraw)
@@ -624,12 +626,12 @@ void CCThreadProxy::beginFrameAbortedOnImplThread()
m_schedulerOnImplThread->beginFrameAborted();
}
-void CCThreadProxy::scheduledActionUpdateMoreResources(double monotonicTimeLimit)
+void CCThreadProxy::scheduledActionUpdateMoreResources(base::TimeTicks timeLimit)
{
TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources");
ASSERT(m_currentTextureUpdateControllerOnImplThread);
- m_currentTextureUpdateControllerOnImplThread->performMoreUpdates(
- monotonicTimeLimit);
+ double monotonicTimeLimit = timeLimit.ToInternalValue() / static_cast<double>(base::Time::kMicrosecondsPerSecond);
+ m_currentTextureUpdateControllerOnImplThread->performMoreUpdates(monotonicTimeLimit);
}
void CCThreadProxy::scheduledActionCommit()
@@ -854,7 +856,7 @@ void CCThreadProxy::initializeImplOnImplThread(CCCompletionEvent* completion, Pa
TRACE_EVENT0("cc", "CCThreadProxy::initializeImplOnImplThread");
ASSERT(isImplThread());
m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this);
- const double displayRefreshInterval = 1.0 / 60.0;
+ const base::TimeDelta displayRefreshInterval = base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / 60);
OwnPtr<CCFrameRateController> frameRateController;
if (m_renderVSyncEnabled)
frameRateController = adoptPtr(new CCFrameRateController(CCDelayBasedTimeSource::create(displayRefreshInterval, CCProxy::implThread())));
« no previous file with comments | « cc/CCThreadProxy.h ('k') | cc/CCThreadedTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698