compose/remote/remote-core/doc/DATA_FLOW.md
This document describes how a RemoteCompose document moves from initial creation to final rendering on a device.
The developer uses the RemoteComposeWriter (Java) or RemoteComposeContext (Kotlin DSL) to emit operations.
WireBuffer (a growable byte array).RemoteComposeState tracks unique IDs for strings, bitmaps, paths, and dynamic variables.PaintBundle and is only emitted when commit() is called.The contents of the WireBuffer are sent over the network or IPC as a simple byte array (byte[]).
The Player receives the bytes and initializes a CoreDocument.
Operations.read() iterates through the buffer, looking up the OpCode in the DefaultVersionMap and instantiating the corresponding Operation class.COMPONENT_START, CONTAINER_END) reconstruct the UI hierarchy.RemoteContext.The Player runs a continuous loop (often driven by vsync):
RemoteClock updates global time variables (ANIMATION_TIME, CONTINUOUS_SEC).RemoteContext evaluates dynamic expressions (RPN) whose dependencies have changed.LayoutCompute calculates the new geometry.Operation list.
apply(RemoteContext).Paint state.RemoteComposeView, mapped back to components, and may trigger host-side callbacks or local variable updates.