useDrawingSurface

context(env: JniEnv)
inline fun <T> Awt.useDrawingSurface(target: JAwtComponent, block: (DrawingSurface) -> T): T(source)

Gets a DrawingSurface from a target JAwtComponent and executes block with it. Then safely release the surface.

Throw IllegalStateException if getDrawingSurface fails.