LocalGraphicsContext

Property

Common
val LocalGraphicsContext =
staticCompositionLocalOf<GraphicsContext> { noLocalProvidedFor("LocalGraphicsContext") }

The CompositionLocal to provide access to a GraphicsContext instance for creation of GraphicsLayers.

Consumers that access this Local directly and call GraphicsContext.createGraphicsLayer are responsible for calling GraphicsContext.releaseGraphicsLayer.

It is recommended that consumers invoke rememberGraphicsLayer instead to ensure that a GraphicsLayer is released when the corresponding composable is disposed.