@searsuite/sear-render-strategy
Drawing strategies
- classDirtyRenderStrategy
-
class DirtyRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Incremental renderer that redraws only dirty regions.
It reads dirty rectangles from the registered dirty tracker, clears those regions on both on-screen and off-screen contexts, redraws intersected nodes, and finally resets the dirty tracker.
constructor DirtyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): DirtyRenderStrategy<NodeTypeProperties>property readonly symbol: typeof symbolstaticDI token for resolving DirtyRenderStrategy.
method getContext(): RenderContextReturns the screen render context used by this strategy.
method getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Dirty strategy does not currently expose coordinate lookup.
ThrowsError Always thrown until this API is implemented.
method render(node: Node<NodeTypeProperties>): voidRedraws all dirty regions for both render targets.
Each dirty rect is processed atomically: clearRect followed immediately by redraw of intersecting nodes. This guarantees that a later rect's clear can erase pixels re-painted by an earlier rect's redraw — critical for cases like cell-editor exit where the overflow area must stay clean despite the grid cell's TextNode redrawing overflow text into it.
Inherited members 9
Inherited from RenderStrategy.
- classEventRenderStrategy
-
class EventRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Render strategy dedicated to event-layer integration.
This strategy currently acts as a placeholder extension point. It shares the same contract as all render strategies so event visualization can be added later without changing orchestration code.
constructor EventRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): EventRenderStrategy<NodeTypeProperties>property readonly symbol: typeof symbolstaticDI token for resolving EventRenderStrategy.
method getContext(): RenderContextReturns the context used by this strategy.
method getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Event-layer hit lookup is not implemented yet.
ThrowsError Always thrown until this API is implemented.
method render(node: Node<NodeTypeProperties>): voidExecutes event-layer rendering.
Current implementation is intentionally a no-op.
Inherited members 9
Inherited from RenderStrategy.
- classHitRenderStrategy
-
class HitRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Strategy for hit-testing rendering and coordinate-to-node lookup.
The hit layer paints interactive nodes with unique colors on an off-screen canvas. Pointer coordinates are then resolved by reading back pixel colors and mapping them to scene nodes.
constructor HitRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker, platform: Platform): HitRenderStrategy<NodeTypeProperties>property readonly symbol: typeof symbolstaticDI token for resolving HitRenderStrategy.
method debouncedRender(node: Node<NodeTypeProperties>): voidActually performs the hit-canvas rendering after debounce.
nodeNode to render
method destroy(): voidCancels deferred hit-layer work when the owning editor is destroyed.
method flushPendingScrollRender(): voidEnsures a pointer event never reads a hit layer from before the latest scroll-driven scene rebuild. The normal path remains frame-coalesced; this only runs when the user interacts before that frame is delivered.
method getContext(): RenderContextGet the current rendering context.
ReturnsRenderContext
method getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Get all nodes at the given (x, y) coordinate by reading the hit-canvas pixel.
ReturnsArray of nodes at the given coordinate
nodeRoot node to search from
xX coordinate
yY coordinate
method render(node: Node<NodeTypeProperties>, delay?: number): voidDebounced render entry. Only the last call within the delay will trigger rendering.
nodeNode to render
delayDebounce delay in ms
method renderImmediate(node: Node<NodeTypeProperties>): voidRender the hit canvas immediately, bypassing the debounce timer.
Used after viewport-culled plugins rebuild their scene nodes during scroll. Since new FixBoxNode instances get new random color keys, the hit canvas must be redrawn before the next click event. The normal debounced path would keep resetting the timer during continuous scrolling, leaving the hit canvas stale and clicks unresolvable.
method renderOnNextFrame(node: Node<NodeTypeProperties>): voidSchedules a hit-layer refresh for the next frame. Wheel events can be delivered many times per frame; only the newest rebuilt scene matters.
Inherited members 9
Inherited from RenderStrategy.
- classOverlayRenderStrategy
-
class OverlayRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Render pass that paints editor overlays at the very end of the pipeline.
This pass guarantees edit-mode visuals stay above sticky headers and any other layers by drawing nodes with
isEditafter StickyRenderStrategy.constructor OverlayRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): OverlayRenderStrategy<NodeTypeProperties>property readonly symbol: typeof symbolstaticDI token for resolving OverlayRenderStrategy.
method getContext(): RenderContextReturns the context.
method getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Returns the node by coordinates.
method render(node: Node<NodeTypeProperties>): voidRenders OverlayRenderStrategy scene output.
Inherited members 9
Inherited from RenderStrategy.
- classRenderStrategy
-
class RenderStrategy<T>Base abstraction for all render strategies.
A render strategy encapsulates one rendering concern (screen layer, hit layer, sticky overlays, dirty-region redraw, etc.) and shares a common life-cycle:
- Receive scroll updates from ScrollManager.
- Derive absolute scroll position and frame delta.
- Trigger strategy-specific rendering.
- Persist previous scroll state for the next frame comparison.
Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.
constructor RenderStrategy<T>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<T>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): RenderStrategy<T>property readonly dirtyTree: GenerationalDirtyTrackerproperty readonly hitRenderContext: RenderContextproperty readonly offScreenRenderContext: RenderContextproperty readonly renderContext: RenderContextproperty readonly renderCoordinatorManager: RenderCoordinatorManagerproperty readonly scrollManager: ScrollManagerproperty readonly stage: SceneGraph<T>property readonly tree: Tree<PositionRect<templateLiteral>>method getContext(): RenderContextReturns the render context owned by this strategy.
method getNodeByCoordinates(node: Node<T>, x: number, y: number): Node<T>[]Resolves nodes around the provided coordinates for this strategy layer.
method getViewScaleContexts(): readonly RenderContext[]Render contexts whose view scale is owned by this strategy.
Strategies that introduce an additional layer can override this method and include its context. RenderStrategyManager de-duplicates shared contexts before applying a scale change.
method render(node: Node<T>): voidRenders the target node tree according to the strategy semantics.
- classRenderStrategyManager
-
class RenderStrategyManager<NodeTypeProperties>Registry and lookup manager for render strategies.
The render engine uses this manager to compose a strategy pipeline by name. Names can be string keys or symbols to avoid collisions in plugin scenarios.
constructor RenderStrategyManager<NodeTypeProperties>(): RenderStrategyManager<NodeTypeProperties>property readonly symbol: symbolstaticDI token for resolving RenderStrategyManager.
method addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidRegisters or replaces a strategy under the provided key.
method addStrategyAfter(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately after an existing strategy.
method addStrategyBefore(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately before an existing strategy.
method enforceCommandBoundary(isExecuting: (): boolean): voidCloses direct strategy and view-scale changes after Sheet startup.
method getAllStrategy(): RenderStrategy<NodeTypeProperties>[]Returns all currently registered strategies in insertion order.
method getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefinedRetrieves a strategy by key.
method setViewScale(scale: number): voidPropagates view scale to every context contributed by registered strategies. Shared base/off-screen/hit contexts are updated once.
- classScreenRenderStrategy
-
class ScreenRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Base abstraction for all render strategies.
A render strategy encapsulates one rendering concern (screen layer, hit layer, sticky overlays, dirty-region redraw, etc.) and shares a common life-cycle:
- Receive scroll updates from ScrollManager.
- Derive absolute scroll position and frame delta.
- Trigger strategy-specific rendering.
- Persist previous scroll state for the next frame comparison.
Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.
constructor ScreenRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker, rasterCopyExecutor: RasterCopyExecutor): ScreenRenderStrategy<NodeTypeProperties>Creates a screen render strategy with injected render targets and copy executor.
property readonly symbol: typeof symbolstaticDI token for resolving ScreenRenderStrategy.
method configureRuntime(runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>): voidConfigures host-specific viewport, query, and drawing semantics.
method getContext(): RenderContextReturns the current render context.
The returned context targets the on-screen canvas.
method getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Not implemented: Finds nodes at the given coordinates.
ThrowsError
method render(node: Node<NodeTypeProperties>): voidRenders the scene graph node using an off-screen buffer for efficient scrolling.
nodeThe root node to render.
Inherited members 9
Inherited from RenderStrategy.
- classStickyRenderStrategy
-
class StickyRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>StickyRenderStrategy is responsible for rendering all StickyNode instances. It should be used after the main render strategy to overlay sticky elements.
constructor StickyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): StickyRenderStrategy<NodeTypeProperties>property readonly symbol: typeof symbolstaticDI token for resolving StickyRenderStrategy.
method getContext(): RenderContextReturns the current render context.
method getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Not implemented: Finds nodes at the given coordinates.
ThrowsError
method render(node: Node<NodeTypeProperties>): voidRenders all StickyNode descendants of the given node. Sticky nodes are positioned according to their sticky logic (top/left).
nodeThe root node to search for StickyNode descendants.
Inherited members 9
Inherited from RenderStrategy.
- interfaceScreenRenderStrategyRuntime
-
interface ScreenRenderStrategyRuntime<NodeTypeProperties>property readonly consumeBlockRasterCopyPlan?: (): BlockRasterCopyPlan | nullConsumes a pending block-copy plan for layout-shift frames, if the host has one.
property readonly drawNodes?: (input: { context: RenderContext; nodes: readonly Node<NodeTypeProperties>[]; scrollState: ScrollManagerState; worldRect: PositionRect<templateLiteral> }): voidDraws already queried nodes into the visible render context.
property readonly forceFullRepaint?: (): booleanForces a full visible body repaint even when the off-screen cache is ready.
property readonly getScrollState?: (): ScrollManagerStateReturns the scroll state used for world queries and raster copy deltas.
property readonly getViewport?: (): PositionRect<templateLiteral>Returns the viewport-space rectangle covered by this screen layer.
property readonly isScrollStateChanged?: (scrollState: ScrollManagerState): booleanReturns whether the current scroll state requires a scroll-copy frame.
property readonly onFrameRendered?: (mode: ScreenRenderFrameMode): voidCalled after a full, scroll, or rebuilt frame is rendered.
property readonly queryNodes?: (root: Node<NodeTypeProperties>, worldRect: PositionRect<templateLiteral>): readonly Node<NodeTypeProperties>[]Returns screen-body nodes to draw for the supplied world-space rectangle.
property readonly requiresFrameRebuild?: (): booleanReturns whether this frame should rebuild a retained render target.
property readonly toWorldRect?: (viewportRect: PositionRect<templateLiteral>, scrollState: ScrollManagerState): PositionRect<templateLiteral>Maps a viewport-space repaint rectangle to a world-space query rectangle.
- typeScreenRenderFrameMode
-
type ScreenRenderFrameMode = "rebuild" | "full" | "scroll" | "block-copy"ScreenRenderStrategy handles rendering with an off-screen buffer to optimize scroll performance. It minimizes redraws by copying unchanged regions and only re-rendering areas affected by scrolling.
Rendering modes:
- First frame: full draw to screen, then clone into off-screen buffer.
- Scroll frame: blit preserved region from off-screen, redraw only newly exposed strip, then sync back to off-screen.
Incremental redraw
Dirty regions and the incremental policy decide whether a frame can reuse the previous one or needs a rebuild.
- classDirtyRegionCollector
-
class DirtyRegionCollector<T>Collects frame-scoped dirty regions and builds dirty clip geometry.
The collector is intentionally independent from Sheet cells. It owns only rectangle collection, frame cleanup, stroke expansion and the concave union clip used when a dirty region must include both a changed area and the previously painted node bounds.
constructor DirtyRegionCollector<T>(source: DirtyRegionSource<T>): DirtyRegionCollector<T>Creates a collector around a frame-scoped dirty source.
sourceDirty source owned by the host renderer.
method clear(): voidClears all dirty rectangles from the underlying source.
method collect(): PositionRect<T>[]Returns all dirty rectangles accumulated for the current frame.
The source is not cleared by this method; callers should clear only after the frame's redraw work has succeeded or has been intentionally skipped.
method createClipRegion<T>(dirtyRect: PositionRect<T>, nodeRect: PositionRect<T>, strokeWidth: number, useUnionClip: boolean): PositionRect<templateLiteral> | [number, number][]staticBuilds the repaint clip for one dirty region and one intersecting node.
Most nodes can repaint within the expanded dirty rectangle. Selection-like nodes may need a concave clip covering the union of the dirty region and the node's previous bounds so erased borders do not leave seams.
ReturnsA rectangle or polygon accepted by scene node draw calls.
dirtyRectDirty rectangle in world coordinates.
nodeRectNode bounds in world coordinates.
strokeWidthStroke width used to expand both dirty and node bounds.
useUnionClipWhether to compute the concave union boundary.
method dedupePoints(points: [number, number][]): [number, number][]staticRemoves duplicated points while preserving first occurrence order.
ReturnsDeduplicated polygon points.
pointsPolygon points.
method expand<T>(rect: PositionRect<T>, padding: number): PositionRect<templateLiteral>staticExpands a dirty rectangle by a symmetric stroke padding.
ReturnsExpanded rectangle suitable for clipping repaint work.
rectDirty rectangle in world coordinates.
paddingPixels added to every edge.
method removeCollinear(points: [number, number][]): [number, number][]staticDrops middle vertices that lie on a straight line.
Degenerate polygons are preserved as-is so callers can fall back to a rectangle when the boundary cannot form a useful clip.
ReturnsCleaned polygon points.
pointsPolygon points in boundary order.
method traceUnionBoundary(rectA: DirtyRegionBounds, rectB: DirtyRegionBounds): [number, number][]staticTraces the outer boundary of the union of two axis-aligned rectangles.
The returned path may be concave and is intended for clip construction, not for hit testing or layout geometry.
ReturnsBoundary points in drawing order.
rectAFirst rectangle bounds.
rectBSecond rectangle bounds.
- classIncrementalRenderPolicy
-
Decides whether an incremental render candidate is worth using for the next frame.
constructor IncrementalRenderPolicy(): IncrementalRenderPolicyproperty readonly symbol: typeof symbolstaticDI token for resolving IncrementalRenderPolicy.
method evaluate(candidate: IncrementalRenderCandidate, limits?: IncrementalRenderPolicyLimits): IncrementalRenderDecision - classViewportFrameCache
-
Manages the off-screen viewport frame used by Canvas scroll optimization.
The cache wraps
RenderContext.isDrawnso consumers do not need to reach into the render target directly. It provides explicit operations for clearing, priming after first paint, and refreshing after an incremental scroll redraw.constructor ViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCacheCreates a viewport frame cache facade.
cacheContextOff-screen render target that stores the last complete base frame.
copyExecutorRaster copy executor used for cache synchronization.
method clear(viewport: PositionRectProps): voidClears the cached viewport with an identity transform.
viewportViewport-space rectangle to erase from the cache.
method invalidate(): voidMarks the cached frame invalid so the next render performs a full prime.
method isReady(): booleanReturns whether the cache already contains a complete base frame.
method markReady(): voidMarks the cached frame ready after a complete frame has been copied in.
method primeFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): voidPrimes the cache from the visible frame after a first full paint.
visibleContextVisible render target containing a complete base frame.
viewportViewport-space rectangle to clear before copying.
method refreshFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): voidRefreshes the cache from the visible target after incremental redraw.
visibleContextVisible render target containing the latest base frame.
viewportViewport-space rectangle to copy into the cache.
- interfaceDirtyRegionBounds
-
Boundary represented by four world-space edges.
property readonly x1: numberLeft edge in world coordinates.
property readonly x2: numberRight edge in world coordinates.
property readonly y1: numberTop edge in world coordinates.
property readonly y2: numberBottom edge in world coordinates.
- interfaceDirtyRegionSource
-
interface DirtyRegionSource<T>Minimal dirty-region storage contract consumed by DirtyRegionCollector.
Sheet uses
GenerationalDirtyTracker; future document renderers can provide a block/page dirty source with the same boundary, query and frame-clear contract without depending on Sheet scene internals.method clear(): voidClears dirty state after the owning frame has consumed it.
method getBoundary(): PositionRect<T>Returns the total query boundary that contains all possible dirty entries.
method query(range: PositionRect<T>): PositionRect<T>[]Returns dirty rectangles intersecting the provided query range.
- interfaceIncrementalRenderCandidate
-
Measured cost shape for one proposed incremental render frame.
property readonly copiedArea: numberTotal destination pixel area copied from the retained/off-screen frame cache.
property readonly copyCount: numberNumber of raster copy rectangles in the candidate plan.
property readonly invalidArea: numberTotal world pixel area that still needs redraw after raster reuse.
property readonly invalidRectCount: numberNumber of invalid redraw rectangles in the candidate plan.
property readonly viewport: Pick<PositionRectProps, "width" | "height">Viewport dimensions used as the baseline for area ratios.
- interfaceIncrementalRenderDecision
- interfaceIncrementalRenderPolicyLimits
-
Guardrails used to decide whether an incremental render plan is cheaper and safe enough to use.
property readonly maxCopiedAreaRatio: numberMaximum total copied pixel area divided by viewport area. Values above 1 allow overlapping or repeated copies.
property readonly maxCopyCount: numberMaximum number of raster copy rectangles allowed in one frame.
property readonly maxInvalidAreaRatio: numberMaximum invalid redraw area divided by viewport area after raster copies have been applied.
property readonly maxInvalidRectCount: numberMaximum number of invalid redraw rectangles allowed in one frame.
- interfaceRenderContextCapabilities
-
Capability snapshot used by viewport render coordinators before choosing a raster strategy.
- typeIncrementalRenderDecisionReason
-
type IncrementalRenderDecisionReason = typeof IncrementalRenderDecisionReason[keyof typeof IncrementalRenderDecisionReason]IncrementalRenderDecisionReason: { Accepted: "accepted"; EmptyViewport: "empty-viewport"; ExcessiveCopiedArea: "excessive-copied-area"; ExcessiveCopyCount: "excessive-copy-count"; ExcessiveInvalidArea: "excessive-invalid-area"; ExcessiveInvalidRectCount: "excessive-invalid-rect-count"; NotCandidate: "not-candidate" } - variableDEFAULT_INCREMENTAL_RENDER_POLICY_LIMITS
-
DEFAULT_INCREMENTAL_RENDER_POLICY_LIMITS: IncrementalRenderPolicyLimits - functionclearViewport
-
clearViewport(context: RenderContext, viewport: PositionRectProps): void - functionclearViewportRect
-
clearViewportRect(context: RenderContext, rect: PositionRectProps): void - functioncreateViewportFrameCache
-
createViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCache - functionreadRenderContextCapabilities
-
readRenderContextCapabilities(context: RenderContext): RenderContextCapabilities - functionrequiresViewportExplicitNodeClear
-
requiresViewportExplicitNodeClear(context: RenderContext): boolean - functionrequiresViewportFrameRebuild
-
requiresViewportFrameRebuild(context: RenderContext): boolean - functionsupportsViewportDirtyRedraw
-
supportsViewportDirtyRedraw(context: RenderContext): boolean - functionworldRectToViewportClearRect
-
worldRectToViewportClearRect<T>(rect: PositionRect<T>, scrollX: number, scrollY: number, padding: number): PositionRect<templateLiteral>
Raster copying
Raster copy plans reuse already painted pixels when a viewport change makes that safe.
- classBlockRasterCopyPlan
-
Raster-copy plan for layout shifts where unchanged blocks move within the viewport.
constructor BlockRasterCopyPlan(viewport: PositionRectProps, clearViewportRects: readonly PositionRect<templateLiteral>[], cacheToViewportCopies: readonly RasterCopyRect[], invalidWorldRects: readonly PositionRect<templateLiteral>[]): BlockRasterCopyPlanproperty readonly cacheToViewportCopies: readonly RasterCopyRect[]property readonly clearViewportRects: readonly PositionRect<templateLiteral>[]property readonly invalidWorldRects: readonly PositionRect<templateLiteral>[]property readonly viewport: PositionRectPropsmethod fromLayoutShift(input: BlockRasterCopyPlanInput): BlockRasterCopyPlan | nullstatic - classRasterCopyExecutor
-
Executes raster copies between render contexts with transform isolation.
The executor owns the identity-transform save/restore wrapper used by Canvas viewport copy paths. Retained targets can avoid this executor entirely by selecting a full-frame rebuild through context capabilities.
constructor RasterCopyExecutor(): RasterCopyExecutorproperty readonly symbol: typeof symbolstaticDI token for resolving RasterCopyExecutor.
method copy(source: RenderContext, destination: RenderContext, copy: RasterCopyRect): voidCopies a rectangular pixel region from one render target into another.
sourceSource render context.
destinationDestination render context.
copySource and destination rectangles in viewport coordinates.
method copyNatural(source: RenderContext, destination: RenderContext, x?: number, y?: number): voidCopies the source target at its natural size to a viewport-space origin.
This keeps initial off-screen cache priming compatible with existing Canvas behavior where the complete visible backing store is cloned after first paint.
sourceSource render context.
destinationDestination render context.
xDestination x-coordinate.
yDestination y-coordinate.
- classRasterCopyPlan
-
Immutable plan for reusing viewport pixels across render targets.
A plan describes the off-screen-to-visible copy for a scroll frame, the newly exposed viewport rectangle that still needs node redraw, and the final visible-to-off-screen copy that refreshes the cache after redraw.
constructor RasterCopyPlan(viewport: PositionRect<templateLiteral>, cacheToViewportCopy: RasterCopyRect, blankViewportRect: PositionRect<templateLiteral>, blankWorldRect: PositionRect<templateLiteral>, viewportToCacheCopy: RasterCopyRect): RasterCopyPlanCreates a raster copy plan.
viewportViewport rectangle in viewport coordinates.
cacheToViewportCopyCopy from the cached frame into the visible target.
blankViewportRectNewly exposed viewport-space area to redraw.
blankWorldRectNewly exposed world-space area to query from the scene.
viewportToCacheCopyCopy from the visible target back into the cache.
property readonly blankViewportRect: PositionRect<templateLiteral>Newly exposed viewport-space area to redraw.
property readonly blankWorldRect: PositionRect<templateLiteral>Newly exposed world-space area to query from the scene.
property readonly cacheToViewportCopy: RasterCopyRectCopy from the cached frame into the visible target.
property readonly viewport: PositionRect<templateLiteral>Viewport rectangle in viewport coordinates.
property readonly viewportToCacheCopy: RasterCopyRectCopy from the visible target back into the cache.
method createViewportToCacheCopy(viewport: PositionRectProps): RasterCopyRectstaticCreates a full-viewport copy from the visible target into the frame cache.
ReturnsCopy rectangle with identical source and destination bounds.
viewportViewport-space bounds to copy.
method fromScroll(viewport: PositionRect<templateLiteral>, scrollState: ScrollManagerState): RasterCopyPlanstaticBuilds the scroll-copy plan used by Canvas viewport renderers.
The delta convention follows
RenderStrategy:deltais previous minus current, whiledrawImagesource offsets use current minus previous.ReturnsPlan for copy, exposed-area redraw, and cache refresh.
viewportVisible viewport rectangle in viewport coordinates.
scrollStateCurrent scroll snapshot.
- interfaceBlockRasterCopyCandidate
- interfaceBlockRasterCopyPlanInput
- interfaceRasterCopyRect
-
Source and destination rectangles for one raster copy.
property readonly destination: PositionRectPropsDestination pixels inside the destination render target, expressed in viewport coordinates.
property readonly source: PositionRectPropsSource pixels inside the source render target, expressed in viewport coordinates.
No matching API entries.