|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
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::chrono::steady_clock::time_point | queuedAt |
| Internal timestamp captured by requestRender() for queue-latency diagnostics. | |
| 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, Entity > | structuralRemap |
| 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::SVGElement > | selection |
| 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< DragPreview > | dragPreview |
| 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. | |
| ViewportState | viewport |
| Live editor viewport rasterViewport was derived from. | |
| 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. | |
Per-request handoff data captured at render-request time so the worker has everything it needs without touching live UI state.
| struct donner::editor::RenderRequest::DragPreview |
| Class Members | ||
|---|---|---|
| Transform2d | documentFromCachedDocument = Transform2d() | Active affine transform represented by this request, relative to the drag-start cached document. 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. |
|
inline |
Construct a render request.
| renderer | Renderer backend that remains alive until the request completes. |
| document | Document handle to render. The request keeps its registry handle alive while the worker owns the request. |
| 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.
| 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.
| ViewportState donner::editor::RenderRequest::viewport |
Live editor viewport rasterViewport was derived from.
Carried through the worker untouched so presentation can place the resulting pixels with the same screen transform they were rasterized against. Placing them through a later viewport would stretch a viewport-bounded raster past the document region it actually covers.