| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:html'; | 5 import 'dart:html'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 /// A generic rendering task that can be scheduled. | 9 /// A generic rendering task that can be scheduled. |
| 10 abstract class RenderingTask { | 10 abstract class RenderingTask { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 void enqueue(RenderingTask r) { | 59 void enqueue(RenderingTask r) { |
| 60 assert(r != null); | 60 assert(r != null); |
| 61 // If no task are in the queue there is no rendering phase scheduled. | 61 // If no task are in the queue there is no rendering phase scheduled. |
| 62 if (isEmpty) _render(); | 62 if (isEmpty) _render(); |
| 63 _queue.addLast(r); | 63 _queue.addLast(r); |
| 64 } | 64 } |
| 65 | 65 |
| 66 Future _render() async { | 66 Future _render() async { |
| 67 await _barrier.next; | 67 await _barrier.next; |
| 68 while (_queue.isNotEmpty) { | 68 while (_queue.isNotEmpty) { |
| 69 _queue.removeFirst().render(); | 69 _queue.first.render(); |
| 70 _queue.removeFirst(); |
| 70 } | 71 } |
| 71 } | 72 } |
| 72 } | 73 } |
| OLD | NEW |