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_OUTPUT_BEGIN_FRAME_ARGS_H_ | 5 #ifndef CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 // You should be able to find all instances where a BeginFrame has been | 72 // You should be able to find all instances where a BeginFrame has been |
73 // created by searching for "BeginFrameArgs::Create". | 73 // created by searching for "BeginFrameArgs::Create". |
74 // The location argument should **always** be BEGINFRAME_FROM_HERE macro. | 74 // The location argument should **always** be BEGINFRAME_FROM_HERE macro. |
75 static BeginFrameArgs Create(CreationLocation location, | 75 static BeginFrameArgs Create(CreationLocation location, |
76 uint32_t source_id, | 76 uint32_t source_id, |
77 uint64_t sequence_number, | 77 uint64_t sequence_number, |
78 base::TimeTicks frame_time, | 78 base::TimeTicks frame_time, |
79 base::TimeTicks deadline, | 79 base::TimeTicks deadline, |
80 base::TimeDelta interval, | 80 base::TimeDelta interval, |
81 BeginFrameArgsType type); | 81 BeginFrameArgsType type); |
82 BeginFrameArgs(const BeginFrameArgs&); | |
82 | 83 |
83 // This is the default delta that will be used to adjust the deadline when | 84 // This is the default delta that will be used to adjust the deadline when |
84 // proper draw-time estimations are not yet available. | 85 // proper draw-time estimations are not yet available. |
85 static base::TimeDelta DefaultEstimatedParentDrawTime(); | 86 static base::TimeDelta DefaultEstimatedParentDrawTime(); |
86 | 87 |
87 // This is the default interval to use to avoid sprinkling the code with | 88 // This is the default interval to use to avoid sprinkling the code with |
88 // magic numbers. | 89 // magic numbers. |
89 static base::TimeDelta DefaultInterval(); | 90 static base::TimeDelta DefaultInterval(); |
90 | 91 |
91 bool IsValid() const { return interval >= base::TimeDelta(); } | 92 bool IsValid() const { return interval >= base::TimeDelta(); } |
92 | 93 |
93 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; | 94 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
94 void AsValueInto(base::trace_event::TracedValue* dict) const; | 95 void AsValueInto(base::trace_event::TracedValue* dict) const; |
95 | 96 |
96 base::TimeTicks frame_time; | 97 base::TimeTicks frame_time; |
97 base::TimeTicks deadline; | 98 base::TimeTicks deadline; |
98 base::TimeDelta interval; | 99 base::TimeDelta interval; |
99 | 100 |
100 // |source_id| and |sequence_number| identify a BeginFrame within a single | 101 // |source_id| and |sequence_number| identify a BeginFrame within a single |
101 // process and are set by the original BeginFrameSource that created the | 102 // process and are set by the original BeginFrameSource that created the |
102 // BeginFrameArgs. When |source_id| of consecutive BeginFrameArgs changes, | 103 // BeginFrameArgs. When |source_id| of consecutive BeginFrameArgs changes, |
103 // observers should expect the continuity of |sequence_number| to break. | 104 // observers should expect the continuity of |sequence_number| to break. |
104 uint64_t sequence_number; | 105 uint64_t sequence_number; |
105 uint32_t source_id; // |source_id| after |sequence_number| for packing. | 106 uint32_t source_id; // |source_id| after |sequence_number| for packing. |
107 uint32_t frame_source_number; | |
108 | |
109 // TODO: move these into a separate struct? | |
110 // TODO: report a time delta - otherwise this doesn't make sense | |
111 base::TimeTicks ready_to_activate_time; | |
112 uint32_t ready_to_activate_source_frame_number; | |
brianderson
2017/03/30 18:32:03
BeginFrameArgs are used everywhere, but these fiel
panicker
2017/03/30 21:31:25
The reason I added it to BeginFrameArgs instead of
panicker
2017/03/30 23:09:19
I tried moving to BeginMainFrameAndCommitState - h
brianderson
2017/03/31 22:19:48
Re My #2 suggestion: That would be adding a BeginM
| |
106 | 113 |
107 BeginFrameArgsType type; | 114 BeginFrameArgsType type; |
108 bool on_critical_path; | 115 bool on_critical_path; |
109 | 116 |
110 private: | 117 private: |
111 BeginFrameArgs(uint32_t source_id, | 118 BeginFrameArgs(uint32_t source_id, |
112 uint64_t sequence_number, | 119 uint64_t sequence_number, |
113 base::TimeTicks frame_time, | 120 base::TimeTicks frame_time, |
114 base::TimeTicks deadline, | 121 base::TimeTicks deadline, |
115 base::TimeDelta interval, | 122 base::TimeDelta interval, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 uint32_t remaining_frames; | 180 uint32_t remaining_frames; |
174 | 181 |
175 // |true| if the observer has produced damage (e.g. sent a CompositorFrame or | 182 // |true| if the observer has produced damage (e.g. sent a CompositorFrame or |
176 // damaged a surface) as part of responding to the BeginFrame. | 183 // damaged a surface) as part of responding to the BeginFrame. |
177 bool has_damage; | 184 bool has_damage; |
178 }; | 185 }; |
179 | 186 |
180 } // namespace cc | 187 } // namespace cc |
181 | 188 |
182 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 189 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
OLD | NEW |