| Index: cc/thread_proxy.cc
|
| diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc
|
| index 688d1e3c5c4b6790a31161db25c2dbdd5da53a79..656c8bdfe4402200ac0936639e789f25d009899f 100644
|
| --- a/cc/thread_proxy.cc
|
| +++ b/cc/thread_proxy.cc
|
| @@ -14,6 +14,7 @@
|
| #include "cc/graphics_context.h"
|
| #include "cc/input_handler.h"
|
| #include "cc/layer_tree_host.h"
|
| +#include "cc/rendering_stats_subscriber.h"
|
| #include "cc/scheduler.h"
|
| #include "cc/scoped_thread_proxy.h"
|
| #include <public/WebSharedGraphicsContext3D.h>
|
| @@ -258,6 +259,34 @@ void ThreadProxy::renderingStats(RenderingStats* stats)
|
| completion.wait();
|
| }
|
|
|
| +void ThreadProxy::startRecordingRenderingStats()
|
| +{
|
| + DCHECK(isMainThread());
|
| +
|
| + DebugScopedSetMainThreadBlocked mainThreadBlocked;
|
| + CompletionEvent completion;
|
| + Proxy::implThread()->postTask(base::Bind(&ThreadProxy::startRecordingRenderingStatsOnImplThread,
|
| + base::Unretained(this), &completion));
|
| +
|
| + // This subscriber will collect total commit time and total commit count.
|
| + m_renderingStatsSubscriber = RenderingStatsSubscriber::create();
|
| + completion.wait();
|
| +}
|
| +
|
| +void ThreadProxy::stopRecordingRenderingStats(RenderingStats* stats)
|
| +{
|
| + DCHECK(isMainThread());
|
| +
|
| + // TODO(vollick) populate stats based on subscriber here.
|
| + m_renderingStatsSubscriber.reset();
|
| +
|
| + DebugScopedSetMainThreadBlocked mainThreadBlocked;
|
| + CompletionEvent completion;
|
| + Proxy::implThread()->postTask(base::Bind(&ThreadProxy::stopRecordingRenderingStatsOnImplThread,
|
| + base::Unretained(this), &completion, stats));
|
| + completion.wait();
|
| +}
|
| +
|
| const RendererCapabilities& ThreadProxy::rendererCapabilities() const
|
| {
|
| DCHECK(m_rendererInitialized);
|
| @@ -981,6 +1010,20 @@ void ThreadProxy::renderingStatsOnImplThread(CompletionEvent* completion, Render
|
| completion->signal();
|
| }
|
|
|
| +void ThreadProxy::startRecordingRenderingStatsOnImplThread(CompletionEvent* completion)
|
| +{
|
| + DCHECK(isImplThread());
|
| + m_layerTreeHostImpl->startRecordingRenderingStats();
|
| + completion->signal();
|
| +}
|
| +
|
| +void ThreadProxy::stopRecordingRenderingStatsOnImplThread(CompletionEvent* completion, RenderingStats* stats)
|
| +{
|
| + DCHECK(isImplThread());
|
| + m_layerTreeHostImpl->stopRecordingRenderingStats(stats);
|
| + completion->signal();
|
| +}
|
| +
|
| ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState()
|
| {
|
| }
|
|
|