markNeedsCompositingBitsUpdate method Null safety

void markNeedsCompositingBitsUpdate()

Mark the compositing state for this render object as dirty.

This is called to indicate that the value for needsCompositing needs to be recomputed during the next PipelineOwner.flushCompositingBits engine phase.

When the subtree is mutated, we need to recompute our needsCompositing bit, and some of our ancestors need to do the same (in case ours changed in a way that will change theirs). To this end, adoptChild and dropChild call this method, and, as necessary, this method calls the parent's, etc, walking up the tree to mark all the nodes that need updating.

This method does not schedule a rendering frame, because since it cannot be the case that only the compositing bits changed, something else will have scheduled a frame for us.


void markNeedsCompositingBitsUpdate() {
  if (_needsCompositingBitsUpdate)
  _needsCompositingBitsUpdate = true;
  if (parent is RenderObject) {
    final RenderObject parent = this.parent! as RenderObject;
    if (parent._needsCompositingBitsUpdate)
    if (!isRepaintBoundary && !parent.isRepaintBoundary) {
  assert(() {
    final AbstractNode? parent = this.parent;
    if (parent is RenderObject)
      return parent._needsCompositing;
    return true;
  // parent is fine (or there isn't one), but we are dirty
  if (owner != null)