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

Unified Diff: cc/thread_proxy.cc

Issue 11198005: NOT READY FOR REVIEW - switch to a subscriber model for rendering stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing file. Created 8 years, 1 month 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/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
{
}
« no previous file with comments | « cc/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698