Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: cc/scheduler/compositor_timing_history.h

Issue 1192663005: cc: Measure compositor timing with finer granularity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@modeTimingHistory3
Patch Set: rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "cc/base/rolling_time_delta_history.h" 8 #include "cc/base/rolling_time_delta_history.h"
9 9
10 namespace base { 10 namespace base {
11 namespace trace_event { 11 namespace trace_event {
12 class TracedValue; 12 class TracedValue;
13 } // namespace trace_event 13 } // namespace trace_event
14 } // namespace base 14 } // namespace base
15 15
16 namespace cc { 16 namespace cc {
17 17
18 class RenderingStatsInstrumentation; 18 class RenderingStatsInstrumentation;
19 19
20 class CC_EXPORT CompositorTimingHistory { 20 class CC_EXPORT CompositorTimingHistory {
21 public: 21 public:
22 explicit CompositorTimingHistory( 22 explicit CompositorTimingHistory(
23 RenderingStatsInstrumentation* rendering_stats_instrumentation); 23 RenderingStatsInstrumentation* rendering_stats_instrumentation);
24 virtual ~CompositorTimingHistory(); 24 virtual ~CompositorTimingHistory();
25 25
26 void AsValueInto(base::trace_event::TracedValue* state) const; 26 void AsValueInto(base::trace_event::TracedValue* state) const;
27 27
28 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() const;
29 virtual base::TimeDelta CommitToReadyToActivateDurationEstimate() const;
30 virtual base::TimeDelta PrepareTilesDurationEstimate() const;
31 virtual base::TimeDelta ActivateDurationEstimate() const;
28 virtual base::TimeDelta DrawDurationEstimate() const; 32 virtual base::TimeDelta DrawDurationEstimate() const;
29 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() const; 33
30 virtual base::TimeDelta CommitToActivateDurationEstimate() const; 34 void SetRecordingEnabled(bool enabled);
31 35
32 void WillBeginMainFrame(); 36 void WillBeginMainFrame();
37 void BeginMainFrameAborted();
33 void DidCommit(); 38 void DidCommit();
34 void DidActivateSyncTree(); 39 void WillPrepareTiles();
35 void DidStartDrawing(); 40 void DidPrepareTiles();
36 void DidFinishDrawing(); 41 void ReadyToActivate();
42 void WillActivate();
43 void DidActivate();
44 void WillDraw();
45 void DidDraw();
37 46
38 protected: 47 protected:
48 virtual base::TimeTicks Now() const;
49
39 void AddDrawDurationUMA(base::TimeDelta draw_duration, 50 void AddDrawDurationUMA(base::TimeDelta draw_duration,
40 base::TimeDelta draw_duration_estimate); 51 base::TimeDelta draw_duration_estimate);
41 52
53 bool enabled_;
54
55 RollingTimeDeltaHistory begin_main_frame_to_commit_duration_history_;
mithro-old 2015/06/30 07:55:49 Can we record the delta between when the commit wa
56 RollingTimeDeltaHistory commit_to_ready_to_activate_duration_history_;
57 RollingTimeDeltaHistory prepare_tiles_duration_history_;
mithro-old 2015/06/30 07:55:49 It would be interesting in the future to have a wa
58 RollingTimeDeltaHistory activate_duration_history_;
42 RollingTimeDeltaHistory draw_duration_history_; 59 RollingTimeDeltaHistory draw_duration_history_;
mithro-old 2015/06/30 07:55:49 I think it would also be useful to record the foll
brianderson 2015/06/30 17:35:15 Acknowledged. Some of those would probably fit be
43 RollingTimeDeltaHistory begin_main_frame_to_commit_duration_history_;
44 RollingTimeDeltaHistory commit_to_activate_duration_history_;
45 60
46 base::TimeTicks begin_main_frame_sent_time_; 61 base::TimeTicks begin_main_frame_sent_time_;
47 base::TimeTicks commit_complete_time_; 62 base::TimeTicks commit_time_;
63 base::TimeTicks start_prepare_tiles_time_;
64 base::TimeTicks start_activate_time_;
48 base::TimeTicks start_draw_time_; 65 base::TimeTicks start_draw_time_;
49 66
50 RenderingStatsInstrumentation* rendering_stats_instrumentation_; 67 RenderingStatsInstrumentation* rendering_stats_instrumentation_;
51 68
52 private: 69 private:
53 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory); 70 DISALLOW_COPY_AND_ASSIGN(CompositorTimingHistory);
54 }; 71 };
55 72
56 } // namespace cc 73 } // namespace cc
57 74
58 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_ 75 #endif // CC_SCHEDULER_COMPOSITOR_TIMING_HISTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698