OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ | 5 #ifndef CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
6 #define CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ | 6 #define CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/base/rolling_time_delta_history.h" | 9 #include "cc/base/rolling_time_delta_history.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 virtual base::TimeDelta BeginMainFrameQueueDurationNotCriticalEstimate() | 43 virtual base::TimeDelta BeginMainFrameQueueDurationNotCriticalEstimate() |
44 const; | 44 const; |
45 virtual base::TimeDelta BeginMainFrameStartToCommitDurationEstimate() const; | 45 virtual base::TimeDelta BeginMainFrameStartToCommitDurationEstimate() const; |
46 virtual base::TimeDelta CommitToReadyToActivateDurationEstimate() const; | 46 virtual base::TimeDelta CommitToReadyToActivateDurationEstimate() const; |
47 virtual base::TimeDelta PrepareTilesDurationEstimate() const; | 47 virtual base::TimeDelta PrepareTilesDurationEstimate() const; |
48 virtual base::TimeDelta ActivateDurationEstimate() const; | 48 virtual base::TimeDelta ActivateDurationEstimate() const; |
49 virtual base::TimeDelta DrawDurationEstimate() const; | 49 virtual base::TimeDelta DrawDurationEstimate() const; |
50 | 50 |
51 void SetRecordingEnabled(bool enabled); | 51 void SetRecordingEnabled(bool enabled); |
52 | 52 |
| 53 void WillBeginImplFrame(bool new_active_tree_is_likely); |
| 54 void WillFinishImplFrame(bool needs_redraw); |
| 55 void BeginImplFrameNotExpectedSoon(); |
53 void WillBeginMainFrame(bool on_critical_path); | 56 void WillBeginMainFrame(bool on_critical_path); |
54 void BeginMainFrameStarted(base::TimeTicks main_thread_start_time); | 57 void BeginMainFrameStarted(base::TimeTicks main_thread_start_time); |
55 void BeginMainFrameAborted(); | 58 void BeginMainFrameAborted(); |
56 void DidCommit(); | 59 void DidCommit(); |
57 void WillPrepareTiles(); | 60 void WillPrepareTiles(); |
58 void DidPrepareTiles(); | 61 void DidPrepareTiles(); |
59 void ReadyToActivate(); | 62 void ReadyToActivate(); |
60 void WillActivate(); | 63 void WillActivate(); |
61 void DidActivate(); | 64 void DidActivate(); |
62 void WillDraw(); | 65 void WillDraw(); |
63 void DidDraw(); | 66 void DidDraw(bool used_new_active_tree); |
64 void DidSwapBuffers(); | 67 void DidSwapBuffers(); |
65 void DidSwapBuffersComplete(); | 68 void DidSwapBuffersComplete(); |
66 void DidSwapBuffersReset(); | 69 void DidSwapBuffersReset(); |
67 | 70 |
68 protected: | 71 protected: |
| 72 void DidBeginMainFrame(); |
| 73 |
| 74 void SetBeginMainFrameNeededContinuously(bool active); |
| 75 void SetBeginMainFrameCommittingContinuously(bool active); |
| 76 void SetCompositorDrawingContinuously(bool active); |
| 77 |
69 static scoped_ptr<UMAReporter> CreateUMAReporter(UMACategory category); | 78 static scoped_ptr<UMAReporter> CreateUMAReporter(UMACategory category); |
70 virtual base::TimeTicks Now() const; | 79 virtual base::TimeTicks Now() const; |
71 | 80 |
72 bool enabled_; | 81 bool enabled_; |
73 | 82 |
| 83 // Used to calculate frame rates of Main and Impl threads. |
| 84 bool did_send_begin_main_frame_; |
| 85 bool begin_main_frame_needed_continuously_; |
| 86 bool begin_main_frame_committing_continuously_; |
| 87 bool compositor_drawing_continuously_; |
| 88 base::TimeTicks begin_main_frame_end_time_prev_; |
| 89 base::TimeTicks new_active_tree_draw_end_time_prev_; |
| 90 base::TimeTicks draw_end_time_prev_; |
| 91 |
74 RollingTimeDeltaHistory begin_main_frame_sent_to_commit_duration_history_; | 92 RollingTimeDeltaHistory begin_main_frame_sent_to_commit_duration_history_; |
75 RollingTimeDeltaHistory begin_main_frame_queue_duration_critical_history_; | 93 RollingTimeDeltaHistory begin_main_frame_queue_duration_critical_history_; |
76 RollingTimeDeltaHistory begin_main_frame_queue_duration_not_critical_history_; | 94 RollingTimeDeltaHistory begin_main_frame_queue_duration_not_critical_history_; |
77 RollingTimeDeltaHistory begin_main_frame_start_to_commit_duration_history_; | 95 RollingTimeDeltaHistory begin_main_frame_start_to_commit_duration_history_; |
78 RollingTimeDeltaHistory commit_to_ready_to_activate_duration_history_; | 96 RollingTimeDeltaHistory commit_to_ready_to_activate_duration_history_; |
79 RollingTimeDeltaHistory prepare_tiles_duration_history_; | 97 RollingTimeDeltaHistory prepare_tiles_duration_history_; |
80 RollingTimeDeltaHistory activate_duration_history_; | 98 RollingTimeDeltaHistory activate_duration_history_; |
81 RollingTimeDeltaHistory draw_duration_history_; | 99 RollingTimeDeltaHistory draw_duration_history_; |
82 | 100 |
83 bool begin_main_frame_on_critical_path_; | 101 bool begin_main_frame_on_critical_path_; |
84 base::TimeTicks begin_main_frame_sent_time_; | 102 base::TimeTicks begin_main_frame_sent_time_; |
85 base::TimeTicks begin_main_frame_start_time_; | 103 base::TimeTicks begin_main_frame_start_time_; |
86 base::TimeTicks commit_time_; | 104 base::TimeTicks begin_main_frame_end_time_; |
87 base::TimeTicks start_prepare_tiles_time_; | 105 base::TimeTicks prepare_tiles_start_time_; |
88 base::TimeTicks start_activate_time_; | 106 base::TimeTicks activate_start_time_; |
89 base::TimeTicks start_draw_time_; | 107 base::TimeTicks draw_start_time_; |
90 base::TimeTicks swap_start_time_; | 108 base::TimeTicks swap_start_time_; |
91 | 109 |
92 scoped_ptr<UMAReporter> uma_reporter_; | 110 scoped_ptr<UMAReporter> uma_reporter_; |
93 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 111 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
94 | 112 |
95 private: | 113 private: |
96 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory); | 114 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory); |
97 }; | 115 }; |
98 | 116 |
99 } // namespace cc | 117 } // namespace cc |
100 | 118 |
101 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ | 119 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
OLD | NEW |