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

Unified Diff: sky/sdk/example/raw/spinning_image.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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/example/game/lib/image_map.dart ('k') | sky/sdk/lib/mojo/asset_bundle.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/raw/spinning_image.dart
diff --git a/sky/sdk/example/raw/spinning_image.dart b/sky/sdk/example/raw/spinning_image.dart
index 9fa1b013aeaea5ee8280e2764e9d23893924ea7d..eca7059f549ef6feff43ba86e4e82bd57d11d77b 100644
--- a/sky/sdk/example/raw/spinning_image.dart
+++ b/sky/sdk/example/raw/spinning_image.dart
@@ -59,7 +59,7 @@ bool handleEvent(Event event) {
}
if (event.type == "pointerup") {
- image_cache.load(url2, handleImageLoad);
+ image_cache.load(url2).then(handleImageLoad);
return true;
}
@@ -67,8 +67,7 @@ bool handleEvent(Event event) {
}
void main() {
- image_cache.load(url1, handleImageLoad);
- image_cache.load(url1, handleImageLoad);
+ image_cache.load(url1).then(handleImageLoad);
view.setEventCallback(handleEvent);
view.setBeginFrameCallback(beginFrame);
}
« no previous file with comments | « sky/sdk/example/game/lib/image_map.dart ('k') | sky/sdk/lib/mojo/asset_bundle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698