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

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: Fixed 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 41d6d90e8dbc3bbbac7ee03a084431df85d8912e..da2555c38459b2ea9574759cf8069ff5bcf47a88 100644
--- a/cc/thread_proxy.cc
+++ b/cc/thread_proxy.cc
@@ -60,7 +60,6 @@ ThreadProxy::ThreadProxy(LayerTreeHost* layer_tree_host,
next_frame_is_newly_committed_frame_on_impl_thread_(false),
render_vsync_enabled_(layer_tree_host->settings().renderVSyncEnabled),
inside_draw_(false),
- total_commit_count_(0),
defer_commits_(false),
renew_tree_priority_on_impl_thread_pending_(false) {
TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy");
@@ -278,22 +277,6 @@ bool ThreadProxy::RecreateOutputSurface() {
return recreate_succeeded;
}
-void ThreadProxy::CollectRenderingStats(RenderingStats* stats) {
- DCHECK(IsMainThread());
-
- DebugScopedSetMainThreadBlocked main_thread_blocked(this);
- CompletionEvent completion;
- Proxy::ImplThread()->postTask(
- base::Bind(&ThreadProxy::RenderingStatsOnImplThread,
- impl_thread_weak_ptr_,
- &completion,
- stats));
- stats->totalCommitTime = total_commit_time_;
- stats->totalCommitCount = total_commit_count_;
-
- completion.wait();
-}
-
const RendererCapabilities& ThreadProxy::GetRendererCapabilities() const {
DCHECK(renderer_initialized_);
return renderer_capabilities_main_thread_copy_;
@@ -743,9 +726,12 @@ void ThreadProxy::BeginFrame(
{
TRACE_EVENT0("cc", "commit");
- DebugScopedSetMainThreadBlocked main_thread_blocked(this);
+ DebugScopedSetMainThreadBlocked main_thread_blocked(this);
+
+ RenderingStatsInstrumentation* stats_instrumentation =
+ layer_tree_host_->rendering_stats_instrumentation();
+ base::TimeTicks start_time = stats_instrumentation->StartRecording();
- base::TimeTicks start_time = base::TimeTicks::HighResNow();
CompletionEvent completion;
Proxy::ImplThread()->postTask(
base::Bind(&ThreadProxy::BeginFrameCompleteOnImplThread,
@@ -755,9 +741,8 @@ void ThreadProxy::BeginFrame(
offscreen_context_provider));
completion.wait();
- base::TimeTicks end_time = base::TimeTicks::HighResNow();
- total_commit_time_ += end_time - start_time;
- total_commit_count_++;
+ base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
+ stats_instrumentation->AddCommit(duration);
}
layer_tree_host_->CommitComplete();
@@ -1178,13 +1163,6 @@ void ThreadProxy::RecreateOutputSurfaceOnImplThread(
completion->signal();
}
-void ThreadProxy::RenderingStatsOnImplThread(CompletionEvent* completion,
- RenderingStats* stats) {
- DCHECK(IsImplThread());
- layer_tree_host_impl_->CollectRenderingStats(stats);
- completion->signal();
-}
-
ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState()
: memory_allocation_limit_bytes(0) {}
« cc/layer_tree_host.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