KiteRenderSpec

sealed interface KiteRenderSpec

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
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 once into a bitmap per size/zoom bucket, 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 hitch per bucket 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
data class Vectorized(val hairlineWidthPx: Float = 1.0f, val canvasDecorator: KiteCanvasDecorator? = null) : KiteRenderSpec

Redraw each page into a live Canvas every composition, transformed by zoom/pan via the same GPU layer: no bitmap (lower memory), resolution-independent quality at rest on every platform. 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.