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

Unified Diff: cc/single_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: Early out in methods, pass raw pointers, updated 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/single_thread_proxy.cc
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
index 3a64d828032bf6f77715f7e2608e561a7cf158c5..04935fa2e00e53c72f10f37b9d808af0454891ab 100644
--- a/cc/single_thread_proxy.cc
+++ b/cc/single_thread_proxy.cc
@@ -171,12 +171,6 @@ bool SingleThreadProxy::RecreateOutputSurface() {
return initialized;
}
-void SingleThreadProxy::GetRenderingStats(RenderingStats* stats) {
- stats->totalCommitTime = total_commit_time_;
- stats->totalCommitCount = total_commit_count_;
- layer_tree_host_impl_->renderingStats(stats);
-}
-
const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const {
DCHECK(renderer_initialized_);
// Note: this gets called during the commit by the "impl" thread.
@@ -195,7 +189,8 @@ void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) {
DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
DebugScopedSetImplThread impl(this);
- base::TimeTicks startTime = base::TimeTicks::HighResNow();
+ RenderingStatsRecorder* stats_recorder = layer_tree_host_->renderingStatsRecorder();
+ base::TimeTicks startTime = stats_recorder->StartRecording();
layer_tree_host_impl_->beginCommit();
layer_tree_host_->contentsTextureManager()->
@@ -222,9 +217,8 @@ void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) {
DCHECK(!scrollInfo->scrolls.size());
#endif
- base::TimeTicks endTime = base::TimeTicks::HighResNow();
- total_commit_time_ += endTime - startTime;
- total_commit_count_++;
+ base::TimeDelta duration = stats_recorder->EndRecording(startTime);
+ stats_recorder->AddCommit(duration);
}
layer_tree_host_->commitComplete();
next_frame_is_newly_committed_frame_ = true;

Powered by Google App Engine
This is Rietveld 408576698