| 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_TREES_PROXY_TIMING_HISTORY_H_ | 5 #ifndef CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
| 6 #define CC_TREES_PROXY_TIMING_HISTORY_H_ | 6 #define CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
| 7 | 7 |
| 8 #include "cc/base/rolling_time_delta_history.h" | 8 #include "cc/base/rolling_time_delta_history.h" |
| 9 #include "cc/debug/rendering_stats_instrumentation.h" | 9 |
| 10 namespace base { |
| 11 namespace trace_event { |
| 12 class TracedValue; |
| 13 } // namespace trace_event |
| 14 } // namespace base |
| 10 | 15 |
| 11 namespace cc { | 16 namespace cc { |
| 12 | 17 |
| 13 class ProxyTimingHistory { | 18 class RenderingStatsInstrumentation; |
| 19 |
| 20 class CC_EXPORT CompositorTimingHistory { |
| 14 public: | 21 public: |
| 15 explicit ProxyTimingHistory( | 22 explicit CompositorTimingHistory( |
| 16 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 23 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 17 ~ProxyTimingHistory(); | 24 virtual ~CompositorTimingHistory(); |
| 18 | 25 |
| 19 base::TimeDelta DrawDurationEstimate() const; | 26 void AsValueInto(base::trace_event::TracedValue* state) const; |
| 20 base::TimeDelta BeginMainFrameToCommitDurationEstimate() const; | |
| 21 base::TimeDelta CommitToActivateDurationEstimate() const; | |
| 22 | 27 |
| 23 void DidBeginMainFrame(); | 28 virtual base::TimeDelta DrawDurationEstimate() const; |
| 29 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() const; |
| 30 virtual base::TimeDelta CommitToActivateDurationEstimate() const; |
| 31 |
| 32 void WillBeginMainFrame(); |
| 24 void DidCommit(); | 33 void DidCommit(); |
| 25 void DidActivateSyncTree(); | 34 void DidActivateSyncTree(); |
| 26 void DidStartDrawing(); | 35 void DidStartDrawing(); |
| 27 void DidFinishDrawing(); | 36 void DidFinishDrawing(); |
| 28 | 37 |
| 29 protected: | 38 protected: |
| 30 void AddDrawDurationUMA(base::TimeDelta draw_duration, | 39 void AddDrawDurationUMA(base::TimeDelta draw_duration, |
| 31 base::TimeDelta draw_duration_estimate); | 40 base::TimeDelta draw_duration_estimate); |
| 32 | 41 |
| 33 RollingTimeDeltaHistory draw_duration_history_; | 42 RollingTimeDeltaHistory draw_duration_history_; |
| 34 RollingTimeDeltaHistory begin_main_frame_to_commit_duration_history_; | 43 RollingTimeDeltaHistory begin_main_frame_to_commit_duration_history_; |
| 35 RollingTimeDeltaHistory commit_to_activate_duration_history_; | 44 RollingTimeDeltaHistory commit_to_activate_duration_history_; |
| 36 | 45 |
| 37 base::TimeTicks begin_main_frame_sent_time_; | 46 base::TimeTicks begin_main_frame_sent_time_; |
| 38 base::TimeTicks commit_complete_time_; | 47 base::TimeTicks commit_complete_time_; |
| 39 base::TimeTicks start_draw_time_; | 48 base::TimeTicks start_draw_time_; |
| 40 | 49 |
| 41 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 50 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 51 |
| 52 private: |
| 53 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory); |
| 42 }; | 54 }; |
| 43 | 55 |
| 44 } // namespace cc | 56 } // namespace cc |
| 45 | 57 |
| 46 #endif // CC_TREES_PROXY_TIMING_HISTORY_H_ | 58 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ |
| OLD | NEW |