| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |