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 'dart:math' as math; | 7 import 'dart:math' as math; |
7 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
8 | 9 |
9 class ParentData { | 10 class ParentData { |
10 void detach() { | 11 void detach() { |
11 detachSiblings(); | 12 detachSiblings(); |
12 } | 13 } |
13 void detachSiblings() { } // workaround for lack of inter-class mixins in Dart | 14 void detachSiblings() { } // workaround for lack of inter-class mixins in Dart |
14 void merge(ParentData other) { | 15 void merge(ParentData other) { |
15 // override this in subclasses to merge in data from other into this | 16 // override this in subclasses to merge in data from other into this |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 int newAngle, // 0..3 | 167 int newAngle, // 0..3 |
167 Duration time | 168 Duration time |
168 }) { } | 169 }) { } |
169 | 170 |
170 | 171 |
171 // PAINTING | 172 // PAINTING |
172 | 173 |
173 static bool debugDoingPaint = false; | 174 static bool debugDoingPaint = false; |
174 void markNeedsPaint() { | 175 void markNeedsPaint() { |
175 assert(!debugDoingPaint); | 176 assert(!debugDoingPaint); |
176 // TODO(abarth): It's very redundant to call this for every node in the | 177 scheduler.ensureVisualUpdate(); |
177 // render tree during layout. We should instead compute a summary bit and | |
178 // call it once at the end of layout. | |
179 sky.view.scheduleFrame(); | |
180 } | 178 } |
181 void paint(RenderNodeDisplayList canvas) { } | 179 void paint(RenderNodeDisplayList canvas) { } |
182 | 180 |
183 | 181 |
184 // HIT TESTING | 182 // HIT TESTING |
185 | 183 |
186 void handlePointer(sky.PointerEvent event) { | 184 void handlePointer(sky.PointerEvent event) { |
187 // override this if you have a client, to hand it to the client | 185 // override this if you have a client, to hand it to the client |
188 // override this if you want to do anything with the pointer event | 186 // override this if you want to do anything with the pointer event |
189 } | 187 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 374 } |
377 } | 375 } |
378 | 376 |
379 ChildType get firstChild => _firstChild; | 377 ChildType get firstChild => _firstChild; |
380 ChildType get lastChild => _lastChild; | 378 ChildType get lastChild => _lastChild; |
381 ChildType childAfter(ChildType child) { | 379 ChildType childAfter(ChildType child) { |
382 assert(child.parentData is ParentDataType); | 380 assert(child.parentData is ParentDataType); |
383 return child.parentData.nextSibling; | 381 return child.parentData.nextSibling; |
384 } | 382 } |
385 } | 383 } |
OLD | NEW |