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

Side by Side Diff: sky/sdk/lib/rendering/box.dart

Issue 1216303005: Convert image_cache to using Futures rather than callbacks (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix _loadComplete Created 5 years, 5 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/sdk/lib/painting/box_painter.dart ('k') | no next file » | 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 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 7
8 import 'package:vector_math/vector_math.dart'; 8 import 'package:vector_math/vector_math.dart';
9 9
10 import '../base/debug.dart'; 10 import '../base/debug.dart';
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 src = url; 897 src = url;
898 } 898 }
899 899
900 sky.Image _image; 900 sky.Image _image;
901 String _src; 901 String _src;
902 String get src => _src; 902 String get src => _src;
903 void set src (String value) { 903 void set src (String value) {
904 if (value == _src) 904 if (value == _src)
905 return; 905 return;
906 _src = value; 906 _src = value;
907 image_cache.load(_src, (result) { 907 image_cache.load(_src).then((result) {
908 _image = result; 908 _image = result;
909 if (requestedSize.width == null || requestedSize.height == null) 909 if (requestedSize.width == null || requestedSize.height == null)
910 markNeedsLayout(); 910 markNeedsLayout();
911 markNeedsPaint(); 911 markNeedsPaint();
912 }); 912 });
913 } 913 }
914 914
915 Size _requestedSize; 915 Size _requestedSize;
916 Size get requestedSize => _requestedSize; 916 Size get requestedSize => _requestedSize;
917 void set requestedSize (Size value) { 917 void set requestedSize (Size value) {
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 1304
1305 void defaultPaint(PaintingCanvas canvas, Offset offset) { 1305 void defaultPaint(PaintingCanvas canvas, Offset offset) {
1306 RenderBox child = firstChild; 1306 RenderBox child = firstChild;
1307 while (child != null) { 1307 while (child != null) {
1308 assert(child.parentData is ParentDataType); 1308 assert(child.parentData is ParentDataType);
1309 canvas.paintChild(child, child.parentData.position + offset); 1309 canvas.paintChild(child, child.parentData.position + offset);
1310 child = child.parentData.nextSibling; 1310 child = child.parentData.nextSibling;
1311 } 1311 }
1312 } 1312 }
1313 } 1313 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/painting/box_painter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698