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

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: Rebase to 190965 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
« no previous file with comments | « cc/debug/rendering_stats_instrumentation.h ('k') | cc/layers/content_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_.animation_frame_count++; 44 rendering_stats_.animation_frame_count++;
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 149
158 void RenderingStatsInstrumentation::IncrementDeferredImageCacheHitCount() { 150 void RenderingStatsInstrumentation::IncrementDeferredImageCacheHitCount() {
159 if (!record_rendering_stats_) 151 if (!record_rendering_stats_)
160 return; 152 return;
161 153
162 base::AutoLock scoped_lock(lock_); 154 base::AutoLock scoped_lock(lock_);
163 rendering_stats_.total_deferred_image_cache_hit_count++; 155 rendering_stats_.total_deferred_image_cache_hit_count++;
164 } 156 }
165 157
166 } // namespace cc 158 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/rendering_stats_instrumentation.h ('k') | cc/layers/content_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698