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 library fn; | 5 library fn; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:mirrors'; | 9 import 'dart:mirrors'; |
10 import 'dart:sky' as sky; | 10 import 'dart:sky' as sky; |
11 import 'reflect.dart' as reflect; | 11 import 'reflect.dart' as reflect; |
12 import 'app.dart'; | 12 import 'app.dart'; |
13 import 'rendering/render_block.dart'; | 13 import 'rendering/render_block.dart'; |
14 import 'rendering/render_box.dart'; | 14 import 'rendering/render_box.dart'; |
15 import 'rendering/render_flex.dart'; | 15 import 'rendering/render_flex.dart'; |
16 import 'rendering/render_image.dart'; | |
16 import 'rendering/render_node.dart'; | 17 import 'rendering/render_node.dart'; |
17 import 'rendering/render_paragraph.dart'; | 18 import 'rendering/render_paragraph.dart'; |
18 | 19 |
19 // final sky.Tracing _tracing = sky.window.tracing; | 20 // final sky.Tracing _tracing = sky.window.tracing; |
20 | 21 |
21 final bool _shouldLogRenderDuration = false; | 22 final bool _shouldLogRenderDuration = false; |
22 final bool _shouldTrace = false; | 23 final bool _shouldTrace = false; |
23 | 24 |
24 enum _SyncOperation { IDENTICAL, INSERTION, STATEFUL, STATELESS, REMOVAL } | 25 enum _SyncOperation { IDENTICAL, INSERTION, STATEFUL, STATELESS, REMOVAL } |
25 | 26 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
538 root.direction = direction; | 539 root.direction = direction; |
539 } | 540 } |
540 } | 541 } |
541 | 542 |
542 class FlexExpandingChild extends ParentDataNode { | 543 class FlexExpandingChild extends ParentDataNode { |
543 FlexExpandingChild(UINode content, [int flex = 1]) | 544 FlexExpandingChild(UINode content, [int flex = 1]) |
544 : super(content, new FlexBoxParentData()..flex = flex); | 545 : super(content, new FlexBoxParentData()..flex = flex); |
545 } | 546 } |
546 | 547 |
547 class Image extends RenderNodeWrapper { | 548 class Image extends RenderNodeWrapper { |
548 RenderCSSImage root; | 549 RenderImage root; |
549 RenderCSSImage createNode() => new RenderCSSImage(this, this.src, this.width, this.height); | 550 RenderImage createNode() => new RenderImage(this.src, this.width, this.height) ; |
551 | |
552 static final Image _emptyImage = new Image(); | |
553 | |
554 RenderNodeWrapper get emptyNode => _emptyImage; | |
abarth-chromium
2015/06/03 00:07:53
We don't need _emptyImage or emptyNode anymore.
jackson
2015/06/03 17:41:42
Acknowledged.
| |
550 | 555 |
551 final String src; | 556 final String src; |
552 final int width; | 557 final double width; |
553 final int height; | 558 final double height; |
554 | 559 |
555 Image({ | 560 Image({ |
556 Object key, | 561 Object key, |
557 this.width, | 562 this.width, |
558 this.height, | 563 this.height, |
559 this.src | 564 this.src |
560 }) : super(key: key); | 565 }) : super(key: key); |
561 | 566 |
562 void syncRenderNode(UINode old) { | 567 void syncRenderNode(UINode old) { |
563 super.syncRenderNode(old); | 568 super.syncRenderNode(old); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
853 | 858 |
854 class Rectangle extends RenderNodeWrapper { | 859 class Rectangle extends RenderNodeWrapper { |
855 RenderSolidColor root; | 860 RenderSolidColor root; |
856 RenderSolidColor createNode() => | 861 RenderSolidColor createNode() => |
857 new RenderSolidColor(color, desiredSize: new sky.Size(40.0, 130.0)); | 862 new RenderSolidColor(color, desiredSize: new sky.Size(40.0, 130.0)); |
858 | 863 |
859 final int color; | 864 final int color; |
860 | 865 |
861 Rectangle(this.color, { Object key }) : super(key: key); | 866 Rectangle(this.color, { Object key }) : super(key: key); |
862 } | 867 } |
OLD | NEW |