| 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 'dart:sky' as sky; | 6 import 'dart:sky' as sky; |
| 7 | 7 |
| 8 // ABSTRACT LAYOUT | 8 // ABSTRACT LAYOUT |
| 9 | 9 |
| 10 class ParentData { | 10 class ParentData { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 void _doLayout() { | 119 void _doLayout() { |
| 120 try { | 120 try { |
| 121 assert(_relayoutSubtreeRoot == this); | 121 assert(_relayoutSubtreeRoot == this); |
| 122 performLayout(); | 122 performLayout(); |
| 123 } catch (e, stack) { | 123 } catch (e, stack) { |
| 124 print('Exception raised during layout of ${this}: ${e}'); | 124 print('Exception raised during layout of ${this}: ${e}'); |
| 125 print(stack); | 125 print(stack); |
| 126 return; | 126 return; |
| 127 } | 127 } |
| 128 assert(!_needsLayout); // check that the relayout() method marked us "not di
rty" | 128 _needsLayout = false; |
| 129 } | 129 } |
| 130 void layout(dynamic constraints, { bool parentUsesSize: false }) { | 130 void layout(dynamic constraints, { bool parentUsesSize: false }) { |
| 131 RenderNode relayoutSubtreeRoot; | 131 RenderNode relayoutSubtreeRoot; |
| 132 if (!parentUsesSize || sizedByParent || parent is! RenderNode) | 132 if (!parentUsesSize || sizedByParent || parent is! RenderNode) |
| 133 relayoutSubtreeRoot = this; | 133 relayoutSubtreeRoot = this; |
| 134 else | 134 else |
| 135 relayoutSubtreeRoot = parent._relayoutSubtreeRoot; | 135 relayoutSubtreeRoot = parent._relayoutSubtreeRoot; |
| 136 if (!needsLayout && constraints == _constraints && relayoutSubtreeRoot == _r
elayoutSubtreeRoot) | 136 if (!needsLayout && constraints == _constraints && relayoutSubtreeRoot == _r
elayoutSubtreeRoot) |
| 137 return; | 137 return; |
| 138 _constraints = constraints; | 138 _constraints = constraints; |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 | 945 |
| 946 void hitTestChildren(HitTestResult result, { double x, double y }) { | 946 void hitTestChildren(HitTestResult result, { double x, double y }) { |
| 947 // defaultHitTestChildren(result, x: x, y: y); | 947 // defaultHitTestChildren(result, x: x, y: y); |
| 948 } | 948 } |
| 949 | 949 |
| 950 void paint(RenderNodeDisplayList canvas) { | 950 void paint(RenderNodeDisplayList canvas) { |
| 951 super.paint(canvas); | 951 super.paint(canvas); |
| 952 _layoutRoot.paint(canvas); | 952 _layoutRoot.paint(canvas); |
| 953 } | 953 } |
| 954 } | 954 } |
| OLD | NEW |