KiteRenderSpec

@Immutable
sealed interface KiteRenderSpec(source)

How KiteDocView turns pages into pixels. Pick a variant; each carries only the knobs that actually apply to it, so there are no settings that silently do nothing. Defaults to Rasterized via KiteRenderSpec.Default.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@Immutable
data class Rasterized(val quality: Float = 1.0f, val maxBitmapLongSide: Int = 4096, val rerasterizeOnZoom: Boolean = true, val preserveHairlines: Boolean = true, val cacheBudgetBytes: Long = 96L * 1024 * 1024, val canvasDecorator: KiteCanvasDecorator? = null) : KiteRenderSpec

Vector-render each page into a bitmap for its size and its settled zoom, then draw that bitmap and GPU-transform it during gestures, so scrolling and zoom never redraw the page itself. Heavy gesturing is cheap and content-independent; the costs are one rasterization per page size and per settled zoom, and softness when zoomed past the raster resolution until the zoom settles and it re-rasterizes. Best for slow devices and dense pages.

Link copied to clipboard
@Immutable
data class Vectorized(val hairlineWidthPx: Float = 1.0f, val canvasDecorator: KiteCanvasDecorator? = null, val imageCacheBudgetBytes: Long = 16L * 1024 * 1024) : KiteRenderSpec

Draw each page into a live Canvas, transformed by zoom/pan via the same GPU layer: no bitmap (lower memory). Vector content stays sharp at rest on every platform. The page draws again when its size, the theme or this spec changes. A change to the overlay, such as a search hit or a highlight, and each frame of a pinch replay the drawing that the page recorded. Once a zoom settles, the page draws again at it, so images keep the detail the zoom shows and a hairline stays about one screen pixel wide (#418). On Android the vector display list replays under the live transform, so it stays crisp even mid-pinch; on Skia targets (iOS/desktop/web) the layer is texture-cached, so deep in-gesture zoom softens until the draw re-runs. Per-page draw cost scales with content complexity. Best for simple pages, deep-zoom crispness, and low memory.