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

Unified Diff: pkg/barback/lib/src/phase.dart

Issue 149243009: Add support for lazy transformers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
Index: pkg/barback/lib/src/phase.dart
diff --git a/pkg/barback/lib/src/phase.dart b/pkg/barback/lib/src/phase.dart
index 2136a1281e94d65e04d1914441a4b94ec7faeb90..9aa5484bea828a301df3d0c349ff9e500932176d 100644
--- a/pkg/barback/lib/src/phase.dart
+++ b/pkg/barback/lib/src/phase.dart
@@ -136,6 +136,8 @@ class Phase {
void addInput(AssetNode node) {
if (_inputs.containsKey(node.id)) _inputs[node.id].remove();
+ node.materialize();
Bob Nystrom 2014/01/30 19:33:44 Why is this being materialized?
nweiz 2014/01/31 03:43:27 The phase needs its inputs to be available if it's
+
// Each group is one channel along which an asset may be forwarded. Then
// there's one additional channel for the non-grouped transformers.
var forwarder = new PhaseForwarder(_groups.length + 1);
@@ -182,7 +184,7 @@ class Phase {
return newFuture(() {
if (id.package != cascade.package) return cascade.graph.getAssetNode(id);
if (!_outputs.containsKey(id)) return null;
- return _outputs[id].output;
+ return _outputs[id].output..materialize();
Bob Nystrom 2014/01/30 19:33:44 Nit, but I'm really not a fan of using a single ca
nweiz 2014/01/31 03:43:27 I think it's nicer than making a variable, but oka
});
}
@@ -219,6 +221,17 @@ class Phase {
}
}
+ /// Materialize all [LazyTransformer]s' transforms in this group.
+ void materializeAllTransforms() {
+ for (var group in _groups.values) {
+ group.materializeAllTransforms();
+ }
+
+ for (var input in _inputs.values) {
+ input.materializeAllTransforms();
+ }
+ }
+
/// Add a new phase after this one with [transformers].
///
/// This may only be called on a phase with no phase following it.

Powered by Google App Engine
This is Rietveld 408576698