Commit 6d689c6c authored by Collin Jackson's avatar Collin Jackson

Support for decoding images in lists

parent fbd5460b
...@@ -70,7 +70,8 @@ class MojoAssetBundle extends AssetBundle { ...@@ -70,7 +70,8 @@ class MojoAssetBundle extends AssetBundle {
return _imageCache.putIfAbsent(key, () { return _imageCache.putIfAbsent(key, () {
Completer<sky.Image> completer = new Completer<sky.Image>(); Completer<sky.Image> completer = new Completer<sky.Image>();
load(key).then((assetData) { load(key).then((assetData) {
new sky.ImageDecoder(assetData.handle.h, completer.complete); new sky.ImageDecoder(completer.complete)
..initWithConsumer(assetData.handle.h);
}); });
return new ImageResource(completer.future); return new ImageResource(completer.future);
}); });
......
...@@ -23,7 +23,8 @@ class _ImageCache { ...@@ -23,7 +23,8 @@ class _ImageCache {
print("Failed (${response.statusCode}) to load image ${url}"); print("Failed (${response.statusCode}) to load image ${url}");
completer.complete(null); completer.complete(null);
} else { } else {
new sky.ImageDecoder(response.body.handle.h, completer.complete); new sky.ImageDecoder(completer.complete)
..initWithConsumer(response.body.handle.h);
} }
}); });
return new ImageResource(completer.future); return new ImageResource(completer.future);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment