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 'dart:math' as math; | 5 import 'dart:math' as math; |
6 import 'dart:sky' as sky; | 6 import 'dart:sky' as sky; |
7 import 'dart:sky' show Point, Size, Rect, Color, Paint, Path; | 7 import 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path; |
8 | 8 |
9 import '../base/hit_test.dart'; | 9 import '../base/hit_test.dart'; |
10 import '../base/node.dart'; | 10 import '../base/node.dart'; |
11 import '../base/scheduler.dart' as scheduler; | 11 import '../base/scheduler.dart' as scheduler; |
12 | 12 |
13 export 'dart:sky' show Point, Size, Rect, Color, Paint, Path; | 13 export 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path; |
14 export '../base/hit_test.dart' show HitTestTarget, HitTestEntry, HitTestResult; | 14 export '../base/hit_test.dart' show HitTestTarget, HitTestEntry, HitTestResult; |
15 | 15 |
16 | 16 |
17 class ParentData { | 17 class ParentData { |
18 void detach() { | 18 void detach() { |
19 detachSiblings(); | 19 detachSiblings(); |
20 } | 20 } |
21 void detachSiblings() { } // workaround for lack of inter-class mixins in Dart | 21 void detachSiblings() { } // workaround for lack of inter-class mixins in Dart |
22 void merge(ParentData other) { | 22 void merge(ParentData other) { |
23 // override this in subclasses to merge in data from other into this | 23 // override this in subclasses to merge in data from other into this |
24 assert(other.runtimeType == this.runtimeType); | 24 assert(other.runtimeType == this.runtimeType); |
25 } | 25 } |
26 String toString() => '<none>'; | 26 String toString() => '<none>'; |
27 } | 27 } |
28 | 28 |
29 class RenderCanvas extends sky.Canvas { | 29 class RenderCanvas extends sky.Canvas { |
30 RenderCanvas(sky.PictureRecorder recorder, double width, double height) : supe
r(recorder, width, height); | 30 RenderCanvas(sky.PictureRecorder recorder, Size bounds) : super(recorder, boun
ds); |
31 | 31 |
32 void paintChild(RenderObject child, Point position) { | 32 void paintChild(RenderObject child, Point position) { |
33 translate(position.x, position.y); | 33 translate(position.x, position.y); |
34 child.paint(this); | 34 child.paint(this); |
35 translate(-position.x, -position.y); | 35 translate(-position.x, -position.y); |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 abstract class Constraints { | 39 abstract class Constraints { |
40 const Constraints(); | 40 const Constraints(); |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 int count = 1; | 531 int count = 1; |
532 ChildType child = _firstChild; | 532 ChildType child = _firstChild; |
533 while (child != null) { | 533 while (child != null) { |
534 result += '${prefix}child ${count}: ${child.toString(prefix)}'; | 534 result += '${prefix}child ${count}: ${child.toString(prefix)}'; |
535 count += 1; | 535 count += 1; |
536 child = child.parentData.nextSibling; | 536 child = child.parentData.nextSibling; |
537 } | 537 } |
538 return result; | 538 return result; |
539 } | 539 } |
540 } | 540 } |
OLD | NEW |