markNeedsAddToScene method

  1. @protected
  2. @visibleForTesting
void markNeedsAddToScene ()
@protected, @visibleForTesting

Mark that this layer has changed and addToScene needs to be called.

Implementation

@protected
@visibleForTesting
void markNeedsAddToScene() {
  assert(
    !alwaysNeedsAddToScene,
    '$runtimeType with alwaysNeedsAddToScene set called markNeedsAddToScene.\n'
    'The layer\'s alwaysNeedsAddToScene is set to true, and therefore it should not call markNeedsAddToScene.',
  );

  // Already marked. Short-circuit.
  if (_needsAddToScene) {
    return;
  }

  _needsAddToScene = true;
}