Property

LocalGraphicsContext

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

Source set: 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][import androidx.compose.ui.graphics.rememberGraphicsLayer] instead to ensure that a GraphicsLayer is released when the corresponding composable is disposed.

Last updated: