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

Side by Side Diff: cc/debug/rendering_stats_instrumentation.cc

Issue 12426024: cc: Switch RenderingStats collection in Layer::Update() to RenderingStatsInstrumentation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/debug/rendering_stats_instrumentation.h" 5 #include "cc/debug/rendering_stats_instrumentation.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 // static 9 // static
10 scoped_ptr<RenderingStatsInstrumentation> 10 scoped_ptr<RenderingStatsInstrumentation>
(...skipping 18 matching lines...) Expand all
29 return base::TimeTicks(); 29 return base::TimeTicks();
30 } 30 }
31 31
32 base::TimeDelta RenderingStatsInstrumentation::EndRecording( 32 base::TimeDelta RenderingStatsInstrumentation::EndRecording(
33 base::TimeTicks start_time) const { 33 base::TimeTicks start_time) const {
34 if (!start_time.is_null()) 34 if (!start_time.is_null())
35 return base::TimeTicks::HighResNow() - start_time; 35 return base::TimeTicks::HighResNow() - start_time;
36 return base::TimeDelta(); 36 return base::TimeDelta();
37 } 37 }
38 38
39 void RenderingStatsInstrumentation::AddStats(const RenderingStats& other) {
40 if (!record_rendering_stats_)
41 return;
42
43 base::AutoLock scoped_lock(lock_);
44 rendering_stats_.Add(other);
45 }
46
47 void RenderingStatsInstrumentation::IncrementAnimationFrameCount() { 39 void RenderingStatsInstrumentation::IncrementAnimationFrameCount() {
48 if (!record_rendering_stats_) 40 if (!record_rendering_stats_)
49 return; 41 return;
50 42
51 base::AutoLock scoped_lock(lock_); 43 base::AutoLock scoped_lock(lock_);
52 rendering_stats_.numAnimationFrames++; 44 rendering_stats_.numAnimationFrames++;
53 } 45 }
54 46
55 void RenderingStatsInstrumentation::SetScreenFrameCount(int64 count) { 47 void RenderingStatsInstrumentation::SetScreenFrameCount(int64 count) {
56 if (!record_rendering_stats_) 48 if (!record_rendering_stats_)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 147
156 void RenderingStatsInstrumentation::IncrementDeferredImageCacheHitCount() { 148 void RenderingStatsInstrumentation::IncrementDeferredImageCacheHitCount() {
157 if (!record_rendering_stats_) 149 if (!record_rendering_stats_)
158 return; 150 return;
159 151
160 base::AutoLock scoped_lock(lock_); 152 base::AutoLock scoped_lock(lock_);
161 rendering_stats_.totalDeferredImageCacheHitCount++; 153 rendering_stats_.totalDeferredImageCacheHitCount++;
162 } 154 }
163 155
164 } // namespace cc 156 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698