Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
donner::editor::RenderRequest Struct Reference

Per-request handoff data captured at render-request time so the worker has everything it needs without touching live UI state. More...

#include "donner/editor/AsyncRenderer.h"

Classes

struct  DragPreview

Public Member Functions

 RenderRequest (svg::Renderer &renderer, svg::SVGDocument document)
 Construct a render request.

Public Attributes

RenderLease lease
 Non-null renderer/document lease for the worker handoff.
std::uint64_t version = 0
 Document frame version snapshotted at request time so the UI can match the landed bitmap with other same-version assets.
std::uint64_t documentGeneration = 0
 Generation counter from AsyncSVGDocument::documentGeneration(). Bumps only when the inner document is fully replaced, so the worker can reset entity-keyed compositor state without treating every frame mutation as a replacement.
std::unordered_map< Entity, EntitystructuralRemap
 Entity remap for structurally equivalent document replacement. When present, the worker remaps compositor state instead of fully resetting layer bitmaps and static segments.
std::optional< svg::SVGElementselection
 Snapshot of the selection at request time (used for overlay chrome). The worker holds this optional by value, so if the UI thread clears the selection mid-render the worker still draws the pre-render chrome.
Entity selectedEntity = entt::null
 Currently-selected entity (if any) that the compositor should keep promoted across renders. The compositor demotes the previous entity and promotes this one when it changes. Allows pre-warming on selection so the subsequent drag frame has cached bg/fg/layer bitmaps ready. The compositor stays alive across drag → idle transitions for as long as this stays non-null and pointing at the same entity.
std::optional< DragPreviewdragPreview
 Optional in-progress drag preview rendered through the compositor fast path.
EditorRasterViewport rasterViewport
 Raster viewport for this request. The UI thread computes it from the editor camera so the worker can render a bounded high-zoom output surface without reading live UI state.
bool overviewInfillOnly = false
 True when this request should produce only a low-resolution full-document overview infill.
bool captureCpuSnapshot = false
 Capture a CPU-readable copy of the fully composed frame.

Detailed Description

Per-request handoff data captured at render-request time so the worker has everything it needs without touching live UI state.


Class Documentation

◆ donner::editor::RenderRequest::DragPreview

struct donner::editor::RenderRequest::DragPreview
Class Members
Transform2d documentFromCachedDocument = Transform2d() Active affine transform represented by this request. Selection prewarms use identity.
uint64_t dragGeneration = 0 Monotonic id for the active drag gesture. Selection prewarms use zero.
Entity entity = entt::null
vector< Entity > extraEntities Additional entities moving with entity under the same active drag transform.
bool forceLayerRasterization = false True when this request must re-rasterize the promoted drag layer instead of only publishing updated compose metadata. Used for scheduler-requested affine recaptures that keep scaled drag previews crisp.
InteractionHint interactionKind = svg::compositor::InteractionHint::ActiveDrag Which interaction phase drove this preview. Selection means the editor is pre-warming a layer for the selected entity before any drag begins. ActiveDrag means the user is actively dragging - the DOM's transform attribute already reflects the cursor delta. The compositor stamps the correct InteractionHint on the entity based on this field so downstream introspection stays accurate.
Vector2d translation = Vector2d::Zero() Active drag translation represented by this request. Selection prewarms use zero.

Constructor & Destructor Documentation

◆ RenderRequest()

donner::editor::RenderRequest::RenderRequest ( svg::Renderer & renderer,
svg::SVGDocument document )
inline

Construct a render request.

Parameters
rendererRenderer backend that remains alive until the request completes.
documentDocument handle to render. The request keeps its registry handle alive while the worker owns the request.

Member Data Documentation

◆ captureCpuSnapshot

bool donner::editor::RenderRequest::captureCpuSnapshot = false

Capture a CPU-readable copy of the fully composed frame.

Geode normally publishes GPU texture tiles without readback. Diagnostics, replay tools, and pixel-asserting tests set this flag when they explicitly need a bitmap.

◆ overviewInfillOnly

bool donner::editor::RenderRequest::overviewInfillOnly = false

True when this request should produce only a low-resolution full-document overview infill.

The worker still keeps the selected entity promoted, but skips the composited split preview and publishes a full-canvas tile. The UI uploads it into the retained overview cache without replacing active viewport-bounded tiles.


The documentation for this struct was generated from the following file: