| Index: sky/sdk/lib/painting/box_painter.dart
|
| diff --git a/sky/sdk/lib/painting/box_painter.dart b/sky/sdk/lib/painting/box_painter.dart
|
| index 4ce567f51fba1d3bb3120105137806d7a49310c4..a8a92abf30f0cfa82a00f2fe1a16cce3b59b672b 100644
|
| --- a/sky/sdk/lib/painting/box_painter.dart
|
| +++ b/sky/sdk/lib/painting/box_painter.dart
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +import 'dart:async';
|
| import 'dart:math' as math;
|
| import 'dart:sky' as sky;
|
| import 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path;
|
| @@ -140,19 +141,18 @@ enum BackgroundRepeat { repeat, repeatX, repeatY, noRepeat }
|
| // to do animated images.
|
|
|
| class BackgroundImage {
|
| - final String src;
|
| final BackgroundFit fit;
|
| final BackgroundRepeat repeat;
|
| BackgroundImage({
|
| - this.src,
|
| + Future<sky.Image> image,
|
| this.fit: BackgroundFit.scaleDown,
|
| this.repeat: BackgroundRepeat.noRepeat
|
| }) {
|
| - image_cache.load(src).then((image) {
|
| - if (image == null)
|
| + image.then((resolvedImage) {
|
| + if (resolvedImage == null)
|
| return;
|
| - _image = image;
|
| - _size = new Size(image.width.toDouble(), image.height.toDouble());
|
| + _image = resolvedImage;
|
| + _size = new Size(resolvedImage.width.toDouble(), resolvedImage.height.toDouble());
|
| for (Function listener in _listeners) {
|
| listener();
|
| }
|
| @@ -174,7 +174,7 @@ class BackgroundImage {
|
| _listeners.remove(listener);
|
| }
|
|
|
| - String toString() => 'BackgroundImage($src, $fit, $repeat)';
|
| + String toString() => 'BackgroundImage($fit, $repeat)';
|
| }
|
|
|
| enum Shape { rectangle, circle }
|
|
|