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 #ifndef CC_DEBUG_RENDERING_STATS_INSTRUMENTATION_H_ | 5 #ifndef CC_DEBUG_RENDERING_STATS_INSTRUMENTATION_H_ |
6 #define CC_DEBUG_RENDERING_STATS_INSTRUMENTATION_H_ | 6 #define CC_DEBUG_RENDERING_STATS_INSTRUMENTATION_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "cc/debug/rendering_stats.h" | 10 #include "cc/debug/rendering_stats.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // it's value during runtime. | 50 // it's value during runtime. |
51 bool record_rendering_stats() const { return record_rendering_stats_; } | 51 bool record_rendering_stats() const { return record_rendering_stats_; } |
52 void set_record_rendering_stats(bool record_rendering_stats) { | 52 void set_record_rendering_stats(bool record_rendering_stats) { |
53 if (record_rendering_stats_ != record_rendering_stats) | 53 if (record_rendering_stats_ != record_rendering_stats) |
54 record_rendering_stats_ = record_rendering_stats; | 54 record_rendering_stats_ = record_rendering_stats; |
55 } | 55 } |
56 | 56 |
57 base::TimeTicks StartRecording() const; | 57 base::TimeTicks StartRecording() const; |
58 base::TimeDelta EndRecording(base::TimeTicks start_time) const; | 58 base::TimeDelta EndRecording(base::TimeTicks start_time) const; |
59 | 59 |
60 void IncrementAnimationFrameCount(); | 60 void IncrementFrameCount(int64 count, bool main_thread); |
61 void IncrementScreenFrameCount(int64 count, bool main_thread); | |
62 void IncrementDroppedFrameCount(int64 count); | |
63 | |
64 void AddCommit(base::TimeDelta duration); | |
65 void AddPaint(base::TimeDelta duration, int64 pixels); | 61 void AddPaint(base::TimeDelta duration, int64 pixels); |
66 void AddRecord(base::TimeDelta duration, | 62 void AddRecord(base::TimeDelta duration, int64 pixels); |
67 base::TimeDelta best_duration, | 63 void AddRaster(base::TimeDelta duration, int64 pixels); |
68 int64 pixels); | |
69 void AddRaster(base::TimeDelta total_duraction, | |
70 base::TimeDelta best_duration, | |
71 int64 pixels, | |
72 bool is_in_pending_tree_now_bin); | |
73 | |
74 void IncrementImplThreadScrolls(); | |
75 void IncrementMainThreadScrolls(); | |
76 | |
77 void AddLayersDrawn(int64 amount); | |
78 void AddMissingTiles(int64 amount); | |
79 | |
80 void AddDeferredImageDecode(base::TimeDelta duration); | |
81 void AddImageGathering(base::TimeDelta duration); | |
82 | |
83 void IncrementDeferredImageCacheHitCount(); | |
84 | |
85 void AddAnalysisResult(base::TimeDelta duration, bool is_solid_color); | |
86 | 64 |
87 protected: | 65 protected: |
88 RenderingStatsInstrumentation(); | 66 RenderingStatsInstrumentation(); |
89 | 67 |
90 private: | 68 private: |
91 MainThreadRenderingStats main_stats_; | 69 MainThreadRenderingStats main_stats_; |
92 MainThreadRenderingStats main_stats_accu_; | 70 MainThreadRenderingStats main_stats_accu_; |
93 ImplThreadRenderingStats impl_stats_; | 71 ImplThreadRenderingStats impl_stats_; |
94 ImplThreadRenderingStats impl_stats_accu_; | 72 ImplThreadRenderingStats impl_stats_accu_; |
95 | 73 |
96 bool record_rendering_stats_; | 74 bool record_rendering_stats_; |
97 | 75 |
98 base::Lock lock_; | 76 base::Lock lock_; |
99 | 77 |
100 DISALLOW_COPY_AND_ASSIGN(RenderingStatsInstrumentation); | 78 DISALLOW_COPY_AND_ASSIGN(RenderingStatsInstrumentation); |
101 }; | 79 }; |
102 | 80 |
103 } // namespace cc | 81 } // namespace cc |
104 | 82 |
105 #endif // CC_DEBUG_RENDERING_STATS_INSTRUMENTATION_H_ | 83 #endif // CC_DEBUG_RENDERING_STATS_INSTRUMENTATION_H_ |
OLD | NEW |