rasterizeOffMain

suspend fun rasterizeOffMain(page: KitePage, widthPx: Int, heightPx: Int, background: Color = Color.White, hairlineWidthPx: Float = 1.0f, theme: ReaderTheme? = null): ImageBitmap

rasterize, off the main thread where the platform allows. One page runs to completion once started (the synchronous renderer has no cancellation points; the operation budget bounds the worst case), so cancellation takes effect between pages.

Pages that fall back to system-font text (EPUB body text, PDFs without embedded outlines) are re-rendered on Dispatchers.Main: skiko's text stack shares process-global state with the host UI thread, and no lock of ours can exclude that thread, so the only safe place to measure or draw through it is the main thread itself. Pages whose glyphs all have embedded outlines (the common PDF case) stay entirely on the pool.