anchor.diff:    }
   }
   
  -/// [Scheduler] for write and read tasks.
  +/// [Scheduler].
   class Scheduler {
  -  // TODO: add (intrusive) lists for animation tasks
  -  bool _running = false;
  +  static const int runningFlag = 1;
  +  static const int tickPendingFlag = 1 << 1;
  +  static const int framePendingFlag = 1 << 2;
  +
  +  int flags = 0;
  +  int clock = 0;
  +
  +  bool get isRunning => ((flags & runningFlag) != 0);
  +
     Queue<Function> _currentTasks = new Queue<Function>();
   
     ZoneSpecification _zoneSpec;
     Zone _zone;
   
  -  int _rafId = 0;
  +  /// Scheduler [Zone].
  +  Zone get zone => _zone;
  +
     Frame _currentFrame = new Frame();
     Frame _nextFrame = new Frame();
   
  -  Scheduler() {
  -    _zoneSpec = new ZoneSpecification(scheduleMicrotask: _scheduleMicrotask);
  -    _zone = Zone.current.fork(specification: _zoneSpec);
  -  }
  -
  -  /// Scheduler [Zone]
  -  Zone get zone => _zone;
  -
  -  /// [Frame] that contains tasks for the current animation frame
  +  Completer _nextTickCompleter;
  +
  +  /// [Frame] that contains tasks for the current animation frame.
     Frame get currentFrame {
  -    assert(_running);
  +    assert(isRunning);
       return _currentFrame;
     }
   
  
positive.code:   static const int lowestPriority = (1 << 31) - 1;
  
    /// Write groups indexed by priority
    List<_WriteGroup> _writeGroups = [];
    _WriteGroup _lowestPriorityWriteGroup;
  
    HeapPriorityQueue<_WriteGroup> _writeQueue =
        new HeapPriorityQueue<_WriteGroup>();
  
negative.code:   /// executing write tasks with this priority.
    Future write([int priority = lowestPriority]) {
      if (priority == lowestPriority) {
        if (_writeGroup == null) {
          _writeGroup = new _WriteGroup(lowestPriority);
          _writeGroup._completer = new Completer();
        }
        return _writeGroup._completer.future;
      }
  
      if (priority >= _prioWriteGroups.length) {
        var i = _prioWriteGroups.length;
        while (i <= priority) {
          _prioWriteGroups.add(new _WriteGroup(i++));
        }
      }
  
      final g = _prioWriteGroups[priority];
      if (g._completer == null) {
        g._completer = new Completer();
        _writeQueue.add(g);
      }
  
      return g._completer.future;
    }
  
  