computeDrawOrder method

void computeDrawOrder()

Implementation

void computeDrawOrder() {
  _drawables.clear();
  _rules.clear();
  buildDrawOrder(_drawables, null, _rules);
  var root = DrawTarget();
  for (final nodeRules in _rules) {
    for (final target in nodeRules.targets) {
      target.dependents.clear();
    }
  }
  for (final nodeRules in _rules) {
    for (final target in nodeRules.targets) {
      root.dependents.add(target);
      var dependentRules = target.drawable?.flattenedDrawRules;
      if (dependentRules != null) {
        for (final dependentRule in dependentRules.targets) {
          dependentRule.dependents.add(target);
        }
      }
    }
  }
  var sorter = DependencySorter<Component>();
  _sortedDrawRules = sorter.sort(root).cast<DrawTarget>().skip(1).toList();
  sortDrawOrder();
}