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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 | 103 |
104 private: | 104 private: |
105 BeginFrameArgs(uint32_t source_id, | 105 BeginFrameArgs(uint32_t source_id, |
106 uint64_t sequence_number, | 106 uint64_t sequence_number, |
107 base::TimeTicks frame_time, | 107 base::TimeTicks frame_time, |
108 base::TimeTicks deadline, | 108 base::TimeTicks deadline, |
109 base::TimeDelta interval, | 109 base::TimeDelta interval, |
110 BeginFrameArgsType type); | 110 BeginFrameArgsType type); |
111 }; | 111 }; |
112 | 112 |
113 // Sent by a BeginFrameObserver as acknowledgment of completing a BeginFrame. | |
114 struct CC_EXPORT BeginFrameAck { | |
115 BeginFrameAck(); | |
116 BeginFrameAck(uint64_t source_id, | |
117 uint64_t sequence_number, | |
118 uint64_t latest_confirmed_frame, | |
119 uint32_t remaining_frames, | |
120 bool has_damage); | |
121 | |
122 // Source identifier of the BeginFrame that is acknowledged. The | |
123 // BeginFrameSource that receives the acknowledgment uses this to discard | |
124 // BeginFrameAcks for BeginFrames sent by a different source. Such a situation | |
125 // may occur when the BeginFrameSource of the observer changes while a | |
126 // BeginFrame from the old source is still in flight. | |
127 uint64_t source_id; | |
brianderson
2016/12/21 20:15:06
uint32_t here or uint64_t elsewhere. Don't care wh
Eric Seckler
2016/12/22 11:11:48
thanks, this should be uint32_t :)
| |
128 | |
129 // Sequence number of the BeginFrame that is acknowledged. | |
130 uint64_t sequence_number; | |
131 | |
132 // Sequence number of the latest BeginFrame that was positively acknowledged | |
133 // (confirmed) by the observer. | |
134 // | |
135 // There are two scenarios for a positive acknowledgment: | |
136 // a) All of the observer's pending updates led to successful damage (e.g. a | |
137 // CompositorFrame or a damaged surface). | |
138 // b) The observer did not have any updates and thus did not need to | |
139 // produce damage. | |
140 // A negative acknowledgment, in contrast, describes a situation in which the | |
141 // observer had pending updates, but was unable to successfully produce | |
142 // corresponding damage for all its updates in time. | |
143 // | |
144 // As a result, |latest_confirmed_frame| describes the "staleness" of the last | |
145 // damage that was produced by the observer. Note that even if | |
146 // |has_damage == true|, the damage produced as a result of the acknowledged | |
147 // BeginFrame may be stale (|latest_confirmed_frame < sequence_number|). In | |
148 // such a case, the damage that was produced may contain updates from previous | |
149 // BeginFrames or only part of this BeginFrame's updates. | |
150 // | |
151 // Observers aggregate the |latest_confirmed_frame| of their children: The | |
152 // compositor Scheduler indicates the latest BeginFrame that both impl and | |
153 // main thread confirmed. Likewise, the DisplayScheduler indicates the minimum | |
154 // |latest_confirmed_frame| that all its BeginFrameObservers acknowledged. | |
155 // TODO(eseckler): Set this in Scheduler / DisplayScheduler and other | |
156 // observers according to above comment. | |
157 uint64_t latest_confirmed_frame; | |
brianderson
2016/12/21 20:15:06
If this is a sequence number, would it be clearer
Eric Seckler
2016/12/22 11:11:48
I guess so :) Changed to "latest_confirmed_sequenc
| |
158 | |
159 // Number of BeginFrames queued at the observer at time of acknowledgment. | |
160 uint32_t remaining_frames; | |
brianderson
2016/12/21 20:15:06
Is this useful for anything anymore? If not, feel
Eric Seckler
2016/12/22 11:11:48
Yeah, I think we can get rid of it. Let's do that
brianderson
2017/01/03 19:30:16
sg.
| |
161 | |
162 // |true| if the observer has produced damage (e.g. sent a CompositorFrame or | |
163 // damaged a surface) as part of responding to the BeginFrame. | |
164 bool has_damage; | |
brianderson
2016/12/21 20:15:06
Even if there isn't damage, the compositor might r
Eric Seckler
2016/12/22 11:11:48
Hehe, that was the field's original name :)
I thi
brianderson
2017/01/03 19:30:16
I see. Don't want to bikeshed this, has_damage is
| |
165 }; | |
166 | |
113 } // namespace cc | 167 } // namespace cc |
114 | 168 |
115 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 169 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
OLD | NEW |