summaryrefslogtreecommitdiffstats
path: root/cc/trees/thread_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees/thread_proxy.cc')
-rw-r--r--cc/trees/thread_proxy.cc34
1 files changed, 6 insertions, 28 deletions
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 45835e8..ba621e2 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) {}