| 209 | 209 |
})
|
| 210 | 210 |
|
| 211 | 211 |
for _, ch := range s.renderByPriority(tw, pSyncer, aSyncer) {
|
| 212 | |
rs := <-ch
|
| 213 | |
_, err = s.cw.ReadFrom(rs.reader)
|
| 214 | |
if !rs.bar.completed && rs.toComplete {
|
| 215 | |
rs.bar.completed = true
|
| 216 | |
if rs.bar.removeOnComplete {
|
| 217 | |
s.heapUpdated = heap.Remove(s.bHeap, rs.bar.index) != nil
|
| 218 | |
}
|
| 219 | |
if replacementBar, ok := s.waitBars[rs.bar]; ok {
|
|
212 |
bf := <-ch
|
|
213 |
_, err = s.cw.ReadFrom(bf.reader)
|
|
214 |
if !bf.bar.completed && bf.toComplete {
|
|
215 |
bf.bar.completed = true
|
|
216 |
if bf.bar.removeOnComplete {
|
|
217 |
s.heapUpdated = heap.Remove(s.bHeap, bf.bar.index) != nil
|
|
218 |
}
|
|
219 |
if replacementBar, ok := s.waitBars[bf.bar]; ok {
|
| 220 | 220 |
heap.Push(s.bHeap, replacementBar)
|
| 221 | 221 |
s.heapUpdated = true
|
| 222 | |
delete(s.waitBars, rs.bar)
|
|
222 |
delete(s.waitBars, bf.bar)
|
| 223 | 223 |
}
|
| 224 | 224 |
defer func() {
|
| 225 | |
s.shutdownPending = append(s.shutdownPending, rs.bar)
|
|
225 |
s.shutdownPending = append(s.shutdownPending, bf.bar)
|
| 226 | 226 |
}()
|
| 227 | 227 |
}
|
| 228 | 228 |
}
|
|
| 242 | 242 |
return
|
| 243 | 243 |
}
|
| 244 | 244 |
|
| 245 | |
func (s *pState) renderByPriority(tw int, pSyncer, aSyncer *widthSyncer) []<-chan *renderedState {
|
| 246 | |
pp := make([]<-chan *renderedState, 0, s.bHeap.Len())
|
|
245 |
func (s *pState) renderByPriority(tw int, pSyncer, aSyncer *widthSyncer) []<-chan *bFrame {
|
|
246 |
pp := make([]<-chan *bFrame, 0, s.bHeap.Len())
|
| 247 | 247 |
for s.bHeap.Len() > 0 {
|
| 248 | 248 |
b := heap.Pop(s.bHeap).(*Bar)
|
| 249 | 249 |
defer heap.Push(s.bHeap, b)
|