in packages/core/src/rendering/render-object.ts [892:910]
updateNeedsCompositing() {
if (!this._needsCompositingDirty) {
return
}
const prevNeedsCompositing = this._needsCompositing
this._needsCompositing = false
this.visitChildren(child => {
child.updateNeedsCompositing()
if (child.needsCompositing)
this._needsCompositing = true
})
if (this.repaintBoundary || this.alwaysNeedsCompositing) {
this._needsCompositing = true
}
if (prevNeedsCompositing !== this._needsCompositing) {
this.markPaintDirty()
}
this._needsCompositingDirty = false
}