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
3 // found in the LICENSE file.
5 #ifndef CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_
6 #define CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_
8 #include "cc/base/rolling_time_delta_history.h"
11 namespace trace_event
{
13 } // namespace trace_event
18 class RenderingStatsInstrumentation
;
20 class CC_EXPORT CompositorTimingHistory
{
22 explicit CompositorTimingHistory(
23 RenderingStatsInstrumentation
* rendering_stats_instrumentation
);
24 virtual ~CompositorTimingHistory();
26 void AsValueInto(base::trace_event::TracedValue
* state
) const;
28 virtual base::TimeDelta
DrawDurationEstimate() const;
29 virtual base::TimeDelta
BeginMainFrameToCommitDurationEstimate() const;
30 virtual base::TimeDelta
CommitToActivateDurationEstimate() const;
32 void WillBeginMainFrame();
34 void DidActivateSyncTree();
35 void DidStartDrawing();
36 void DidFinishDrawing();
39 void AddDrawDurationUMA(base::TimeDelta draw_duration
,
40 base::TimeDelta draw_duration_estimate
);
42 RollingTimeDeltaHistory draw_duration_history_
;
43 RollingTimeDeltaHistory begin_main_frame_to_commit_duration_history_
;
44 RollingTimeDeltaHistory commit_to_activate_duration_history_
;
46 base::TimeTicks begin_main_frame_sent_time_
;
47 base::TimeTicks commit_complete_time_
;
48 base::TimeTicks start_draw_time_
;
50 RenderingStatsInstrumentation
* rendering_stats_instrumentation_
;
53 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory
);
58 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_