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

Unified Diff: cc/trees/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: Updated all 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
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 45835e82b0be90a377f9098cc604b1b46d486caf..ba621e2576d6c8a5a02f0b79c8f4b9680196d4a2 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/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().render_vsync_enabled),
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_;
@@ -742,7 +725,10 @@ void ThreadProxy::BeginFrame(
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
- base::TimeTicks start_time = base::TimeTicks::HighResNow();
+ RenderingStatsInstrumentation* stats_instrumentation =
+ layer_tree_host_->rendering_stats_instrumentation();
+ base::TimeTicks start_time = stats_instrumentation->StartRecording();
+
CompletionEvent completion;
Proxy::ImplThread()->PostTask(
base::Bind(&ThreadProxy::BeginFrameCompleteOnImplThread,
@@ -752,9 +738,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();
@@ -1184,13 +1169,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) {}
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698