Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.ComposeUiFlags
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -250,6 +251,10 @@ internal class RootNodeOwner(
fun draw(canvas: Canvas) = trace("RootNodeOwner:draw") {
ownedLayerManager.draw(canvas)
clearInvalidObservations()
@OptIn(ExperimentalComposeUiApi::class)
if (ComposeUiFlags.isRectTrackingEnabled) {
owner.rectManager.dispatchCallbacks()
}
}

fun setRootModifier(modifier: Modifier) {
Expand Down Expand Up @@ -447,6 +452,10 @@ internal class RootNodeOwner(
measureAndLayoutDelegate.onNodeDetached(node)
snapshotObserver.clear(node)
needClearObservations = true
@OptIn(ExperimentalComposeUiApi::class)
if (ComposeUiFlags.isRectTrackingEnabled) {
rectManager.remove(node)
}
}

override fun measureAndLayout(sendPointerUpdate: Boolean) {
Expand All @@ -461,6 +470,10 @@ internal class RootNodeOwner(
snapshotInvalidationTracker.requestDraw()
}
measureAndLayoutDelegate.dispatchOnPositionedCallbacks()
@OptIn(ExperimentalComposeUiApi::class)
if (ComposeUiFlags.isRectTrackingEnabled) {
rectManager.dispatchCallbacks()
}
}
}
}
Expand All @@ -475,6 +488,10 @@ internal class RootNodeOwner(
if (!measureAndLayoutDelegate.hasPendingMeasureOrLayout) {
measureAndLayoutDelegate.dispatchOnPositionedCallbacks()
}
@OptIn(ExperimentalComposeUiApi::class)
if (ComposeUiFlags.isRectTrackingEnabled) {
rectManager.dispatchCallbacks()
}
}
}

Expand Down Expand Up @@ -545,6 +562,10 @@ internal class RootNodeOwner(
}

override fun onLayoutNodeDeactivated(layoutNode: LayoutNode) {
@OptIn(ExperimentalComposeUiApi::class)
if (ComposeUiFlags.isRectTrackingEnabled) {
rectManager.remove(layoutNode)
}
}

override fun onPreLayoutNodeReused(layoutNode: LayoutNode, oldSemanticsId: Int) {
Expand Down