-
- /** turns a resource into a Picture.Source and passes it to the callback */
- public static Picture load(JS rr, final Scheduler.Task callback) {
- final JS r = rr;
- Picture ret = (Picture)cache.get(r);
- if (ret == null) cache.put(r, ret = Platform.createPicture(r));
+
+ /** invoked when an image is fully loaded; subclasses can use this to initialize platform-specific constructs */
+ protected void loaded() { isLoaded = true; }
+
+ /** turns a stream into a Picture.Source and passes it to the callback */
+ public static Picture load(final JS stream, final Scheduler.Task callback) {
+ Picture ret = (Picture)cache.get(stream);
+ if (ret == null) cache.put(stream, ret = Platform.createPicture(stream));