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

Unified Diff: cc/CCSingleThreadProxy.cpp

Issue 10914304: Add average commit time to perf tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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
Index: cc/CCSingleThreadProxy.cpp
diff --git a/cc/CCSingleThreadProxy.cpp b/cc/CCSingleThreadProxy.cpp
index f6d4f67f1a9cb60c058611abbc39c5f57cc775e2..c857cc54d84cb5e559965b03bf96c05c41ba8325 100644
--- a/cc/CCSingleThreadProxy.cpp
+++ b/cc/CCSingleThreadProxy.cpp
@@ -28,6 +28,8 @@ CCSingleThreadProxy::CCSingleThreadProxy(CCLayerTreeHost* layerTreeHost)
, m_contextLost(false)
, m_rendererInitialized(false)
, m_nextFrameIsNewlyCommittedFrame(false)
+ , m_totalCommitTime(0)
nduca 2012/09/15 00:36:09 here and elsewhere, add unit. m_totalCommitTimeInS
brianderson 2012/09/18 01:16:44 Done.
+ , m_totalCommitCount(0)
{
TRACE_EVENT0("cc", "CCSingleThreadProxy::CCSingleThreadProxy");
ASSERT(CCProxy::isMainThread());
@@ -150,8 +152,10 @@ bool CCSingleThreadProxy::recreateContext()
return initialized;
}
-void CCSingleThreadProxy::implSideRenderingStats(CCRenderingStats& stats)
+void CCSingleThreadProxy::renderingStats(CCRenderingStats& stats)
{
+ stats.totalCommitTimeInSeconds = m_totalCommitTime;
+ stats.totalCommitCount = m_totalCommitCount;
m_layerTreeHostImpl->renderingStats(stats);
}
@@ -183,6 +187,7 @@ void CCSingleThreadProxy::doCommit(CCTextureUpdateQueue& queue)
DebugScopedSetMainThreadBlocked mainThreadBlocked;
DebugScopedSetImplThread impl;
+ double startTime = WTF::monotonicallyIncreasingTime();
m_layerTreeHostImpl->beginCommit();
m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
@@ -205,6 +210,11 @@ void CCSingleThreadProxy::doCommit(CCTextureUpdateQueue& queue)
OwnPtr<CCScrollAndScaleSet> scrollInfo = m_layerTreeHostImpl->processScrollDeltas();
ASSERT(!scrollInfo->scrolls.size());
#endif
+
+ double endTime = WTF::monotonicallyIncreasingTime();
+ double commitTime = endTime - startTime;
+ m_totalCommitTime += commitTime;
+ m_totalCommitCount++;
}
m_layerTreeHost->commitComplete();
m_nextFrameIsNewlyCommittedFrame = true;

Powered by Google App Engine
This is Rietveld 408576698