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

Unified Diff: cc/CCThreadProxy.cpp

Issue 10914304: Add average commit time to perf tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix bug with texture_upload_benchmark.py 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') | content/renderer/gpu/gpu_benchmarking_extension.cc » ('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 579870f5ee86b534b8f611dd7c0e53af9c7d9204..f2d831fb19e2593e9d1fecfcb3befaa45cfcf6e9 100644
--- a/cc/CCThreadProxy.cpp
+++ b/cc/CCThreadProxy.cpp
@@ -54,6 +54,7 @@ CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost)
, m_resetContentsTexturesPurgedAfterCommitOnImplThread(false)
, m_nextFrameIsNewlyCommittedFrameOnImplThread(false)
, m_renderVSyncEnabled(layerTreeHost->settings().renderVSyncEnabled)
+ , m_totalCommitCount(0)
{
TRACE_EVENT0("cc", "CCThreadProxy::CCThreadProxy");
ASSERT(isMainThread());
@@ -241,15 +242,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));
+ stats->totalCommitTimeInSeconds = m_totalCommitTime.InSecondsF();
+ stats->totalCommitCount = m_totalCommitCount;
+
completion.wait();
}
@@ -559,11 +563,17 @@ void CCThreadProxy::beginFrame()
// coordinated by the CCScheduler.
{
TRACE_EVENT0("cc", "commit");
+
DebugScopedSetMainThreadBlocked mainThreadBlocked;
+ base::TimeTicks startTime = base::TimeTicks::HighResNow();
CCCompletionEvent completion;
CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::beginFrameCompleteOnImplThread, &completion, queue.release()));
completion.wait();
+ base::TimeTicks endTime = base::TimeTicks::HighResNow();
+
+ m_totalCommitTime += endTime - startTime;
+ m_totalCommitCount++;
}
m_layerTreeHost->commitComplete();
@@ -922,10 +932,10 @@ 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);
+ m_layerTreeHostImpl->renderingStats(stats);
completion->signal();
}
« no previous file with comments | « cc/CCThreadProxy.h ('k') | content/renderer/gpu/gpu_benchmarking_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698