IsometricRenderer
Renderer that converts the isometric node tree to visual output using a SceneProjector for projection and depth sorting.
Coordinates between focused collaborators:
SceneCache — prepared-scene caching and invalidation
HitTestResolver — spatial indexing and command-to-node hit-test resolution
NativeSceneRenderer — Android-native rendering backend
Shared extensions: toComposePath and toComposeColor
Platform notes:
DrawScope.render uses Compose
DrawScopeAPIs and is cross-platform compatible.DrawScope.renderNative uses
android.graphics.Canvasdirectly and is Android-only. It provides ~2x faster rendering but will throw NoClassDefFoundError on non-Android platforms.
Constructors
Properties
Optional benchmark hooks for instrumentation. Set via IsometricScene's DisposableEffect from LocalBenchmarkHooks. Null in production (zero overhead).
When true, forces a cache rebuild every frame (disables PreparedScene caching). Used by benchmarks to measure projectScene() cost independently of caching.
Optional callback invoked when a render command fails to draw. Receives the command ID and the exception. The command is skipped. Null in production (errors are silently skipped).
Functions
Invalidate cache (call when render options change).
Release all cached resources. Idempotent — safe to call multiple times. After close(), the renderer must not be used for rendering; any attempt will throw IllegalStateException.
Perform hit testing with optional spatial indexing.
Render the node tree to a DrawScope with path caching.
Render using native Android canvas (2x faster, Android-only).