/** * @file frame.ts * @brief GPU uploads, layered redraws and frame presentation. */ import { Tint } from "./tint.js"; /** @brief One frame: uploads, depth batches, the kept scene and the output range. */ export declare abstract class Frame extends Tint { protected upload(): void; protected begin(): void; protected keepDepth(start: number, end: number): void; protected drawDepth(start: number, end: number, clipped: boolean): void; protected keepDestination(slot: number, requiredX0?: number, requiredY0?: number, requiredX1?: number, requiredY1?: number): void; protected partial(): void; protected reads(slot: number, nr: number): boolean; protected settleShown(): void; protected show(): void; protected openScene(w: number, h: number): void; protected dropScene(): void; protected applyRange(): void; protected applySurfaceScale(): void; /** * @brief Whether `warm` has work: programs linked ahead that may be done, or new programs whose * pipeline the driver has not built yet. */ needsWarm(): boolean; /** * @brief Finish the program links started ahead that are done, and draw nothing once with every * new program so the driver builds its pipeline before its first real draw (a pause of about * 0.1 s otherwise). * @details Call it between frames, when nothing animates: it changes no pixel and needs no * frame, but the driver is busy while it builds a pipeline, so each call draws with one program * only. Extended-range programs are only finished, not drawn. * @returns True while links started ahead are still running or programs are left to draw with; * call again later. */ warm(): boolean; /** * @brief Whether `render` would draw something the last frame does not show: a changed input, * the backdrop, the output range or an open luminance reading. * @details A running transition is reported by the return value of `render` instead. When this * is false and the last `render` returned false, skipping the frame leaves the canvas showing * the last one. */ needsRender(): boolean; /** * @brief Start the transition clock again: the next `render` advances nothing, and later frames * advance by their time since that one. * @details Call it before the first frame after idle frames that were not rendered, so a * transition starting then does not take the idle time as its first step. */ restartClock(): void; /** * @brief Finish tone and visibility transitions before producing a settled frame. * @details Renders once and performs blocking luminance reads for adaptive shapes. Use before * `render` when the next frame must show the final state. */ settle(): void; /** * @brief Draw the backdrop and every shape into the default framebuffer. * @param now Time in milliseconds (the animation frame timestamp); it drives tone transitions. * Default: the clock. * @returns True while another frame is needed: a tone transition is running or a luminance * reading is pending. */ render(now?: number): boolean; }