| Index: cc/CCThreadProxy.cpp
|
| diff --git a/cc/CCThreadProxy.cpp b/cc/CCThreadProxy.cpp
|
| index 26e734b8565f09e63fa789d162a0a7a20bb3cbdd..ac7696c738efcb6cde64aad3cd0984db6ab31732 100644
|
| --- a/cc/CCThreadProxy.cpp
|
| +++ b/cc/CCThreadProxy.cpp
|
| @@ -62,6 +62,8 @@ CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost)
|
| , m_resetContentsTexturesPurgedAfterCommitOnImplThread(false)
|
| , m_nextFrameIsNewlyCommittedFrameOnImplThread(false)
|
| , m_renderVSyncEnabled(layerTreeHost->settings().renderVSyncEnabled)
|
| + , m_totalCommitTime(0)
|
| + , m_totalCommitCount(0)
|
| {
|
| TRACE_EVENT0("cc", "CCThreadProxy::CCThreadProxy");
|
| ASSERT(isMainThread());
|
| @@ -249,15 +251,18 @@ bool CCThreadProxy::recreateContext()
|
| return recreateSucceeded;
|
| }
|
|
|
| -void CCThreadProxy::implSideRenderingStats(CCRenderingStats& stats)
|
| +void CCThreadProxy::renderingStats(CCRenderingStats& stats)
|
| {
|
| ASSERT(isMainThread());
|
|
|
| DebugScopedSetMainThreadBlocked mainThreadBlocked;
|
| CCCompletionEvent completion;
|
| - CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::implSideRenderingStatsOnImplThread,
|
| + CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::renderingStatsOnImplThread,
|
| &completion,
|
| &stats));
|
| + stats.totalCommitTimeInSeconds = m_totalCommitTime;
|
| + stats.totalCommitCount = m_totalCommitCount;
|
| +
|
| completion.wait();
|
| }
|
|
|
| @@ -555,11 +560,18 @@ void CCThreadProxy::beginFrame()
|
| // coordinated by the CCScheduler.
|
| {
|
| TRACE_EVENT0("cc", "commit");
|
| +
|
| DebugScopedSetMainThreadBlocked mainThreadBlocked;
|
|
|
| + double startTime = WTF::monotonicallyIncreasingTime();
|
| CCCompletionEvent completion;
|
| CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::beginFrameCompleteOnImplThread, &completion, queue.release(), request->contentsTexturesWereDeleted));
|
| completion.wait();
|
| + double endTime = WTF::monotonicallyIncreasingTime();
|
| +
|
| + double commitTime = endTime - startTime;
|
| + m_totalCommitTime += commitTime;
|
| + m_totalCommitCount++;
|
| }
|
|
|
| m_layerTreeHost->commitComplete();
|
| @@ -914,7 +926,7 @@ void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, C
|
| completion->signal();
|
| }
|
|
|
| -void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* completion, CCRenderingStats* stats)
|
| +void CCThreadProxy::renderingStatsOnImplThread(CCCompletionEvent* completion, CCRenderingStats* stats)
|
| {
|
| ASSERT(isImplThread());
|
| m_layerTreeHostImpl->renderingStats(*stats);
|
|
|