Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: sky/sdk/lib/framework/fn2.dart

Issue 1160013004: Implement RenderImage and Image for Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase again Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/examples/raw/render_paragraph.dart ('k') | sky/sdk/lib/framework/rendering/box.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 'app.dart'; 7 import 'app.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:mirrors'; 10 import 'dart:mirrors';
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 root.direction = direction; 631 root.direction = direction;
632 } 632 }
633 } 633 }
634 634
635 class FlexExpandingChild extends ParentDataNode { 635 class FlexExpandingChild extends ParentDataNode {
636 FlexExpandingChild(UINode content, [int flex = 1]) 636 FlexExpandingChild(UINode content, [int flex = 1])
637 : super(content, new FlexBoxParentData()..flex = flex); 637 : super(content, new FlexBoxParentData()..flex = flex);
638 } 638 }
639 639
640 class Image extends RenderNodeWrapper { 640 class Image extends RenderNodeWrapper {
641 RenderCSSImage root; 641 RenderImage root;
642 RenderCSSImage createNode() => new RenderCSSImage(this, this.src, this.width, this.height); 642 RenderImage createNode() => new RenderImage(this.src, this.size);
643 643
644 final String src; 644 final String src;
645 final int width; 645 final sky.Size size;
646 final int height;
647 646
648 Image({ 647 Image({
649 Object key, 648 Object key,
650 this.width, 649 this.src,
651 this.height, 650 this.size
652 this.src
653 }) : super(key: key); 651 }) : super(key: key);
654 652
655 void syncRenderNode(UINode old) { 653 void syncRenderNode(UINode old) {
656 super.syncRenderNode(old); 654 super.syncRenderNode(old);
657 root.configure(this.src, this.width, this.height); 655 root.src = src;
656 root.requestedSize = size;
658 } 657 }
659 } 658 }
660 659
661 660
662 Set<Component> _mountedComponents = new HashSet<Component>(); 661 Set<Component> _mountedComponents = new HashSet<Component>();
663 Set<Component> _unmountedComponents = new HashSet<Component>(); 662 Set<Component> _unmountedComponents = new HashSet<Component>();
664 663
665 void _enqueueDidMount(Component c) { 664 void _enqueueDidMount(Component c) {
666 assert(!_notifingMountStatus); 665 assert(!_notifingMountStatus);
667 _mountedComponents.add(c); 666 _mountedComponents.add(c);
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 assert(root.parent is RenderView); 948 assert(root.parent is RenderView);
950 } 949 }
951 } 950 }
952 951
953 class Text extends Component { 952 class Text extends Component {
954 Text(this.data) : super(key: '*text*'); 953 Text(this.data) : super(key: '*text*');
955 final String data; 954 final String data;
956 bool get interchangeable => true; 955 bool get interchangeable => true;
957 UINode build() => new Paragraph(text: data); 956 UINode build() => new Paragraph(text: data);
958 } 957 }
OLDNEW
« no previous file with comments | « sky/examples/raw/render_paragraph.dart ('k') | sky/sdk/lib/framework/rendering/box.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698