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

Unified Diff: cc/thread_proxy.cc

Issue 12519006: cc:: Add RenderingStatsInstrumentation to manage collection of RenderingStats (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Early out in methods, pass raw pointers, updated tests Created 7 years, 9 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/thread_proxy.cc
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc
index 139eddcc6c8eea4c38eec9b5f18809ddaffb3353..63a46afc027ed5aa197fcb991692eca234cab1f6 100644
--- a/cc/thread_proxy.cc
+++ b/cc/thread_proxy.cc
@@ -58,7 +58,6 @@ ThreadProxy::ThreadProxy(LayerTreeHost* layerTreeHost, scoped_ptr<Thread> implTh
, m_nextFrameIsNewlyCommittedFrameOnImplThread(false)
, m_renderVSyncEnabled(layerTreeHost->settings().renderVSyncEnabled)
, m_insideDraw(false)
- , m_totalCommitCount(0)
, m_deferCommits(false)
, m_renewTreePriorityOnImplThreadPending(false)
{
@@ -255,20 +254,6 @@ bool ThreadProxy::RecreateOutputSurface()
return recreateSucceeded;
}
-void ThreadProxy::GetRenderingStats(RenderingStats* stats)
-{
- DCHECK(IsMainThread());
-
- DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
- CompletionEvent completion;
- Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::renderingStatsOnImplThread,
- m_implThreadWeakPtr, &completion, stats));
- stats->totalCommitTime = m_totalCommitTime;
- stats->totalCommitCount = m_totalCommitCount;
-
- completion.wait();
-}
-
const RendererCapabilities& ThreadProxy::GetRendererCapabilities() const
{
DCHECK(m_rendererInitialized);
@@ -691,14 +676,15 @@ void ThreadProxy::beginFrame(scoped_ptr<BeginFrameAndCommitState> beginFrameStat
DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
- base::TimeTicks startTime = base::TimeTicks::HighResNow();
+ RenderingStatsRecorder* statsRecorder = m_layerTreeHost->renderingStatsRecorder();
+ base::TimeTicks startTime = statsRecorder->StartRecording();
+
CompletionEvent completion;
Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::beginFrameCompleteOnImplThread, m_implThreadWeakPtr, &completion, queue.release(), offscreenContextProvider));
completion.wait();
- base::TimeTicks endTime = base::TimeTicks::HighResNow();
- m_totalCommitTime += endTime - startTime;
- m_totalCommitCount++;
+ base::TimeDelta duration = statsRecorder->EndRecording(startTime);
+ statsRecorder->AddCommit(duration);
}
m_layerTreeHost->commitComplete();
@@ -1088,13 +1074,6 @@ void ThreadProxy::recreateOutputSurfaceOnImplThread(CompletionEvent* completion,
completion->signal();
}
-void ThreadProxy::renderingStatsOnImplThread(CompletionEvent* completion, RenderingStats* stats)
-{
- DCHECK(IsImplThread());
- m_layerTreeHostImpl->renderingStats(stats);
- completion->signal();
-}
-
ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState()
: memoryAllocationLimitBytes(0)
{
« cc/rendering_stats_recorder.cc ('K') | « cc/thread_proxy.h ('k') | cc/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698