Donner 0.5.1
Embeddable browser-grade SVG2 engine
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"

Collaboration diagram for donner::editor::RenderRequest:
[legend]

Classes

struct  DragPreview

Public Attributes

svg::Rendererrenderer = nullptr
svg::SVGDocumentdocument = nullptr
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(). Only bumps when the inner document is fully replaced (source-pane reparse / load). The worker uses this to decide when to drop the compositor's activeHints_ backing the old entity space — NOT version, which bumps on every mutation and would nuke the compositor every drag frame.
std::unordered_map< Entity, EntitystructuralRemap
 When non-empty, carries a remap from the previous document's entity ids to the current document's entity ids — produced by AsyncSVGDocument::setDocumentMaybeStructural when the swap was structurally equivalent (same tree shape, same ids). The worker uses the remap to call CompositorController::remapAfterStructural Replace instead of resetAllLayers(documentReplaced=true), preserving layer bitmaps + segments across the swap. Empty map means "fall through to the `documentGeneration` mismatch path" (full reset).
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.

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
Entity entity = entt::null
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, so no extra translation is passed here. The compositor stamps the correct InteractionHint on the entity based on this field so downstream introspection stays accurate.

Member Data Documentation

◆ document

svg::SVGDocument* donner::editor::RenderRequest::document = nullptr

◆ documentGeneration

std::uint64_t donner::editor::RenderRequest::documentGeneration = 0

Generation counter from AsyncSVGDocument::documentGeneration(). Only bumps when the inner document is fully replaced (source-pane reparse / load). The worker uses this to decide when to drop the compositor's activeHints_ backing the old entity space — NOT version, which bumps on every mutation and would nuke the compositor every drag frame.

◆ dragPreview

std::optional<DragPreview> donner::editor::RenderRequest::dragPreview

Optional in-progress drag preview rendered through the compositor fast path.

◆ renderer

svg::Renderer* donner::editor::RenderRequest::renderer = nullptr

◆ selectedEntity

Entity donner::editor::RenderRequest::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.

◆ selection

std::optional<svg::SVGElement> donner::editor::RenderRequest::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.

◆ structuralRemap

std::unordered_map<Entity, Entity> donner::editor::RenderRequest::structuralRemap

When non-empty, carries a remap from the previous document's entity ids to the current document's entity ids — produced by AsyncSVGDocument::setDocumentMaybeStructural when the swap was structurally equivalent (same tree shape, same ids). The worker uses the remap to call CompositorController::remapAfterStructural Replace instead of resetAllLayers(documentReplaced=true), preserving layer bitmaps + segments across the swap. Empty map means "fall through to the `documentGeneration` mismatch path" (full reset).

◆ version

std::uint64_t donner::editor::RenderRequest::version = 0

Document frame version snapshotted at request time so the UI can match the landed bitmap with other same-version assets.


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