| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 import '../node.dart'; | 5 import '../node.dart'; |
| 6 import '../scheduler.dart' as scheduler; | 6 import '../scheduler.dart' as scheduler; |
| 7 import 'dart:math' as math; | 7 import 'dart:math' as math; |
| 8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
| 9 | 9 |
| 10 class ParentData { | 10 class ParentData { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 assert(debugAncestorsAlreadyMarkedNeedsLayout()); | 91 assert(debugAncestorsAlreadyMarkedNeedsLayout()); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 _needsLayout = true; | 94 _needsLayout = true; |
| 95 assert(_relayoutSubtreeRoot != null); | 95 assert(_relayoutSubtreeRoot != null); |
| 96 if (_relayoutSubtreeRoot != this) { | 96 if (_relayoutSubtreeRoot != this) { |
| 97 assert(parent is RenderNode); | 97 assert(parent is RenderNode); |
| 98 parent.markNeedsLayout(); | 98 parent.markNeedsLayout(); |
| 99 } else { | 99 } else { |
| 100 _nodesNeedingLayout.add(this); | 100 _nodesNeedingLayout.add(this); |
| 101 scheduler.ensureVisualUpdate(); |
| 101 } | 102 } |
| 102 } | 103 } |
| 103 static void flushLayout() { | 104 static void flushLayout() { |
| 104 _debugDoingLayout = true; | 105 _debugDoingLayout = true; |
| 105 List<RenderNode> dirtyNodes = _nodesNeedingLayout; | 106 List<RenderNode> dirtyNodes = _nodesNeedingLayout; |
| 106 _nodesNeedingLayout = new List<RenderNode>(); | 107 _nodesNeedingLayout = new List<RenderNode>(); |
| 107 dirtyNodes..sort((a, b) => a.depth - b.depth)..forEach((node) { | 108 dirtyNodes..sort((a, b) => a.depth - b.depth)..forEach((node) { |
| 108 if (node._needsLayout && node.attached) | 109 if (node._needsLayout && node.attached) |
| 109 node._doLayout(); | 110 node._doLayout(); |
| 110 }); | 111 }); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 383 } |
| 383 } | 384 } |
| 384 | 385 |
| 385 ChildType get firstChild => _firstChild; | 386 ChildType get firstChild => _firstChild; |
| 386 ChildType get lastChild => _lastChild; | 387 ChildType get lastChild => _lastChild; |
| 387 ChildType childAfter(ChildType child) { | 388 ChildType childAfter(ChildType child) { |
| 388 assert(child.parentData is ParentDataType); | 389 assert(child.parentData is ParentDataType); |
| 389 return child.parentData.nextSibling; | 390 return child.parentData.nextSibling; |
| 390 } | 391 } |
| 391 } | 392 } |
| OLD | NEW |