| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 base::AutoLock scoped_lock(lock_); | 43 base::AutoLock scoped_lock(lock_); |
| 44 rendering_stats_.Add(other); | 44 rendering_stats_.Add(other); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void RenderingStatsInstrumentation::IncrementAnimationFrameCount() { | 47 void RenderingStatsInstrumentation::IncrementAnimationFrameCount() { |
| 48 if (!record_rendering_stats_) | 48 if (!record_rendering_stats_) |
| 49 return; | 49 return; |
| 50 | 50 |
| 51 base::AutoLock scoped_lock(lock_); | 51 base::AutoLock scoped_lock(lock_); |
| 52 rendering_stats_.numAnimationFrames++; | 52 rendering_stats_.animation_frame_count++; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void RenderingStatsInstrumentation::SetScreenFrameCount(int64 count) { | 55 void RenderingStatsInstrumentation::SetScreenFrameCount(int64 count) { |
| 56 if (!record_rendering_stats_) | 56 if (!record_rendering_stats_) |
| 57 return; | 57 return; |
| 58 | 58 |
| 59 base::AutoLock scoped_lock(lock_); | 59 base::AutoLock scoped_lock(lock_); |
| 60 rendering_stats_.numFramesSentToScreen = count; | 60 rendering_stats_.screen_frame_count = count; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void RenderingStatsInstrumentation::SetDroppedFrameCount(int64 count) { | 63 void RenderingStatsInstrumentation::SetDroppedFrameCount(int64 count) { |
| 64 if (!record_rendering_stats_) | 64 if (!record_rendering_stats_) |
| 65 return; | 65 return; |
| 66 | 66 |
| 67 base::AutoLock scoped_lock(lock_); | 67 base::AutoLock scoped_lock(lock_); |
| 68 rendering_stats_.droppedFrameCount = count; | 68 rendering_stats_.dropped_frame_count = count; |
| 69 } | 69 } |
| 70 | 70 |
| 71 void RenderingStatsInstrumentation::AddCommit(base::TimeDelta duration) { | 71 void RenderingStatsInstrumentation::AddCommit(base::TimeDelta duration) { |
| 72 if (!record_rendering_stats_) | 72 if (!record_rendering_stats_) |
| 73 return; | 73 return; |
| 74 | 74 |
| 75 base::AutoLock scoped_lock(lock_); | 75 base::AutoLock scoped_lock(lock_); |
| 76 rendering_stats_.totalCommitTime += duration; | 76 rendering_stats_.total_commit_time += duration; |
| 77 rendering_stats_.totalCommitCount++; | 77 rendering_stats_.total_commit_count++; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void RenderingStatsInstrumentation::AddPaint(base::TimeDelta duration, | 80 void RenderingStatsInstrumentation::AddPaint(base::TimeDelta duration, |
| 81 int64 pixels) { | 81 int64 pixels) { |
| 82 if (!record_rendering_stats_) | 82 if (!record_rendering_stats_) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 base::AutoLock scoped_lock(lock_); | 85 base::AutoLock scoped_lock(lock_); |
| 86 rendering_stats_.totalPaintTime += duration; | 86 rendering_stats_.total_paint_time += duration; |
| 87 rendering_stats_.totalPixelsPainted += pixels; | 87 rendering_stats_.total_pixels_painted += pixels; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void RenderingStatsInstrumentation::AddRaster(base::TimeDelta duration, | 90 void RenderingStatsInstrumentation::AddRaster(base::TimeDelta duration, |
| 91 int64 pixels, | 91 int64 pixels, |
| 92 bool is_in_pending_tree_now_bin) { | 92 bool is_in_pending_tree_now_bin) { |
| 93 if (!record_rendering_stats_) | 93 if (!record_rendering_stats_) |
| 94 return; | 94 return; |
| 95 | 95 |
| 96 base::AutoLock scoped_lock(lock_); | 96 base::AutoLock scoped_lock(lock_); |
| 97 rendering_stats_.totalRasterizeTime += duration; | 97 rendering_stats_.total_rasterize_time += duration; |
| 98 rendering_stats_.totalPixelsRasterized += pixels; | 98 rendering_stats_.total_pixels_rasterized += pixels; |
| 99 | 99 |
| 100 if (is_in_pending_tree_now_bin) | 100 if (is_in_pending_tree_now_bin) { |
| 101 rendering_stats_.totalRasterizeTimeForNowBinsOnPendingTree += duration; | 101 rendering_stats_.total_rasterize_time_for_now_bins_on_pending_tree += |
| 102 duration; |
| 103 } |
| 102 } | 104 } |
| 103 | 105 |
| 104 void RenderingStatsInstrumentation::IncrementImplThreadScrolls() { | 106 void RenderingStatsInstrumentation::IncrementImplThreadScrolls() { |
| 105 if (!record_rendering_stats_) | 107 if (!record_rendering_stats_) |
| 106 return; | 108 return; |
| 107 | 109 |
| 108 base::AutoLock scoped_lock(lock_); | 110 base::AutoLock scoped_lock(lock_); |
| 109 rendering_stats_.numImplThreadScrolls++; | 111 rendering_stats_.num_impl_thread_scrolls++; |
| 110 } | 112 } |
| 111 | 113 |
| 112 void RenderingStatsInstrumentation::IncrementMainThreadScrolls() { | 114 void RenderingStatsInstrumentation::IncrementMainThreadScrolls() { |
| 113 if (!record_rendering_stats_) | 115 if (!record_rendering_stats_) |
| 114 return; | 116 return; |
| 115 | 117 |
| 116 base::AutoLock scoped_lock(lock_); | 118 base::AutoLock scoped_lock(lock_); |
| 117 rendering_stats_.numMainThreadScrolls++; | 119 rendering_stats_.num_main_thread_scrolls++; |
| 118 } | 120 } |
| 119 | 121 |
| 120 void RenderingStatsInstrumentation::AddLayersDrawn(int64 amount) { | 122 void RenderingStatsInstrumentation::AddLayersDrawn(int64 amount) { |
| 121 if (!record_rendering_stats_) | 123 if (!record_rendering_stats_) |
| 122 return; | 124 return; |
| 123 | 125 |
| 124 base::AutoLock scoped_lock(lock_); | 126 base::AutoLock scoped_lock(lock_); |
| 125 rendering_stats_.numLayersDrawn += amount; | 127 rendering_stats_.num_layers_drawn += amount; |
| 126 } | 128 } |
| 127 | 129 |
| 128 void RenderingStatsInstrumentation::AddMissingTiles(int64 amount) { | 130 void RenderingStatsInstrumentation::AddMissingTiles(int64 amount) { |
| 129 if (!record_rendering_stats_) | 131 if (!record_rendering_stats_) |
| 130 return; | 132 return; |
| 131 | 133 |
| 132 base::AutoLock scoped_lock(lock_); | 134 base::AutoLock scoped_lock(lock_); |
| 133 rendering_stats_.numMissingTiles += amount; | 135 rendering_stats_.num_missing_tiles += amount; |
| 134 } | 136 } |
| 135 | 137 |
| 136 void RenderingStatsInstrumentation::AddDeferredImageDecode( | 138 void RenderingStatsInstrumentation::AddDeferredImageDecode( |
| 137 base::TimeDelta duration) { | 139 base::TimeDelta duration) { |
| 138 if (!record_rendering_stats_) | 140 if (!record_rendering_stats_) |
| 139 return; | 141 return; |
| 140 | 142 |
| 141 base::AutoLock scoped_lock(lock_); | 143 base::AutoLock scoped_lock(lock_); |
| 142 rendering_stats_.totalDeferredImageDecodeTime += duration; | 144 rendering_stats_.total_deferred_image_decode_time += duration; |
| 143 rendering_stats_.totalDeferredImageDecodeCount++; | 145 rendering_stats_.total_deferred_image_decode_count++; |
| 144 } | 146 } |
| 145 | 147 |
| 146 void RenderingStatsInstrumentation::AddImageGathering( | 148 void RenderingStatsInstrumentation::AddImageGathering( |
| 147 base::TimeDelta duration) { | 149 base::TimeDelta duration) { |
| 148 if (!record_rendering_stats_) | 150 if (!record_rendering_stats_) |
| 149 return; | 151 return; |
| 150 | 152 |
| 151 base::AutoLock scoped_lock(lock_); | 153 base::AutoLock scoped_lock(lock_); |
| 152 rendering_stats_.totalImageGatheringTime += duration; | 154 rendering_stats_.total_image_gathering_time += duration; |
| 153 rendering_stats_.totalImageGatheringCount++; | 155 rendering_stats_.total_image_gathering_count++; |
| 154 } | 156 } |
| 155 | 157 |
| 156 void RenderingStatsInstrumentation::IncrementDeferredImageCacheHitCount() { | 158 void RenderingStatsInstrumentation::IncrementDeferredImageCacheHitCount() { |
| 157 if (!record_rendering_stats_) | 159 if (!record_rendering_stats_) |
| 158 return; | 160 return; |
| 159 | 161 |
| 160 base::AutoLock scoped_lock(lock_); | 162 base::AutoLock scoped_lock(lock_); |
| 161 rendering_stats_.totalDeferredImageCacheHitCount++; | 163 rendering_stats_.total_deferred_image_cache_hit_count++; |
| 162 } | 164 } |
| 163 | 165 |
| 164 } // namespace cc | 166 } // namespace cc |
| OLD | NEW |